[kernel] refresh generic 2.6.24 patches
[openwrt.git] / target / linux / generic-2.6 / patches-2.6.24 / 700-powerpc_git.patch
1 Index: linux-2.6.24.7/Documentation/kernel-parameters.txt
2 ===================================================================
3 --- linux-2.6.24.7.orig/Documentation/kernel-parameters.txt
4 +++ linux-2.6.24.7/Documentation/kernel-parameters.txt
5 @@ -686,6 +686,7 @@ and is between 256 and 4096 characters. 
6                         See Documentation/isdn/README.HiSax.
7  
8         hugepages=      [HW,X86-32,IA-64] Maximal number of HugeTLB pages.
9 +       hugepagesz=     [HW,IA-64,PPC] The size of the HugeTLB pages.
10  
11         i8042.direct    [HW] Put keyboard port into non-translated mode
12         i8042.dumbkbd   [HW] Pretend that controller can only read data from
13 Index: linux-2.6.24.7/Documentation/powerpc/00-INDEX
14 ===================================================================
15 --- linux-2.6.24.7.orig/Documentation/powerpc/00-INDEX
16 +++ linux-2.6.24.7/Documentation/powerpc/00-INDEX
17 @@ -28,3 +28,6 @@ sound.txt
18         - info on sound support under Linux/PPC
19  zImage_layout.txt
20         - info on the kernel images for Linux/PPC
21 +qe_firmware.txt
22 +       - describes the layout of firmware binaries for the Freescale QUICC
23 +         Engine and the code that parses and uploads the microcode therein.
24 Index: linux-2.6.24.7/Documentation/powerpc/booting-without-of.txt
25 ===================================================================
26 --- linux-2.6.24.7.orig/Documentation/powerpc/booting-without-of.txt
27 +++ linux-2.6.24.7/Documentation/powerpc/booting-without-of.txt
28 @@ -52,7 +52,11 @@ Table of Contents
29        i) Freescale QUICC Engine module (QE)
30        j) CFI or JEDEC memory-mapped NOR flash
31        k) Global Utilities Block
32 -      l) Xilinx IP cores
33 +      l) Freescale Communications Processor Module
34 +      m) Chipselect/Local Bus
35 +      n) 4xx/Axon EMAC ethernet nodes
36 +      o) Xilinx IP cores
37 +      p) Freescale Synchronous Serial Interface
38  
39    VII - Specifying interrupt information for devices
40      1) interrupts property
41 @@ -671,10 +675,10 @@ device or bus to be described by the dev
42  
43  In general, the format of an address for a device is defined by the
44  parent bus type, based on the #address-cells and #size-cells
45 -property. In the absence of such a property, the parent's parent
46 -values are used, etc... The kernel requires the root node to have
47 -those properties defining addresses format for devices directly mapped
48 -on the processor bus.
49 +properties.  Note that the parent's parent definitions of #address-cells
50 +and #size-cells are not inhereted so every node with children must specify
51 +them.  The kernel requires the root node to have those properties defining
52 +addresses format for devices directly mapped on the processor bus.
53  
54  Those 2 properties define 'cells' for representing an address and a
55  size. A "cell" is a 32-bit number. For example, if both contain 2
56 @@ -711,13 +715,14 @@ define a bus type with a more complex ad
57  like address space bits, you'll have to add a bus translator to the
58  prom_parse.c file of the recent kernels for your bus type.
59  
60 -The "reg" property only defines addresses and sizes (if #size-cells
61 -is non-0) within a given bus. In order to translate addresses upward
62 +The "reg" property only defines addresses and sizes (if #size-cells is
63 +non-0) within a given bus. In order to translate addresses upward
64  (that is into parent bus addresses, and possibly into CPU physical
65  addresses), all busses must contain a "ranges" property. If the
66  "ranges" property is missing at a given level, it's assumed that
67 -translation isn't possible. The format of the "ranges" property for a
68 -bus is a list of:
69 +translation isn't possible, i.e., the registers are not visible on the
70 +parent bus.  The format of the "ranges" property for a bus is a list
71 +of:
72  
73         bus address, parent bus address, size
74  
75 @@ -735,6 +740,10 @@ fit in a single 32-bit word.   New 32-bi
76  1/1 format, unless the processor supports physical addresses greater
77  than 32-bits, in which case a 2/1 format is recommended.
78  
79 +Alternatively, the "ranges" property may be empty, indicating that the
80 +registers are visible on the parent bus using an identity mapping
81 +translation.  In other words, the parent bus address space is the same
82 +as the child bus address space.
83  
84  2) Note about "compatible" properties
85  -------------------------------------
86 @@ -1218,16 +1227,14 @@ platforms are moved over to use the flat
87  
88    Required properties:
89      - reg : Offset and length of the register set for the device
90 -    - device_type : Should be "mdio"
91      - compatible : Should define the compatible device type for the
92 -      mdio.  Currently, this is most likely to be "gianfar"
93 +      mdio.  Currently, this is most likely to be "fsl,gianfar-mdio"
94  
95    Example:
96  
97         mdio@24520 {
98                 reg = <24520 20>;
99 -               device_type = "mdio"; 
100 -               compatible = "gianfar";
101 +               compatible = "fsl,gianfar-mdio";
102  
103                 ethernet-phy@0 {
104                         ......
105 @@ -1254,6 +1261,10 @@ platforms are moved over to use the flat
106        services interrupts for this device.
107      - phy-handle : The phandle for the PHY connected to this ethernet
108        controller.
109 +    - fixed-link : <a b c d e> where a is emulated phy id - choose any,
110 +      but unique to the all specified fixed-links, b is duplex - 0 half,
111 +      1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
112 +      pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
113  
114    Recommended properties:
115  
116 @@ -1408,7 +1419,6 @@ platforms are moved over to use the flat
117  
118     Example multi port host USB controller device node :
119         usb@22000 {
120 -               device_type = "usb";
121                 compatible = "fsl-usb2-mph";
122                 reg = <22000 1000>;
123                 #address-cells = <1>;
124 @@ -1422,7 +1432,6 @@ platforms are moved over to use the flat
125  
126     Example dual role USB controller device node :
127         usb@23000 {
128 -               device_type = "usb";
129                 compatible = "fsl-usb2-dr";
130                 reg = <23000 1000>;
131                 #address-cells = <1>;
132 @@ -1586,7 +1595,6 @@ platforms are moved over to use the flat
133     iii) USB (Universal Serial Bus Controller)
134  
135     Required properties:
136 -   - device_type : should be "usb".
137     - compatible : could be "qe_udc" or "fhci-hcd".
138     - mode : the could be "host" or "slave".
139     - reg : Offset and length of the register set for the device
140 @@ -1600,7 +1608,6 @@ platforms are moved over to use the flat
141  
142     Example(slave):
143         usb@6c0 {
144 -               device_type = "usb";
145                 compatible = "qe_udc";
146                 reg = <6c0 40>;
147                 interrupts = <8b 0>;
148 @@ -1613,7 +1620,7 @@ platforms are moved over to use the flat
149  
150     Required properties:
151     - device_type : should be "network", "hldc", "uart", "transparent"
152 -    "bisync" or "atm".
153 +     "bisync", "atm", or "serial".
154     - compatible : could be "ucc_geth" or "fsl_atm" and so on.
155     - model : should be "UCC".
156     - device-id : the ucc number(1-8), corresponding to UCCx in UM.
157 @@ -1626,6 +1633,26 @@ platforms are moved over to use the flat
158     - interrupt-parent : the phandle for the interrupt controller that
159       services interrupts for this device.
160     - pio-handle : The phandle for the Parallel I/O port configuration.
161 +   - port-number : for UART drivers, the port number to use, between 0 and 3.
162 +     This usually corresponds to the /dev/ttyQE device, e.g. <0> = /dev/ttyQE0.
163 +     The port number is added to the minor number of the device.  Unlike the
164 +     CPM UART driver, the port-number is required for the QE UART driver.
165 +   - soft-uart : for UART drivers, if specified this means the QE UART device
166 +     driver should use "Soft-UART" mode, which is needed on some SOCs that have
167 +     broken UART hardware.  Soft-UART is provided via a microcode upload.
168 +   - rx-clock-name: the UCC receive clock source
169 +     "none": clock source is disabled
170 +     "brg1" through "brg16": clock source is BRG1-BRG16, respectively
171 +     "clk1" through "clk24": clock source is CLK1-CLK24, respectively
172 +   - tx-clock-name: the UCC transmit clock source
173 +     "none": clock source is disabled
174 +     "brg1" through "brg16": clock source is BRG1-BRG16, respectively
175 +     "clk1" through "clk24": clock source is CLK1-CLK24, respectively
176 +   The following two properties are deprecated.  rx-clock has been replaced
177 +   with rx-clock-name, and tx-clock has been replaced with tx-clock-name.
178 +   Drivers that currently use the deprecated properties should continue to
179 +   do so, in order to support older device trees, but they should be updated
180 +   to check for the new properties first.
181     - rx-clock : represents the UCC receive clock source.
182       0x00 : clock source is disabled;
183       0x1~0x10 : clock source is BRG1~BRG16 respectively;
184 @@ -1772,6 +1799,32 @@ platforms are moved over to use the flat
185                 };
186         };
187  
188 +   viii) Uploaded QE firmware
189 +
190 +        If a new firwmare has been uploaded to the QE (usually by the
191 +        boot loader), then a 'firmware' child node should be added to the QE
192 +        node.  This node provides information on the uploaded firmware that
193 +        device drivers may need.
194 +
195 +        Required properties:
196 +        - id: The string name of the firmware.  This is taken from the 'id'
197 +              member of the qe_firmware structure of the uploaded firmware.
198 +              Device drivers can search this string to determine if the
199 +              firmware they want is already present.
200 +        - extended-modes: The Extended Modes bitfield, taken from the
201 +                          firmware binary.  It is a 64-bit number represented
202 +                          as an array of two 32-bit numbers.
203 +        - virtual-traps: The virtual traps, taken from the firmware binary.
204 +                         It is an array of 8 32-bit numbers.
205 +
206 +        Example:
207 +
208 +               firmware {
209 +                       id = "Soft-UART";
210 +                       extended-modes = <0 0>;
211 +                       virtual-traps = <0 0 0 0 0 0 0 0>;
212 +               }
213 +
214     j) CFI or JEDEC memory-mapped NOR flash
215  
216      Flash chips (Memory Technology Devices) are often used for solid state
217 @@ -2075,8 +2128,7 @@ platforms are moved over to use the flat
218  
219     Example:
220         localbus@f0010100 {
221 -               compatible = "fsl,mpc8272ads-localbus",
222 -                            "fsl,mpc8272-localbus",
223 +               compatible = "fsl,mpc8272-localbus",
224                              "fsl,pq2-localbus";
225                 #address-cells = <2>;
226                 #size-cells = <1>;
227 @@ -2254,7 +2306,7 @@ platforms are moved over to use the flat
228                            available.
229                            For Axon: 0x0000012a
230  
231 -   l) Xilinx IP cores
232 +   o) Xilinx IP cores
233  
234     The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
235     in Xilinx Spartan and Virtex FPGAs.  The devices cover the whole range
236 @@ -2276,7 +2328,7 @@ platforms are moved over to use the flat
237     properties of the device node.  In general, device nodes for IP-cores
238     will take the following form:
239  
240 -       (name)@(base-address) {
241 +       (name): (generic-name)@(base-address) {
242                 compatible = "xlnx,(ip-core-name)-(HW_VER)"
243                              [, (list of compatible devices), ...];
244                 reg = <(baseaddr) (size)>;
245 @@ -2286,6 +2338,9 @@ platforms are moved over to use the flat
246                 xlnx,(parameter2) = <(int-value)>;
247         };
248  
249 +       (generic-name):   an open firmware-style name that describes the
250 +                       generic class of device.  Preferably, this is one word, such
251 +                       as 'serial' or 'ethernet'.
252         (ip-core-name): the name of the ip block (given after the BEGIN
253                         directive in system.mhs).  Should be in lowercase
254                         and all underscores '_' converted to dashes '-'.
255 @@ -2294,9 +2349,9 @@ platforms are moved over to use the flat
256                         dropped from the parameter name, the name is converted
257                         to lowercase and all underscore '_' characters are
258                         converted to dashes '-'.
259 -       (baseaddr):     the C_BASEADDR parameter.
260 +       (baseaddr):     the baseaddr parameter value (often named C_BASEADDR).
261         (HW_VER):       from the HW_VER parameter.
262 -       (size):         equals C_HIGHADDR - C_BASEADDR + 1
263 +       (size):         the address range size (often C_HIGHADDR - C_BASEADDR + 1).
264  
265     Typically, the compatible list will include the exact IP core version
266     followed by an older IP core version which implements the same
267 @@ -2326,11 +2381,11 @@ platforms are moved over to use the flat
268  
269     becomes the following device tree node:
270  
271 -       opb-uartlite-0@ec100000 {
272 +       opb_uartlite_0: serial@ec100000 {
273                 device_type = "serial";
274                 compatible = "xlnx,opb-uartlite-1.00.b";
275                 reg = <ec100000 10000>;
276 -               interrupt-parent = <&opb-intc>;
277 +               interrupt-parent = <&opb_intc_0>;
278                 interrupts = <1 0>; // got this from the opb_intc parameters
279                 current-speed = <d#115200>;     // standard serial device prop
280                 clock-frequency = <d#50000000>; // standard serial device prop
281 @@ -2339,16 +2394,19 @@ platforms are moved over to use the flat
282                 xlnx,use-parity = <0>;
283         };
284  
285 -   Some IP cores actually implement 2 or more logical devices.  In this case,
286 -   the device should still describe the whole IP core with a single node
287 -   and add a child node for each logical device.  The ranges property can
288 -   be used to translate from parent IP-core to the registers of each device.
289 -   (Note: this makes the assumption that both logical devices have the same
290 -   bus binding.  If this is not true, then separate nodes should be used for
291 -   each logical device).  The 'cell-index' property can be used to enumerate
292 -   logical devices within an IP core.  For example, the following is the
293 -   system.mhs entry for the dual ps2 controller found on the ml403 reference
294 -   design.
295 +   Some IP cores actually implement 2 or more logical devices.  In
296 +   this case, the device should still describe the whole IP core with
297 +   a single node and add a child node for each logical device.  The
298 +   ranges property can be used to translate from parent IP-core to the
299 +   registers of each device.  In addition, the parent node should be
300 +   compatible with the bus type 'xlnx,compound', and should contain
301 +   #address-cells and #size-cells, as with any other bus.  (Note: this
302 +   makes the assumption that both logical devices have the same bus
303 +   binding.  If this is not true, then separate nodes should be used
304 +   for each logical device).  The 'cell-index' property can be used to
305 +   enumerate logical devices within an IP core.  For example, the
306 +   following is the system.mhs entry for the dual ps2 controller found
307 +   on the ml403 reference design.
308  
309         BEGIN opb_ps2_dual_ref
310                 PARAMETER INSTANCE = opb_ps2_dual_ref_0
311 @@ -2370,21 +2428,24 @@ platforms are moved over to use the flat
312  
313     It would result in the following device tree nodes:
314  
315 -       opb_ps2_dual_ref_0@a9000000 {
316 +       opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
317 +               #address-cells = <1>;
318 +               #size-cells = <1>;
319 +               compatible = "xlnx,compound";
320                 ranges = <0 a9000000 2000>;
321                 // If this device had extra parameters, then they would
322                 // go here.
323                 ps2@0 {
324                         compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
325                         reg = <0 40>;
326 -                       interrupt-parent = <&opb-intc>;
327 +                       interrupt-parent = <&opb_intc_0>;
328                         interrupts = <3 0>;
329                         cell-index = <0>;
330                 };
331                 ps2@1000 {
332                         compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
333                         reg = <1000 40>;
334 -                       interrupt-parent = <&opb-intc>;
335 +                       interrupt-parent = <&opb_intc_0>;
336                         interrupts = <3 0>;
337                         cell-index = <0>;
338                 };
339 @@ -2447,17 +2508,18 @@ platforms are moved over to use the flat
340  
341     Gives this device tree (some properties removed for clarity):
342  
343 -       plb-v34-0 {
344 +       plb@0 {
345                 #address-cells = <1>;
346                 #size-cells = <1>;
347 +               compatible = "xlnx,plb-v34-1.02.a";
348                 device_type = "ibm,plb";
349                 ranges; // 1:1 translation
350  
351 -               plb-bram-if-cntrl-0@ffff0000 {
352 +               plb_bram_if_cntrl_0: bram@ffff0000 {
353                         reg = <ffff0000 10000>;
354                 }
355  
356 -               opb-v20-0 {
357 +               opb@20000000 {
358                         #address-cells = <1>;
359                         #size-cells = <1>;
360                         ranges = <20000000 20000000 20000000
361 @@ -2465,11 +2527,11 @@ platforms are moved over to use the flat
362                                   80000000 80000000 40000000
363                                   c0000000 c0000000 20000000>;
364  
365 -                       opb-uart16550-0@a0000000 {
366 +                       opb_uart16550_0: serial@a0000000 {
367                                 reg = <a00000000 2000>;
368                         };
369  
370 -                       opb-intc-0@d1000fc0 {
371 +                       opb_intc_0: interrupt-controller@d1000fc0 {
372                                 reg = <d1000fc0 20>;
373                         };
374                 };
375 @@ -2514,6 +2576,46 @@ platforms are moved over to use the flat
376        Requred properties:
377         - current-speed : Baud rate of uartlite
378  
379 +    p) Freescale Synchronous Serial Interface
380 +
381 +       The SSI is a serial device that communicates with audio codecs.  It can
382 +       be programmed in AC97, I2S, left-justified, or right-justified modes.
383 +
384 +       Required properties:
385 +       - compatible      : compatible list, containing "fsl,ssi"
386 +       - cell-index      : the SSI, <0> = SSI1, <1> = SSI2, and so on
387 +       - reg             : offset and length of the register set for the device
388 +       - interrupts      : <a b> where a is the interrupt number and b is a
389 +                            field that represents an encoding of the sense and
390 +                           level information for the interrupt.  This should be
391 +                           encoded based on the information in section 2)
392 +                           depending on the type of interrupt controller you
393 +                           have.
394 +       - interrupt-parent : the phandle for the interrupt controller that
395 +                            services interrupts for this device.
396 +       - fsl,mode        : the operating mode for the SSI interface
397 +                           "i2s-slave" - I2S mode, SSI is clock slave
398 +                           "i2s-master" - I2S mode, SSI is clock master
399 +                           "lj-slave" - left-justified mode, SSI is clock slave
400 +                           "lj-master" - l.j. mode, SSI is clock master
401 +                           "rj-slave" - right-justified mode, SSI is clock slave
402 +                           "rj-master" - r.j., SSI is clock master
403 +                           "ac97-slave" - AC97 mode, SSI is clock slave
404 +                           "ac97-master" - AC97 mode, SSI is clock master
405 +
406 +       Optional properties:
407 +       - codec-handle    : phandle to a 'codec' node that defines an audio
408 +                           codec connected to this SSI.  This node is typically
409 +                           a child of an I2C or other control node.
410 +
411 +       Child 'codec' node required properties:
412 +       - compatible      : compatible list, contains the name of the codec
413 +
414 +       Child 'codec' node optional properties:
415 +       - clock-frequency  : The frequency of the input clock, which typically
416 +                            comes from an on-board dedicated oscillator.
417 +
418 +
419     More devices will be defined as this spec matures.
420  
421  VII - Specifying interrupt information for devices
422 Index: linux-2.6.24.7/Documentation/powerpc/qe_firmware.txt
423 ===================================================================
424 --- /dev/null
425 +++ linux-2.6.24.7/Documentation/powerpc/qe_firmware.txt
426 @@ -0,0 +1,295 @@
427 +          Freescale QUICC Engine Firmware Uploading
428 +          -----------------------------------------
429 +
430 +(c) 2007 Timur Tabi <timur at freescale.com>,
431 +    Freescale Semiconductor
432 +
433 +Table of Contents
434 +=================
435 +
436 +  I - Software License for Firmware
437 +
438 +  II - Microcode Availability
439 +
440 +  III - Description and Terminology
441 +
442 +  IV - Microcode Programming Details
443 +
444 +  V - Firmware Structure Layout
445 +
446 +  VI - Sample Code for Creating Firmware Files
447 +
448 +Revision Information
449 +====================
450 +
451 +November 30, 2007: Rev 1.0 - Initial version
452 +
453 +I - Software License for Firmware
454 +=================================
455 +
456 +Each firmware file comes with its own software license.  For information on
457 +the particular license, please see the license text that is distributed with
458 +the firmware.
459 +
460 +II - Microcode Availability
461 +===========================
462 +
463 +Firmware files are distributed through various channels.  Some are available on
464 +http://opensource.freescale.com.  For other firmware files, please contact
465 +your Freescale representative or your operating system vendor.
466 +
467 +III - Description and Terminology
468 +================================
469 +
470 +In this document, the term 'microcode' refers to the sequence of 32-bit
471 +integers that compose the actual QE microcode.
472 +
473 +The term 'firmware' refers to a binary blob that contains the microcode as
474 +well as other data that
475 +
476 +       1) describes the microcode's purpose
477 +       2) describes how and where to upload the microcode
478 +       3) specifies the values of various registers
479 +       4) includes additional data for use by specific device drivers
480 +
481 +Firmware files are binary files that contain only a firmware.
482 +
483 +IV - Microcode Programming Details
484 +===================================
485 +
486 +The QE architecture allows for only one microcode present in I-RAM for each
487 +RISC processor.  To replace any current microcode, a full QE reset (which
488 +disables the microcode) must be performed first.
489 +
490 +QE microcode is uploaded using the following procedure:
491 +
492 +1) The microcode is placed into I-RAM at a specific location, using the
493 +   IRAM.IADD and IRAM.IDATA registers.
494 +
495 +2) The CERCR.CIR bit is set to 0 or 1, depending on whether the firmware
496 +   needs split I-RAM.  Split I-RAM is only meaningful for SOCs that have
497 +   QEs with multiple RISC processors, such as the 8360.  Splitting the I-RAM
498 +   allows each processor to run a different microcode, effectively creating an
499 +   asymmetric multiprocessing (AMP) system.
500 +
501 +3) The TIBCR trap registers are loaded with the addresses of the trap handlers
502 +   in the microcode.
503 +
504 +4) The RSP.ECCR register is programmed with the value provided.
505 +
506 +5) If necessary, device drivers that need the virtual traps and extended mode
507 +   data will use them.
508 +
509 +Virtual Microcode Traps
510 +
511 +These virtual traps are conditional branches in the microcode.  These are
512 +"soft" provisional introduced in the ROMcode in order to enable higher
513 +flexibility and save h/w traps If new features are activated or an issue is
514 +being fixed in the RAM package utilizing they should be activated.  This data
515 +structure signals the microcode which of these virtual traps is active.
516 +
517 +This structure contains 6 words that the application should copy to some
518 +specific been defined.  This table describes the structure.
519 +
520 +       ---------------------------------------------------------------
521 +       | Offset in |                  | Destination Offset | Size of |
522 +       |   array   |     Protocol     |   within PRAM      | Operand |
523 +       --------------------------------------------------------------|
524 +       |     0     | Ethernet         |      0xF8          | 4 bytes |
525 +       |           | interworking     |                    |         |
526 +       ---------------------------------------------------------------
527 +       |     4     | ATM              |      0xF8          | 4 bytes |
528 +       |           | interworking     |                    |         |
529 +       ---------------------------------------------------------------
530 +       |     8     | PPP              |      0xF8          | 4 bytes |
531 +       |           | interworking     |                    |         |
532 +       ---------------------------------------------------------------
533 +       |     12    | Ethernet RX      |      0x22          | 1 byte  |
534 +       |           | Distributor Page |                    |         |
535 +       ---------------------------------------------------------------
536 +       |     16    | ATM Globtal      |      0x28          | 1 byte  |
537 +       |           | Params Table     |                    |         |
538 +       ---------------------------------------------------------------
539 +       |     20    | Insert Frame     |      0xF8          | 4 bytes |
540 +       ---------------------------------------------------------------
541 +
542 +
543 +Extended Modes
544 +
545 +This is a double word bit array (64 bits) that defines special functionality
546 +which has an impact on the softwarew drivers.  Each bit has its own impact
547 +and has special instructions for the s/w associated with it.  This structure is
548 +described in this table:
549 +
550 +       -----------------------------------------------------------------------
551 +       | Bit #  |     Name     |   Description                               |
552 +       -----------------------------------------------------------------------
553 +       |   0    | General      | Indicates that prior to each host command   |
554 +       |        | push command | given by the application, the software must |
555 +       |        |              | assert a special host command (push command)|
556 +       |        |              | CECDR = 0x00800000.                         |
557 +       |        |              | CECR = 0x01c1000f.                          |
558 +       -----------------------------------------------------------------------
559 +       |   1    | UCC ATM      | Indicates that after issuing ATM RX INIT    |
560 +       |        | RX INIT      | command, the host must issue another special|
561 +       |        | push command | command (push command) and immediately      |
562 +       |        |              | following that re-issue the ATM RX INIT     |
563 +       |        |              | command. (This makes the sequence of        |
564 +       |        |              | initializing the ATM receiver a sequence of |
565 +       |        |              | three host commands)                        |
566 +       |        |              | CECDR = 0x00800000.                         |
567 +       |        |              | CECR = 0x01c1000f.                          |
568 +       -----------------------------------------------------------------------
569 +       |   2    | Add/remove   | Indicates that following the specific host  |
570 +       |        | command      | command: "Add/Remove entry in Hash Lookup   |
571 +       |        | validation   | Table" used in Interworking setup, the user |
572 +       |        |              | must issue another command.                 |
573 +       |        |              | CECDR = 0xce000003.                         |
574 +       |        |              | CECR = 0x01c10f58.                          |
575 +       -----------------------------------------------------------------------
576 +       |   3    | General push | Indicates that the s/w has to initialize    |
577 +       |        | command      | some pointers in the Ethernet thread pages  |
578 +       |        |              | which are used when Header Compression is   |
579 +       |        |              | activated.  The full details of these       |
580 +       |        |              | pointers is located in the software drivers.|
581 +       -----------------------------------------------------------------------
582 +       |   4    | General push | Indicates that after issuing Ethernet TX    |
583 +       |        | command      | INIT command, user must issue this command  |
584 +       |        |              | for each SNUM of Ethernet TX thread.        |
585 +       |        |              | CECDR = 0x00800003.                         |
586 +       |        |              | CECR = 0x7'b{0}, 8'b{Enet TX thread SNUM},  |
587 +       |        |              |        1'b{1}, 12'b{0}, 4'b{1}              |
588 +       -----------------------------------------------------------------------
589 +       | 5 - 31 |     N/A      | Reserved, set to zero.                      |
590 +       -----------------------------------------------------------------------
591 +
592 +V - Firmware Structure Layout
593 +==============================
594 +
595 +QE microcode from Freescale is typically provided as a header file.  This
596 +header file contains macros that define the microcode binary itself as well as
597 +some other data used in uploading that microcode.  The format of these files
598 +do not lend themselves to simple inclusion into other code.  Hence,
599 +the need for a more portable format.  This section defines that format.
600 +
601 +Instead of distributing a header file, the microcode and related data are
602 +embedded into a binary blob.  This blob is passed to the qe_upload_firmware()
603 +function, which parses the blob and performs everything necessary to upload
604 +the microcode.
605 +
606 +All integers are big-endian.  See the comments for function
607 +qe_upload_firmware() for up-to-date implementation information.
608 +
609 +This structure supports versioning, where the version of the structure is
610 +embedded into the structure itself.  To ensure forward and backwards
611 +compatibility, all versions of the structure must use the same 'qe_header'
612 +structure at the beginning.
613 +
614 +'header' (type: struct qe_header):
615 +       The 'length' field is the size, in bytes, of the entire structure,
616 +       including all the microcode embedded in it, as well as the CRC (if
617 +       present).
618 +
619 +       The 'magic' field is an array of three bytes that contains the letters
620 +       'Q', 'E', and 'F'.  This is an identifier that indicates that this
621 +       structure is a QE Firmware structure.
622 +
623 +       The 'version' field is a single byte that indicates the version of this
624 +       structure.  If the layout of the structure should ever need to be
625 +       changed to add support for additional types of microcode, then the
626 +       version number should also be changed.
627 +
628 +The 'id' field is a null-terminated string(suitable for printing) that
629 +identifies the firmware.
630 +
631 +The 'count' field indicates the number of 'microcode' structures.  There
632 +must be one and only one 'microcode' structure for each RISC processor.
633 +Therefore, this field also represents the number of RISC processors for this
634 +SOC.
635 +
636 +The 'soc' structure contains the SOC numbers and revisions used to match
637 +the microcode to the SOC itself.  Normally, the microcode loader should
638 +check the data in this structure with the SOC number and revisions, and
639 +only upload the microcode if there's a match.  However, this check is not
640 +made on all platforms.
641 +
642 +Although it is not recommended, you can specify '0' in the soc.model
643 +field to skip matching SOCs altogether.
644 +
645 +The 'model' field is a 16-bit number that matches the actual SOC. The
646 +'major' and 'minor' fields are the major and minor revision numbrs,
647 +respectively, of the SOC.
648 +
649 +For example, to match the 8323, revision 1.0:
650 +     soc.model = 8323
651 +     soc.major = 1
652 +     soc.minor = 0
653 +
654 +'padding' is neccessary for structure alignment.  This field ensures that the
655 +'extended_modes' field is aligned on a 64-bit boundary.
656 +
657 +'extended_modes' is a bitfield that defines special functionality which has an
658 +impact on the device drivers.  Each bit has its own impact and has special
659 +instructions for the driver associated with it.  This field is stored in
660 +the QE library and available to any driver that calles qe_get_firmware_info().
661 +
662 +'vtraps' is an array of 8 words that contain virtual trap values for each
663 +virtual traps.  As with 'extended_modes', this field is stored in the QE
664 +library and available to any driver that calles qe_get_firmware_info().
665 +
666 +'microcode' (type: struct qe_microcode):
667 +       For each RISC processor there is one 'microcode' structure.  The first
668 +       'microcode' structure is for the first RISC, and so on.
669 +
670 +       The 'id' field is a null-terminated string suitable for printing that
671 +       identifies this particular microcode.
672 +
673 +       'traps' is an array of 16 words that contain hardware trap values
674 +       for each of the 16 traps.  If trap[i] is 0, then this particular
675 +       trap is to be ignored (i.e. not written to TIBCR[i]).  The entire value
676 +       is written as-is to the TIBCR[i] register, so be sure to set the EN
677 +       and T_IBP bits if necessary.
678 +
679 +       'eccr' is the value to program into the ECCR register.
680 +
681 +       'iram_offset' is the offset into IRAM to start writing the
682 +       microcode.
683 +
684 +       'count' is the number of 32-bit words in the microcode.
685 +
686 +       'code_offset' is the offset, in bytes, from the beginning of this
687 +       structure where the microcode itself can be found.  The first
688 +       microcode binary should be located immediately after the 'microcode'
689 +       array.
690 +
691 +       'major', 'minor', and 'revision' are the major, minor, and revision
692 +       version numbers, respectively, of the microcode.  If all values are 0,
693 +       then these fields are ignored.
694 +
695 +       'reserved' is necessary for structure alignment.  Since 'microcode'
696 +       is an array, the 64-bit 'extended_modes' field needs to be aligned
697 +       on a 64-bit boundary, and this can only happen if the size of
698 +       'microcode' is a multiple of 8 bytes.  To ensure that, we add
699 +       'reserved'.
700 +
701 +After the last microcode is a 32-bit CRC.  It can be calculated using
702 +this algorithm:
703 +
704 +u32 crc32(const u8 *p, unsigned int len)
705 +{
706 +       unsigned int i;
707 +       u32 crc = 0;
708 +
709 +       while (len--) {
710 +          crc ^= *p++;
711 +          for (i = 0; i < 8; i++)
712 +                  crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0);
713 +       }
714 +       return crc;
715 +}
716 +
717 +VI - Sample Code for Creating Firmware Files
718 +============================================
719 +
720 +A Python program that creates firmware binaries from the header files normally
721 +distributed by Freescale can be found on http://opensource.freescale.com.
722 Index: linux-2.6.24.7/arch/powerpc/Kconfig
723 ===================================================================
724 --- linux-2.6.24.7.orig/arch/powerpc/Kconfig
725 +++ linux-2.6.24.7/arch/powerpc/Kconfig
726 @@ -140,6 +140,9 @@ config DEFAULT_UIMAGE
727           Used to allow a board to specify it wants a uImage built by default
728         default n
729  
730 +config REDBOOT
731 +       bool
732 +
733  config PPC64_SWSUSP
734         bool
735         depends on PPC64 && (BROKEN || (PPC_PMAC64 && EXPERIMENTAL))
736 @@ -160,11 +163,13 @@ config PPC_DCR
737  
738  config PPC_OF_PLATFORM_PCI
739         bool
740 +       depends on PCI
741         depends on PPC64 # not supported on 32 bits yet
742         default n
743  
744  source "init/Kconfig"
745  
746 +source "arch/powerpc/sysdev/Kconfig"
747  source "arch/powerpc/platforms/Kconfig"
748  
749  menu "Kernel options"
750 @@ -417,7 +422,7 @@ endmenu
751  
752  config ISA_DMA_API
753         bool
754 -       default y
755 +       default !PPC_ISERIES || PCI
756  
757  menu "Bus options"
758  
759 @@ -467,7 +472,7 @@ config MCA
760  config PCI
761         bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
762                 || PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
763 -               || PPC_PS3
764 +               || PPC_PS3 || 44x
765         default y if !40x && !CPM2 && !8xx && !PPC_83xx \
766                 && !PPC_85xx && !PPC_86xx
767         default PCI_PERMEDIA if !4xx && !CPM2 && !8xx
768 Index: linux-2.6.24.7/arch/powerpc/Kconfig.debug
769 ===================================================================
770 --- linux-2.6.24.7.orig/arch/powerpc/Kconfig.debug
771 +++ linux-2.6.24.7/arch/powerpc/Kconfig.debug
772 @@ -151,6 +151,13 @@ config BOOTX_TEXT
773  
774  config PPC_EARLY_DEBUG
775         bool "Early debugging (dangerous)"
776 +       help
777 +         Say Y to enable some early debugging facilities that may be available
778 +         for your processor/board combination. Those facilities are hacks
779 +         intended to debug problems early during boot, this should not be
780 +         enabled in a production kernel.
781 +         Note that enabling this will also cause the kernel default log level
782 +         to be pushed to max automatically very early during boot
783  
784  choice
785         prompt "Early debugging console"
786 @@ -218,7 +225,16 @@ config PPC_EARLY_DEBUG_44x
787         depends on 44x
788         help
789           Select this to enable early debugging for IBM 44x chips via the
790 -         inbuilt serial port.
791 +         inbuilt serial port.  If you enable this, ensure you set
792 +          PPC_EARLY_DEBUG_44x_PHYSLOW below to suit your target board.
793 +
794 +config PPC_EARLY_DEBUG_40x
795 +       bool "Early serial debugging for IBM/AMCC 40x CPUs"
796 +       depends on 40x
797 +       help
798 +         Select this to enable early debugging for IBM 40x chips via the
799 +         inbuilt serial port. This works on chips with a 16550 compatible
800 +         UART. Xilinx chips with uartlite cannot use this option.
801  
802  config PPC_EARLY_DEBUG_CPM
803         bool "Early serial debugging for Freescale CPM-based serial ports"
804 @@ -235,12 +251,20 @@ config PPC_EARLY_DEBUG_44x_PHYSLOW
805         hex "Low 32 bits of early debug UART physical address"
806         depends on PPC_EARLY_DEBUG_44x
807         default "0x40000200"
808 +       help
809 +         You probably want 0x40000200 for ebony boards and
810 +          0x40000300 for taishan
811  
812  config PPC_EARLY_DEBUG_44x_PHYSHIGH
813         hex "EPRN of early debug UART physical address"
814         depends on PPC_EARLY_DEBUG_44x
815         default "0x1"
816  
817 +config PPC_EARLY_DEBUG_40x_PHYSADDR
818 +       hex "Early debug UART physical address"
819 +       depends on PPC_EARLY_DEBUG_40x
820 +       default "0xef600300"
821 +
822  config PPC_EARLY_DEBUG_CPM_ADDR
823         hex "CPM UART early debug transmit descriptor address"
824         depends on PPC_EARLY_DEBUG_CPM
825 Index: linux-2.6.24.7/arch/powerpc/Makefile
826 ===================================================================
827 --- linux-2.6.24.7.orig/arch/powerpc/Makefile
828 +++ linux-2.6.24.7/arch/powerpc/Makefile
829 @@ -167,6 +167,9 @@ boot := arch/$(ARCH)/boot
830  $(BOOT_TARGETS): vmlinux
831         $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
832  
833 +bootwrapper_install:
834 +       $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
835 +
836  define archhelp
837    @echo '* zImage          - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'
838    @echo '  install         - Install kernel using'
839 Index: linux-2.6.24.7/arch/powerpc/boot/4xx.c
840 ===================================================================
841 --- linux-2.6.24.7.orig/arch/powerpc/boot/4xx.c
842 +++ linux-2.6.24.7/arch/powerpc/boot/4xx.c
843 @@ -22,16 +22,14 @@
844  #include "dcr.h"
845  
846  /* Read the 4xx SDRAM controller to get size of system memory. */
847 -void ibm4xx_fixup_memsize(void)
848 +void ibm4xx_sdram_fixup_memsize(void)
849  {
850         int i;
851         unsigned long memsize, bank_config;
852  
853         memsize = 0;
854         for (i = 0; i < ARRAY_SIZE(sdram_bxcr); i++) {
855 -               mtdcr(DCRN_SDRAM0_CFGADDR, sdram_bxcr[i]);
856 -               bank_config = mfdcr(DCRN_SDRAM0_CFGDATA);
857 -
858 +               bank_config = SDRAM0_READ(sdram_bxcr[i]);
859                 if (bank_config & SDRAM_CONFIG_BANK_ENABLE)
860                         memsize += SDRAM_CONFIG_BANK_SIZE(bank_config);
861         }
862 @@ -39,6 +37,69 @@ void ibm4xx_fixup_memsize(void)
863         dt_fixup_memory(0, memsize);
864  }
865  
866 +/* Read the 440SPe MQ controller to get size of system memory. */
867 +#define DCRN_MQ0_B0BAS         0x40
868 +#define DCRN_MQ0_B1BAS         0x41
869 +#define DCRN_MQ0_B2BAS         0x42
870 +#define DCRN_MQ0_B3BAS         0x43
871 +
872 +static u64 ibm440spe_decode_bas(u32 bas)
873 +{
874 +       u64 base = ((u64)(bas & 0xFFE00000u)) << 2;
875 +
876 +       /* open coded because I'm paranoid about invalid values */
877 +       switch ((bas >> 4) & 0xFFF) {
878 +       case 0:
879 +               return 0;
880 +       case 0xffc:
881 +               return base + 0x000800000ull;
882 +       case 0xff8:
883 +               return base + 0x001000000ull;
884 +       case 0xff0:
885 +               return base + 0x002000000ull;
886 +       case 0xfe0:
887 +               return base + 0x004000000ull;
888 +       case 0xfc0:
889 +               return base + 0x008000000ull;
890 +       case 0xf80:
891 +               return base + 0x010000000ull;
892 +       case 0xf00:
893 +               return base + 0x020000000ull;
894 +       case 0xe00:
895 +               return base + 0x040000000ull;
896 +       case 0xc00:
897 +               return base + 0x080000000ull;
898 +       case 0x800:
899 +               return base + 0x100000000ull;
900 +       }
901 +       printf("Memory BAS value 0x%08x unsupported !\n", bas);
902 +       return 0;
903 +}
904 +
905 +void ibm440spe_fixup_memsize(void)
906 +{
907 +       u64 banktop, memsize = 0;
908 +
909 +       /* Ultimately, we should directly construct the memory node
910 +        * so we are able to handle holes in the memory address space
911 +        */
912 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B0BAS));
913 +       if (banktop > memsize)
914 +               memsize = banktop;
915 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B1BAS));
916 +       if (banktop > memsize)
917 +               memsize = banktop;
918 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B2BAS));
919 +       if (banktop > memsize)
920 +               memsize = banktop;
921 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B3BAS));
922 +       if (banktop > memsize)
923 +               memsize = banktop;
924 +
925 +       dt_fixup_memory(0, memsize);
926 +}
927 +
928 +
929  /* 4xx DDR1/2 Denali memory controller support */
930  /* DDR0 registers */
931  #define DDR0_02                        2
932 @@ -77,19 +138,13 @@ void ibm4xx_fixup_memsize(void)
933  
934  #define DDR_GET_VAL(val, mask, shift)  (((val) >> (shift)) & (mask))
935  
936 -static inline u32 mfdcr_sdram0(u32 reg)
937 -{
938 -        mtdcr(DCRN_SDRAM0_CFGADDR, reg);
939 -        return mfdcr(DCRN_SDRAM0_CFGDATA);
940 -}
941 -
942  void ibm4xx_denali_fixup_memsize(void)
943  {
944         u32 val, max_cs, max_col, max_row;
945         u32 cs, col, row, bank, dpath;
946         unsigned long memsize;
947  
948 -       val = mfdcr_sdram0(DDR0_02);
949 +       val = SDRAM0_READ(DDR0_02);
950         if (!DDR_GET_VAL(val, DDR_START, DDR_START_SHIFT))
951                 fatal("DDR controller is not initialized\n");
952  
953 @@ -99,12 +154,12 @@ void ibm4xx_denali_fixup_memsize(void)
954         max_row = DDR_GET_VAL(val, DDR_MAX_ROW_REG, DDR_MAX_ROW_REG_SHIFT);
955  
956         /* get CS value */
957 -       val = mfdcr_sdram0(DDR0_10);
958 +       val = SDRAM0_READ(DDR0_10);
959  
960         val = DDR_GET_VAL(val, DDR_CS_MAP, DDR_CS_MAP_SHIFT);
961         cs = 0;
962         while (val) {
963 -               if (val && 0x1)
964 +               if (val & 0x1)
965                         cs++;
966                 val = val >> 1;
967         }
968 @@ -115,15 +170,15 @@ void ibm4xx_denali_fixup_memsize(void)
969                 fatal("DDR wrong CS configuration\n");
970  
971         /* get data path bytes */
972 -       val = mfdcr_sdram0(DDR0_14);
973 +       val = SDRAM0_READ(DDR0_14);
974  
975         if (DDR_GET_VAL(val, DDR_REDUC, DDR_REDUC_SHIFT))
976                 dpath = 8; /* 64 bits */
977         else
978                 dpath = 4; /* 32 bits */
979  
980 -       /* get adress pins (rows) */
981 -       val = mfdcr_sdram0(DDR0_42);
982 +       /* get address pins (rows) */
983 +       val = SDRAM0_READ(DDR0_42);
984  
985         row = DDR_GET_VAL(val, DDR_APIN, DDR_APIN_SHIFT);
986         if (row > max_row)
987 @@ -131,7 +186,7 @@ void ibm4xx_denali_fixup_memsize(void)
988         row = max_row - row;
989  
990         /* get collomn size and banks */
991 -       val = mfdcr_sdram0(DDR0_43);
992 +       val = SDRAM0_READ(DDR0_43);
993  
994         col = DDR_GET_VAL(val, DDR_COL_SZ, DDR_COL_SZ_SHIFT);
995         if (col > max_col)
996 @@ -179,13 +234,17 @@ void ibm40x_dbcr_reset(void)
997  #define EMAC_RESET 0x20000000
998  void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1)
999  {
1000 -       /* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't do this for us */
1001 +       /* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't
1002 +        * do this for us
1003 +        */
1004         if (emac0)
1005                 *emac0 = EMAC_RESET;
1006         if (emac1)
1007                 *emac1 = EMAC_RESET;
1008  
1009         mtdcr(DCRN_MAL0_CFG, MAL_RESET);
1010 +       while (mfdcr(DCRN_MAL0_CFG) & MAL_RESET)
1011 +               ; /* loop until reset takes effect */
1012  }
1013  
1014  /* Read 4xx EBC bus bridge registers to get mappings of the peripheral
1015 @@ -217,84 +276,335 @@ void ibm4xx_fixup_ebc_ranges(const char 
1016         setprop(devp, "ranges", ranges, (p - ranges) * sizeof(u32));
1017  }
1018  
1019 -#define SPRN_CCR1 0x378
1020 -void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
1021 +/* Calculate 440GP clocks */
1022 +void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk)
1023  {
1024 -       u32 cpu, plb, opb, ebc, tb, uart0, m, vco;
1025 -       u32 reg;
1026 -       u32 fwdva, fwdvb, fbdv, lfbdv, opbdv0, perdv0, spcid0, prbdv0, tmp;
1027 -
1028 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PLLD0);
1029 -       reg = mfdcr(DCRN_CPR0_DATA);
1030 -       tmp = (reg & 0x000F0000) >> 16;
1031 -       fwdva = tmp ? tmp : 16;
1032 -       tmp = (reg & 0x00000700) >> 8;
1033 -       fwdvb = tmp ? tmp : 8;
1034 -       tmp = (reg & 0x1F000000) >> 24;
1035 -       fbdv = tmp ? tmp : 32;
1036 -       lfbdv = (reg & 0x0000007F);
1037 -
1038 -       mtdcr(DCRN_CPR0_ADDR, CPR0_OPBD0);
1039 -       reg = mfdcr(DCRN_CPR0_DATA);
1040 -       tmp = (reg & 0x03000000) >> 24;
1041 -       opbdv0 = tmp ? tmp : 4;
1042 -
1043 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PERD0);
1044 -       reg = mfdcr(DCRN_CPR0_DATA);
1045 -       tmp = (reg & 0x07000000) >> 24;
1046 -       perdv0 = tmp ? tmp : 8;
1047 -
1048 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PRIMBD0);
1049 -       reg = mfdcr(DCRN_CPR0_DATA);
1050 -       tmp = (reg & 0x07000000) >> 24;
1051 -       prbdv0 = tmp ? tmp : 8;
1052 -
1053 -       mtdcr(DCRN_CPR0_ADDR, CPR0_SCPID);
1054 -       reg = mfdcr(DCRN_CPR0_DATA);
1055 -       tmp = (reg & 0x03000000) >> 24;
1056 -       spcid0 = tmp ? tmp : 4;
1057 -
1058 -       /* Calculate M */
1059 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PLLC0);
1060 -       reg = mfdcr(DCRN_CPR0_DATA);
1061 -       tmp = (reg & 0x03000000) >> 24;
1062 -       if (tmp == 0) { /* PLL output */
1063 -               tmp = (reg & 0x20000000) >> 29;
1064 -               if (!tmp) /* PLLOUTA */
1065 -                       m = fbdv * lfbdv * fwdva;
1066 +       u32 sys0 = mfdcr(DCRN_CPC0_SYS0);
1067 +       u32 cr0 = mfdcr(DCRN_CPC0_CR0);
1068 +       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
1069 +       u32 opdv = CPC0_SYS0_OPDV(sys0);
1070 +       u32 epdv = CPC0_SYS0_EPDV(sys0);
1071 +
1072 +       if (sys0 & CPC0_SYS0_BYPASS) {
1073 +               /* Bypass system PLL */
1074 +               cpu = plb = sys_clk;
1075 +       } else {
1076 +               if (sys0 & CPC0_SYS0_EXTSL)
1077 +                       /* PerClk */
1078 +                       m = CPC0_SYS0_FWDVB(sys0) * opdv * epdv;
1079                 else
1080 -                       m = fbdv * lfbdv * fwdvb;
1081 +                       /* CPU clock */
1082 +                       m = CPC0_SYS0_FBDV(sys0) * CPC0_SYS0_FWDVA(sys0);
1083 +               cpu = sys_clk * m / CPC0_SYS0_FWDVA(sys0);
1084 +               plb = sys_clk * m / CPC0_SYS0_FWDVB(sys0);
1085         }
1086 -       else if (tmp == 1) /* CPU output */
1087 -               m = fbdv * fwdva;
1088 +
1089 +       opb = plb / opdv;
1090 +       ebc = opb / epdv;
1091 +
1092 +       /* FIXME: Check if this is for all 440GP, or just Ebony */
1093 +       if ((mfpvr() & 0xf0000fff) == 0x40000440)
1094 +               /* Rev. B 440GP, use external system clock */
1095 +               tb = sys_clk;
1096         else
1097 -               m = perdv0 * opbdv0 * fwdvb;
1098 +               /* Rev. C 440GP, errata force us to use internal clock */
1099 +               tb = cpu;
1100  
1101 -       vco = (m * sysclk) + (m >> 1);
1102 -       cpu = vco / fwdva;
1103 -       plb = vco / fwdvb / prbdv0;
1104 -       opb = plb / opbdv0;
1105 -       ebc = plb / perdv0;
1106 +       if (cr0 & CPC0_CR0_U0EC)
1107 +               /* External UART clock */
1108 +               uart0 = ser_clk;
1109 +       else
1110 +               /* Internal UART clock */
1111 +               uart0 = plb / CPC0_CR0_UDIV(cr0);
1112  
1113 -       /* FIXME */
1114 -       uart0 = ser_clk;
1115 +       if (cr0 & CPC0_CR0_U1EC)
1116 +               /* External UART clock */
1117 +               uart1 = ser_clk;
1118 +       else
1119 +               /* Internal UART clock */
1120 +               uart1 = plb / CPC0_CR0_UDIV(cr0);
1121 +
1122 +       printf("PPC440GP: SysClk = %dMHz (%x)\n\r",
1123 +              (sys_clk + 500000) / 1000000, sys_clk);
1124 +
1125 +       dt_fixup_cpu_clocks(cpu, tb, 0);
1126 +
1127 +       dt_fixup_clock("/plb", plb);
1128 +       dt_fixup_clock("/plb/opb", opb);
1129 +       dt_fixup_clock("/plb/opb/ebc", ebc);
1130 +       dt_fixup_clock("/plb/opb/serial@40000200", uart0);
1131 +       dt_fixup_clock("/plb/opb/serial@40000300", uart1);
1132 +}
1133 +
1134 +#define SPRN_CCR1 0x378
1135 +
1136 +static inline u32 __fix_zero(u32 v, u32 def)
1137 +{
1138 +       return v ? v : def;
1139 +}
1140 +
1141 +static unsigned int __ibm440eplike_fixup_clocks(unsigned int sys_clk,
1142 +                                               unsigned int tmr_clk,
1143 +                                               int per_clk_from_opb)
1144 +{
1145 +       /* PLL config */
1146 +       u32 pllc  = CPR0_READ(DCRN_CPR0_PLLC);
1147 +       u32 plld  = CPR0_READ(DCRN_CPR0_PLLD);
1148 +
1149 +       /* Dividers */
1150 +       u32 fbdv   = __fix_zero((plld >> 24) & 0x1f, 32);
1151 +       u32 fwdva  = __fix_zero((plld >> 16) & 0xf, 16);
1152 +       u32 fwdvb  = __fix_zero((plld >> 8) & 7, 8);
1153 +       u32 lfbdv  = __fix_zero(plld & 0x3f, 64);
1154 +       u32 pradv0 = __fix_zero((CPR0_READ(DCRN_CPR0_PRIMAD) >> 24) & 7, 8);
1155 +       u32 prbdv0 = __fix_zero((CPR0_READ(DCRN_CPR0_PRIMBD) >> 24) & 7, 8);
1156 +       u32 opbdv0 = __fix_zero((CPR0_READ(DCRN_CPR0_OPBD) >> 24) & 3, 4);
1157 +       u32 perdv0 = __fix_zero((CPR0_READ(DCRN_CPR0_PERD) >> 24) & 3, 4);
1158 +
1159 +       /* Input clocks for primary dividers */
1160 +       u32 clk_a, clk_b;
1161 +
1162 +       /* Resulting clocks */
1163 +       u32 cpu, plb, opb, ebc, vco;
1164 +
1165 +       /* Timebase */
1166 +       u32 ccr1, tb = tmr_clk;
1167 +
1168 +       if (pllc & 0x40000000) {
1169 +               u32 m;
1170 +
1171 +               /* Feedback path */
1172 +               switch ((pllc >> 24) & 7) {
1173 +               case 0:
1174 +                       /* PLLOUTx */
1175 +                       m = ((pllc & 0x20000000) ? fwdvb : fwdva) * lfbdv;
1176 +                       break;
1177 +               case 1:
1178 +                       /* CPU */
1179 +                       m = fwdva * pradv0;
1180 +                       break;
1181 +               case 5:
1182 +                       /* PERClk */
1183 +                       m = fwdvb * prbdv0 * opbdv0 * perdv0;
1184 +                       break;
1185 +               default:
1186 +                       printf("WARNING ! Invalid PLL feedback source !\n");
1187 +                       goto bypass;
1188 +               }
1189 +               m *= fbdv;
1190 +               vco = sys_clk * m;
1191 +               clk_a = vco / fwdva;
1192 +               clk_b = vco / fwdvb;
1193 +       } else {
1194 +bypass:
1195 +               /* Bypass system PLL */
1196 +               vco = 0;
1197 +               clk_a = clk_b = sys_clk;
1198 +       }
1199 +
1200 +       cpu = clk_a / pradv0;
1201 +       plb = clk_b / prbdv0;
1202 +       opb = plb / opbdv0;
1203 +       ebc = (per_clk_from_opb ? opb : plb) / perdv0;
1204  
1205         /* Figure out timebase.  Either CPU or default TmrClk */
1206 -       asm volatile (
1207 -                       "mfspr  %0,%1\n"
1208 -                       :
1209 -                       "=&r"(reg) : "i"(SPRN_CCR1));
1210 -       if (reg & 0x0080)
1211 -               tb = 25000000; /* TmrClk is 25MHz */
1212 -       else
1213 +       ccr1 = mfspr(SPRN_CCR1);
1214 +
1215 +       /* If passed a 0 tmr_clk, force CPU clock */
1216 +       if (tb == 0) {
1217 +               ccr1 &= ~0x80u;
1218 +               mtspr(SPRN_CCR1, ccr1);
1219 +       }
1220 +       if ((ccr1 & 0x0080) == 0)
1221                 tb = cpu;
1222  
1223         dt_fixup_cpu_clocks(cpu, tb, 0);
1224         dt_fixup_clock("/plb", plb);
1225         dt_fixup_clock("/plb/opb", opb);
1226         dt_fixup_clock("/plb/opb/ebc", ebc);
1227 +
1228 +       return plb;
1229 +}
1230 +
1231 +static void eplike_fixup_uart_clk(int index, const char *path,
1232 +                                 unsigned int ser_clk,
1233 +                                 unsigned int plb_clk)
1234 +{
1235 +       unsigned int sdr;
1236 +       unsigned int clock;
1237 +
1238 +       switch (index) {
1239 +       case 0:
1240 +               sdr = SDR0_READ(DCRN_SDR0_UART0);
1241 +               break;
1242 +       case 1:
1243 +               sdr = SDR0_READ(DCRN_SDR0_UART1);
1244 +               break;
1245 +       case 2:
1246 +               sdr = SDR0_READ(DCRN_SDR0_UART2);
1247 +               break;
1248 +       case 3:
1249 +               sdr = SDR0_READ(DCRN_SDR0_UART3);
1250 +               break;
1251 +       default:
1252 +               return;
1253 +       }
1254 +
1255 +       if (sdr & 0x00800000u)
1256 +               clock = ser_clk;
1257 +       else
1258 +               clock = plb_clk / __fix_zero(sdr & 0xff, 256);
1259 +
1260 +       dt_fixup_clock(path, clock);
1261 +}
1262 +
1263 +void ibm440ep_fixup_clocks(unsigned int sys_clk,
1264 +                          unsigned int ser_clk,
1265 +                          unsigned int tmr_clk)
1266 +{
1267 +       unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 0);
1268 +
1269 +       /* serial clocks beed fixup based on int/ext */
1270 +       eplike_fixup_uart_clk(0, "/plb/opb/serial@ef600300", ser_clk, plb_clk);
1271 +       eplike_fixup_uart_clk(1, "/plb/opb/serial@ef600400", ser_clk, plb_clk);
1272 +       eplike_fixup_uart_clk(2, "/plb/opb/serial@ef600500", ser_clk, plb_clk);
1273 +       eplike_fixup_uart_clk(3, "/plb/opb/serial@ef600600", ser_clk, plb_clk);
1274 +}
1275 +
1276 +void ibm440gx_fixup_clocks(unsigned int sys_clk,
1277 +                          unsigned int ser_clk,
1278 +                          unsigned int tmr_clk)
1279 +{
1280 +       unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 1);
1281 +
1282 +       /* serial clocks beed fixup based on int/ext */
1283 +       eplike_fixup_uart_clk(0, "/plb/opb/serial@40000200", ser_clk, plb_clk);
1284 +       eplike_fixup_uart_clk(1, "/plb/opb/serial@40000300", ser_clk, plb_clk);
1285 +}
1286 +
1287 +void ibm440spe_fixup_clocks(unsigned int sys_clk,
1288 +                           unsigned int ser_clk,
1289 +                           unsigned int tmr_clk)
1290 +{
1291 +       unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 1);
1292 +
1293 +       /* serial clocks beed fixup based on int/ext */
1294 +       eplike_fixup_uart_clk(0, "/plb/opb/serial@10000200", ser_clk, plb_clk);
1295 +       eplike_fixup_uart_clk(1, "/plb/opb/serial@10000300", ser_clk, plb_clk);
1296 +       eplike_fixup_uart_clk(2, "/plb/opb/serial@10000600", ser_clk, plb_clk);
1297 +}
1298 +
1299 +void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk)
1300 +{
1301 +       u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
1302 +       u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
1303 +       u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
1304 +       u32 psr = mfdcr(DCRN_405_CPC0_PSR);
1305 +       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
1306 +       u32 fwdv, fwdvb, fbdv, cbdv, opdv, epdv, ppdv, udiv;
1307 +
1308 +       fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
1309 +       fbdv = (pllmr & 0x1e000000) >> 25;
1310 +       if (fbdv == 0)
1311 +               fbdv = 16;
1312 +       cbdv = ((pllmr & 0x00060000) >> 17) + 1; /* CPU:PLB */
1313 +       opdv = ((pllmr & 0x00018000) >> 15) + 1; /* PLB:OPB */
1314 +       ppdv = ((pllmr & 0x00001800) >> 13) + 1; /* PLB:PCI */
1315 +       epdv = ((pllmr & 0x00001800) >> 11) + 2; /* PLB:EBC */
1316 +       udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
1317 +
1318 +       /* check for 405GPr */
1319 +       if ((mfpvr() & 0xfffffff0) == (0x50910951 & 0xfffffff0)) {
1320 +               fwdvb = 8 - (pllmr & 0x00000007);
1321 +               if (!(psr & 0x00001000)) /* PCI async mode enable == 0 */
1322 +                       if (psr & 0x00000020) /* New mode enable */
1323 +                               m = fwdvb * 2 * ppdv;
1324 +                       else
1325 +                               m = fwdvb * cbdv * ppdv;
1326 +               else if (psr & 0x00000020) /* New mode enable */
1327 +                       if (psr & 0x00000800) /* PerClk synch mode */
1328 +                               m = fwdvb * 2 * epdv;
1329 +                       else
1330 +                               m = fbdv * fwdv;
1331 +               else if (epdv == fbdv)
1332 +                       m = fbdv * cbdv * epdv;
1333 +               else
1334 +                       m = fbdv * fwdvb * cbdv;
1335 +
1336 +               cpu = sys_clk * m / fwdv;
1337 +               plb = sys_clk * m / (fwdvb * cbdv);
1338 +       } else {
1339 +               m = fwdv * fbdv * cbdv;
1340 +               cpu = sys_clk * m / fwdv;
1341 +               plb = cpu / cbdv;
1342 +       }
1343 +       opb = plb / opdv;
1344 +       ebc = plb / epdv;
1345 +
1346 +       if (cpc0_cr0 & 0x80)
1347 +               /* uart0 uses the external clock */
1348 +               uart0 = ser_clk;
1349 +       else
1350 +               uart0 = cpu / udiv;
1351 +
1352 +       if (cpc0_cr0 & 0x40)
1353 +               /* uart1 uses the external clock */
1354 +               uart1 = ser_clk;
1355 +       else
1356 +               uart1 = cpu / udiv;
1357 +
1358 +       /* setup the timebase clock to tick at the cpu frequency */
1359 +       cpc0_cr1 = cpc0_cr1 & ~0x00800000;
1360 +       mtdcr(DCRN_405_CPC0_CR1, cpc0_cr1);
1361 +       tb = cpu;
1362 +
1363 +       dt_fixup_cpu_clocks(cpu, tb, 0);
1364 +       dt_fixup_clock("/plb", plb);
1365 +       dt_fixup_clock("/plb/opb", opb);
1366 +       dt_fixup_clock("/plb/ebc", ebc);
1367 +       dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
1368 +       dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
1369 +}
1370 +
1371 +
1372 +void ibm405ep_fixup_clocks(unsigned int sys_clk)
1373 +{
1374 +       u32 pllmr0 = mfdcr(DCRN_CPC0_PLLMR0);
1375 +       u32 pllmr1 = mfdcr(DCRN_CPC0_PLLMR1);
1376 +       u32 cpc0_ucr = mfdcr(DCRN_CPC0_UCR);
1377 +       u32 cpu, plb, opb, ebc, uart0, uart1;
1378 +       u32 fwdva, fwdvb, fbdv, cbdv, opdv, epdv;
1379 +       u32 pllmr0_ccdv, tb, m;
1380 +
1381 +       fwdva = 8 - ((pllmr1 & 0x00070000) >> 16);
1382 +       fwdvb = 8 - ((pllmr1 & 0x00007000) >> 12);
1383 +       fbdv = (pllmr1 & 0x00f00000) >> 20;
1384 +       if (fbdv == 0)
1385 +               fbdv = 16;
1386 +
1387 +       cbdv = ((pllmr0 & 0x00030000) >> 16) + 1; /* CPU:PLB */
1388 +       epdv = ((pllmr0 & 0x00000300) >> 8) + 2;  /* PLB:EBC */
1389 +       opdv = ((pllmr0 & 0x00003000) >> 12) + 1; /* PLB:OPB */
1390 +
1391 +       m = fbdv * fwdvb;
1392 +
1393 +       pllmr0_ccdv = ((pllmr0 & 0x00300000) >> 20) + 1;
1394 +       if (pllmr1 & 0x80000000)
1395 +               cpu = sys_clk * m / (fwdva * pllmr0_ccdv);
1396 +       else
1397 +               cpu = sys_clk / pllmr0_ccdv;
1398 +
1399 +       plb = cpu / cbdv;
1400 +       opb = plb / opdv;
1401 +       ebc = plb / epdv;
1402 +       tb = cpu;
1403 +       uart0 = cpu / (cpc0_ucr & 0x0000007f);
1404 +       uart1 = cpu / ((cpc0_ucr & 0x00007f00) >> 8);
1405 +
1406 +       dt_fixup_cpu_clocks(cpu, tb, 0);
1407 +       dt_fixup_clock("/plb", plb);
1408 +       dt_fixup_clock("/plb/opb", opb);
1409 +       dt_fixup_clock("/plb/ebc", ebc);
1410         dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
1411 -       dt_fixup_clock("/plb/opb/serial@ef600400", uart0);
1412 -       dt_fixup_clock("/plb/opb/serial@ef600500", uart0);
1413 -       dt_fixup_clock("/plb/opb/serial@ef600600", uart0);
1414 +       dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
1415  }
1416 Index: linux-2.6.24.7/arch/powerpc/boot/4xx.h
1417 ===================================================================
1418 --- linux-2.6.24.7.orig/arch/powerpc/boot/4xx.h
1419 +++ linux-2.6.24.7/arch/powerpc/boot/4xx.h
1420 @@ -11,12 +11,22 @@
1421  #ifndef _POWERPC_BOOT_4XX_H_
1422  #define _POWERPC_BOOT_4XX_H_
1423  
1424 -void ibm4xx_fixup_memsize(void);
1425 +void ibm4xx_sdram_fixup_memsize(void);
1426 +void ibm440spe_fixup_memsize(void);
1427  void ibm4xx_denali_fixup_memsize(void);
1428  void ibm44x_dbcr_reset(void);
1429  void ibm40x_dbcr_reset(void);
1430  void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1);
1431  void ibm4xx_fixup_ebc_ranges(const char *ebc);
1432 -void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk);
1433 +
1434 +void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
1435 +void ibm405ep_fixup_clocks(unsigned int sys_clk);
1436 +void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
1437 +void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
1438 +                          unsigned int tmr_clk);
1439 +void ibm440gx_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
1440 +                          unsigned int tmr_clk);
1441 +void ibm440spe_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
1442 +                           unsigned int tmr_clk);
1443  
1444  #endif /* _POWERPC_BOOT_4XX_H_ */
1445 Index: linux-2.6.24.7/arch/powerpc/boot/Makefile
1446 ===================================================================
1447 --- linux-2.6.24.7.orig/arch/powerpc/boot/Makefile
1448 +++ linux-2.6.24.7/arch/powerpc/boot/Makefile
1449 @@ -33,12 +33,15 @@ ifeq ($(call cc-option-yn, -fstack-prote
1450  BOOTCFLAGS     += -fno-stack-protector
1451  endif
1452  
1453 -BOOTCFLAGS     += -I$(obj) -I$(srctree)/$(obj)
1454 +BOOTCFLAGS     += -I$(obj) -I$(srctree)/$(obj) -I$(srctree)/$(src)/libfdt
1455  
1456  $(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
1457  $(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
1458 +$(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=440
1459 +$(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=440
1460  $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
1461  
1462 +
1463  zlib       := inffast.c inflate.c inftrees.c
1464  zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
1465  zliblinuxheader := zlib.h zconf.h zutil.h
1466 @@ -46,17 +49,21 @@ zliblinuxheader := zlib.h zconf.h zutil.
1467  $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \
1468         $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
1469  
1470 -src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
1471 +src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
1472 +src-wlib := string.S crt0.S stdio.c main.c \
1473 +               $(addprefix libfdt/,$(src-libfdt)) libfdt-wrapper.c \
1474                 ns16550.c serial.c simple_alloc.c div64.S util.S \
1475                 gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
1476                 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
1477                 cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \
1478                 fsl-soc.c mpc8xx.c pq2.c
1479 -src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
1480 +src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \
1481                 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
1482                 ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
1483                 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \
1484 -               fixed-head.S ep88xc.c cuboot-hpc2.c
1485 +               fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c cuboot-taishan.c \
1486 +               cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
1487 +               cuboot-warp.c
1488  src-boot := $(src-wlib) $(src-plat) empty.c
1489  
1490  src-boot := $(addprefix $(obj)/, $(src-boot))
1491 @@ -101,24 +108,61 @@ quiet_cmd_bootar = BOOTAR  $@
1492        cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
1493  
1494  $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE
1495 +       $(Q)mkdir -p $(dir $@)
1496         $(call if_changed_dep,bootcc)
1497  $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
1498 +       $(Q)mkdir -p $(dir $@)
1499         $(call if_changed_dep,bootas)
1500  
1501  $(obj)/wrapper.a: $(obj-wlib) FORCE
1502         $(call if_changed,bootar)
1503  
1504 -hostprogs-y    := addnote addRamDisk hack-coff mktree
1505 +hostprogs-y    := addnote addRamDisk hack-coff mktree dtc
1506  
1507  targets                += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
1508  extra-y                := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
1509                    $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
1510  
1511  wrapper                :=$(srctree)/$(src)/wrapper
1512 -wrapperbits    := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
1513 +wrapperbits    := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \
1514                         $(wrapper) FORCE
1515  
1516  #############
1517 +# Bits for building dtc
1518 +# DTC_GENPARSER      := 1    # Uncomment to rebuild flex/bison output
1519 +
1520 +dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o checks.o
1521 +dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
1522 +dtc-objs := $(addprefix dtc-src/, $(dtc-objs))
1523 +
1524 +# prerequisites on generated files needs to be explicit
1525 +$(obj)/dtc-src/dtc-parser.tab.o: $(obj)/dtc-src/dtc-parser.tab.c $(obj)/dtc-src/dtc-parser.tab.h
1526 +$(obj)/dtc-src/dtc-lexer.lex.o:  $(obj)/dtc-src/dtc-lexer.lex.c $(obj)/dtc-src/dtc-parser.tab.h
1527 +
1528 +HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/
1529 +
1530 +targets += dtc-src/dtc-parser.tab.c
1531 +targets += dtc-src/dtc-lexer.lex.c
1532 +
1533 +ifdef DTC_GENPARSER
1534 +BISON = bison
1535 +FLEX = flex
1536 +
1537 +quiet_cmd_bison = BISON   $@
1538 +      cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
1539 +quiet_cmd_flex = FLEX    $@
1540 +      cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
1541 +
1542 +$(obj)/dtc-src/dtc-parser.tab.c: $(src)/dtc-src/dtc-parser.y FORCE
1543 +     $(call if_changed,bison)
1544 +
1545 +$(obj)/dtc-src/dtc-parser.tab.h: $(obj)/dtc-src/dtc-parser.tab.c
1546 +
1547 +$(obj)/dtc-src/dtc-lexer.lex.c: $(src)/dtc-src/dtc-lexer.l FORCE
1548 +     $(call if_changed,flex)
1549 +endif
1550 +
1551 +#############
1552  # Bits for building various flavours of zImage
1553  
1554  ifneq ($(CROSS32_COMPILE),)
1555 @@ -150,15 +194,26 @@ image-$(CONFIG_DEFAULT_UIMAGE)            += uImag
1556  ifneq ($(CONFIG_DEVICE_TREE),"")
1557  image-$(CONFIG_PPC_8xx)                        += cuImage.8xx
1558  image-$(CONFIG_PPC_EP88XC)             += zImage.ep88xc
1559 +image-$(CONFIG_EP405)                  += zImage.ep405
1560  image-$(CONFIG_8260)                   += cuImage.pq2
1561 +image-$(CONFIG_EP8248E)                        += zImage.ep8248e
1562  image-$(CONFIG_PPC_MPC52xx)            += cuImage.52xx
1563 +image-$(CONFIG_STORCENTER)             += cuImage.824x
1564  image-$(CONFIG_PPC_83xx)               += cuImage.83xx
1565  image-$(CONFIG_PPC_85xx)               += cuImage.85xx
1566  image-$(CONFIG_MPC7448HPC2)            += cuImage.hpc2
1567  image-$(CONFIG_EBONY)                  += treeImage.ebony cuImage.ebony
1568  image-$(CONFIG_BAMBOO)                 += treeImage.bamboo cuImage.bamboo
1569  image-$(CONFIG_SEQUOIA)                        += cuImage.sequoia
1570 +image-$(CONFIG_RAINIER)                        += cuImage.rainier
1571  image-$(CONFIG_WALNUT)                 += treeImage.walnut
1572 +image-$(CONFIG_TAISHAN)                        += cuImage.taishan
1573 +image-$(CONFIG_KATMAI)                 += cuImage.katmai
1574 +image-$(CONFIG_WARP)                   += cuImage.warp
1575 +endif
1576 +
1577 +ifneq ($(CONFIG_REDBOOT),"")
1578 +image-$(CONFIG_PPC_8xx)                        += zImage.redboot-8xx
1579  endif
1580  
1581  # For 32-bit powermacs, build the COFF and miboot images
1582 @@ -243,3 +298,51 @@ clean-kernel := vmlinux.strip vmlinux.bi
1583  clean-kernel += $(addsuffix .gz,$(clean-kernel))
1584  # If not absolute clean-files are relative to $(obj).
1585  clean-files += $(addprefix $(objtree)/, $(clean-kernel))
1586 +
1587 +WRAPPER_OBJDIR := /usr/lib/kernel-wrapper
1588 +WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts
1589 +WRAPPER_BINDIR := /usr/sbin
1590 +INSTALL := install
1591 +
1592 +extra-installed                := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
1593 +hostprogs-installed    := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y))
1594 +wrapper-installed      := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
1595 +dts-installed          := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts))
1596 +
1597 +all-installed          := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed)
1598 +
1599 +quiet_cmd_mkdir           = MKDIR   $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
1600 +      cmd_mkdir           = mkdir -p $@
1601 +
1602 +quiet_cmd_install        = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@)
1603 +      cmd_install        = $(INSTALL)  -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@
1604 +
1605 +quiet_cmd_install_dts    = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@)
1606 +      cmd_install_dts    = $(INSTALL)  -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@
1607 +
1608 +quiet_cmd_install_exe    = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
1609 +      cmd_install_exe    = $(INSTALL)  -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@
1610 +
1611 +quiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
1612 +      cmd_install_wrapper = $(INSTALL)  -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\
1613 +                               sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \
1614 +                                         -e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \
1615 +
1616 +
1617 +$(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPER_DTSDIR) $(DESTDIR)$(WRAPPER_BINDIR):
1618 +       $(call cmd,mkdir)
1619 +
1620 +$(extra-installed)     : $(DESTDIR)$(WRAPPER_OBJDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_OBJDIR)
1621 +       $(call cmd,install)
1622 +
1623 +$(hostprogs-installed)  : $(DESTDIR)$(WRAPPER_BINDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_BINDIR)
1624 +       $(call cmd,install_exe)
1625 +
1626 +$(dts-installed)       : $(DESTDIR)$(WRAPPER_DTSDIR)/% : $(srctree)/$(obj)/dts/% | $(DESTDIR)$(WRAPPER_DTSDIR)
1627 +       $(call cmd,install_dts)
1628 +
1629 +$(wrapper-installed): $(DESTDIR)$(WRAPPER_BINDIR) $(srctree)/$(obj)/wrapper | $(DESTDIR)$(WRAPPER_BINDIR)
1630 +       $(call cmd,install_wrapper)
1631 +
1632 +$(obj)/bootwrapper_install: $(all-installed)
1633 +
1634 Index: linux-2.6.24.7/arch/powerpc/boot/bamboo.c
1635 ===================================================================
1636 --- linux-2.6.24.7.orig/arch/powerpc/boot/bamboo.c
1637 +++ linux-2.6.24.7/arch/powerpc/boot/bamboo.c
1638 @@ -30,8 +30,8 @@ static void bamboo_fixups(void)
1639  {
1640         unsigned long sysclk = 33333333;
1641  
1642 -       ibm440ep_fixup_clocks(sysclk, 11059200);
1643 -       ibm4xx_fixup_memsize();
1644 +       ibm440ep_fixup_clocks(sysclk, 11059200, 25000000);
1645 +       ibm4xx_sdram_fixup_memsize();
1646         ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
1647         dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
1648  }
1649 @@ -42,6 +42,6 @@ void bamboo_init(void *mac0, void *mac1)
1650         platform_ops.exit = ibm44x_dbcr_reset;
1651         bamboo_mac0 = mac0;
1652         bamboo_mac1 = mac1;
1653 -       ft_init(_dtb_start, 0, 32);
1654 +       fdt_init(_dtb_start);
1655         serial_console_init();
1656  }
1657 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-52xx.c
1658 ===================================================================
1659 --- linux-2.6.24.7.orig/arch/powerpc/boot/cuboot-52xx.c
1660 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-52xx.c
1661 @@ -53,7 +53,7 @@ void platform_init(unsigned long r3, uns
1662                     unsigned long r6, unsigned long r7)
1663  {
1664         CUBOOT_INIT();
1665 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1666 +       fdt_init(_dtb_start);
1667         serial_console_init();
1668         platform_ops.fixups = platform_fixups;
1669  }
1670 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-824x.c
1671 ===================================================================
1672 --- /dev/null
1673 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-824x.c
1674 @@ -0,0 +1,53 @@
1675 +/*
1676 + * Old U-boot compatibility for 824x
1677 + *
1678 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
1679 + *
1680 + * This program is free software; you can redistribute it and/or modify it
1681 + * under the terms of the GNU General Public License version 2 as published
1682 + * by the Free Software Foundation.
1683 + */
1684 +
1685 +#include "ops.h"
1686 +#include "stdio.h"
1687 +#include "cuboot.h"
1688 +
1689 +#define TARGET_824x
1690 +#include "ppcboot.h"
1691 +
1692 +static bd_t bd;
1693 +
1694 +
1695 +static void platform_fixups(void)
1696 +{
1697 +       void *soc;
1698 +
1699 +       dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
1700 +       dt_fixup_mac_addresses(bd.bi_enetaddr);
1701 +       dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
1702 +
1703 +       soc = find_node_by_devtype(NULL, "soc");
1704 +       if (soc) {
1705 +               void *serial = NULL;
1706 +
1707 +               setprop(soc, "bus-frequency", &bd.bi_busfreq,
1708 +                       sizeof(bd.bi_busfreq));
1709 +
1710 +               while ((serial = find_node_by_devtype(serial, "serial"))) {
1711 +                       if (get_parent(serial) != soc)
1712 +                               continue;
1713 +
1714 +                       setprop(serial, "clock-frequency", &bd.bi_busfreq,
1715 +                               sizeof(bd.bi_busfreq));
1716 +               }
1717 +       }
1718 +}
1719 +
1720 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1721 +                   unsigned long r6, unsigned long r7)
1722 +{
1723 +       CUBOOT_INIT();
1724 +       fdt_init(_dtb_start);
1725 +       serial_console_init();
1726 +       platform_ops.fixups = platform_fixups;
1727 +}
1728 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-83xx.c
1729 ===================================================================
1730 --- linux-2.6.24.7.orig/arch/powerpc/boot/cuboot-83xx.c
1731 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-83xx.c
1732 @@ -24,7 +24,8 @@ static void platform_fixups(void)
1733         void *soc;
1734  
1735         dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
1736 -       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
1737 +       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
1738 +       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
1739         dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
1740  
1741         /* Unfortunately, the specific model number is encoded in the
1742 @@ -52,7 +53,7 @@ void platform_init(unsigned long r3, uns
1743                     unsigned long r6, unsigned long r7)
1744  {
1745         CUBOOT_INIT();
1746 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1747 +       fdt_init(_dtb_start);
1748         serial_console_init();
1749         platform_ops.fixups = platform_fixups;
1750  }
1751 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-85xx.c
1752 ===================================================================
1753 --- linux-2.6.24.7.orig/arch/powerpc/boot/cuboot-85xx.c
1754 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-85xx.c
1755 @@ -24,8 +24,9 @@ static void platform_fixups(void)
1756         void *soc;
1757  
1758         dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
1759 -       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr,
1760 -                              bd.bi_enet2addr);
1761 +       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
1762 +       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
1763 +       dt_fixup_mac_address_by_alias("ethernet2", bd.bi_enet2addr);
1764         dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 8, bd.bi_busfreq);
1765  
1766         /* Unfortunately, the specific model number is encoded in the
1767 @@ -53,7 +54,7 @@ void platform_init(unsigned long r3, uns
1768                     unsigned long r6, unsigned long r7)
1769  {
1770         CUBOOT_INIT();
1771 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1772 +       fdt_init(_dtb_start);
1773         serial_console_init();
1774         platform_ops.fixups = platform_fixups;
1775  }
1776 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-8xx.c
1777 ===================================================================
1778 --- linux-2.6.24.7.orig/arch/powerpc/boot/cuboot-8xx.c
1779 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-8xx.c
1780 @@ -41,7 +41,7 @@ void platform_init(unsigned long r3, uns
1781                     unsigned long r6, unsigned long r7)
1782  {
1783         CUBOOT_INIT();
1784 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1785 +       fdt_init(_dtb_start);
1786         serial_console_init();
1787         platform_ops.fixups = platform_fixups;
1788  }
1789 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-hpc2.c
1790 ===================================================================
1791 --- linux-2.6.24.7.orig/arch/powerpc/boot/cuboot-hpc2.c
1792 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-hpc2.c
1793 @@ -42,7 +42,7 @@ void platform_init(unsigned long r3, uns
1794                 unsigned long r6, unsigned long r7)
1795  {
1796         CUBOOT_INIT();
1797 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1798 +       fdt_init(_dtb_start);
1799         serial_console_init();
1800         platform_ops.fixups = platform_fixups;
1801  }
1802 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-katmai.c
1803 ===================================================================
1804 --- /dev/null
1805 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-katmai.c
1806 @@ -0,0 +1,56 @@
1807 +/*
1808 + * Old U-boot compatibility for Katmai
1809 + *
1810 + * Author: Hugh Blemings <hugh@au.ibm.com>
1811 + *
1812 + * Copyright 2007 Hugh Blemings, IBM Corporation.
1813 + *   Based on cuboot-ebony.c which is:
1814 + * Copyright 2007 David Gibson, IBM Corporation.
1815 + *   Based on cuboot-83xx.c, which is:
1816 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
1817 + *
1818 + * This program is free software; you can redistribute it and/or modify it
1819 + * under the terms of the GNU General Public License version 2 as published
1820 + * by the Free Software Foundation.
1821 + */
1822 +
1823 +#include "ops.h"
1824 +#include "stdio.h"
1825 +#include "reg.h"
1826 +#include "dcr.h"
1827 +#include "4xx.h"
1828 +#include "44x.h"
1829 +#include "cuboot.h"
1830 +
1831 +#define TARGET_44x
1832 +#include "ppcboot.h"
1833 +
1834 +static bd_t bd;
1835 +
1836 +BSS_STACK(4096);
1837 +
1838 +static void katmai_fixups(void)
1839 +{
1840 +       unsigned long sysclk = 33333000;
1841 +
1842 +       /* 440SP Clock logic is all but identical to 440GX
1843 +        * so we just use that code for now at least
1844 +        */
1845 +       ibm440spe_fixup_clocks(sysclk, 6 * 1843200, 0);
1846 +
1847 +       ibm440spe_fixup_memsize();
1848 +
1849 +       dt_fixup_mac_address(0, bd.bi_enetaddr);
1850 +
1851 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1852 +}
1853 +
1854 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1855 +                  unsigned long r6, unsigned long r7)
1856 +{
1857 +       CUBOOT_INIT();
1858 +
1859 +       platform_ops.fixups = katmai_fixups;
1860 +       fdt_init(_dtb_start);
1861 +       serial_console_init();
1862 +}
1863 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-pq2.c
1864 ===================================================================
1865 --- linux-2.6.24.7.orig/arch/powerpc/boot/cuboot-pq2.c
1866 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-pq2.c
1867 @@ -255,7 +255,7 @@ void platform_init(unsigned long r3, uns
1868                     unsigned long r6, unsigned long r7)
1869  {
1870         CUBOOT_INIT();
1871 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1872 +       fdt_init(_dtb_start);
1873         serial_console_init();
1874         platform_ops.fixups = pq2_platform_fixups;
1875  }
1876 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-rainier.c
1877 ===================================================================
1878 --- /dev/null
1879 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-rainier.c
1880 @@ -0,0 +1,56 @@
1881 +/*
1882 + * Old U-boot compatibility for Rainier
1883 + *
1884 + * Valentine Barshak <vbarshak@ru.mvista.com>
1885 + * Copyright 2007 MontaVista Software, Inc
1886 + *
1887 + * Based on Ebony code by David Gibson <david@gibson.dropbear.id.au>
1888 + * Copyright IBM Corporation, 2007
1889 + *
1890 + * Based on Bamboo code by Josh Boyer <jwboyer@linux.vnet.ibm.com>
1891 + * Copyright IBM Corporation, 2007
1892 + *
1893 + * This program is free software; you can redistribute it and/or
1894 + * modify it under the terms of the GNU General Public License
1895 + * as published by the Free Software Foundation; version 2 of the License
1896 + */
1897 +
1898 +#include <stdarg.h>
1899 +#include <stddef.h>
1900 +#include "types.h"
1901 +#include "elf.h"
1902 +#include "string.h"
1903 +#include "stdio.h"
1904 +#include "page.h"
1905 +#include "ops.h"
1906 +#include "dcr.h"
1907 +#include "4xx.h"
1908 +#include "44x.h"
1909 +#include "cuboot.h"
1910 +
1911 +#define TARGET_4xx
1912 +#define TARGET_44x
1913 +#include "ppcboot.h"
1914 +
1915 +static bd_t bd;
1916 +
1917 +
1918 +static void rainier_fixups(void)
1919 +{
1920 +       unsigned long sysclk = 33333333;
1921 +
1922 +       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
1923 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1924 +       ibm4xx_denali_fixup_memsize();
1925 +       dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
1926 +}
1927 +
1928 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1929 +                   unsigned long r6, unsigned long r7)
1930 +{
1931 +       CUBOOT_INIT();
1932 +       platform_ops.fixups = rainier_fixups;
1933 +       platform_ops.exit = ibm44x_dbcr_reset;
1934 +       fdt_init(_dtb_start);
1935 +       serial_console_init();
1936 +}
1937 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-sequoia.c
1938 ===================================================================
1939 --- linux-2.6.24.7.orig/arch/powerpc/boot/cuboot-sequoia.c
1940 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-sequoia.c
1941 @@ -39,7 +39,7 @@ static void sequoia_fixups(void)
1942  {
1943         unsigned long sysclk = 33333333;
1944  
1945 -       ibm440ep_fixup_clocks(sysclk, 11059200);
1946 +       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
1947         ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1948         ibm4xx_denali_fixup_memsize();
1949         dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
1950 @@ -51,6 +51,6 @@ void platform_init(unsigned long r3, uns
1951         CUBOOT_INIT();
1952         platform_ops.fixups = sequoia_fixups;
1953         platform_ops.exit = ibm44x_dbcr_reset;
1954 -       ft_init(_dtb_start, 0, 32);
1955 +       fdt_init(_dtb_start);
1956         serial_console_init();
1957  }
1958 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-taishan.c
1959 ===================================================================
1960 --- /dev/null
1961 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-taishan.c
1962 @@ -0,0 +1,54 @@
1963 +/*
1964 + * Old U-boot compatibility for Taishan
1965 + *
1966 + * Author: Hugh Blemings <hugh@au.ibm.com>
1967 + *
1968 + * Copyright 2007 Hugh Blemings, IBM Corporation.
1969 + *   Based on cuboot-ebony.c which is:
1970 + * Copyright 2007 David Gibson, IBM Corporation.
1971 + *   Based on cuboot-83xx.c, which is:
1972 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
1973 + *
1974 + * This program is free software; you can redistribute it and/or modify it
1975 + * under the terms of the GNU General Public License version 2 as published
1976 + * by the Free Software Foundation.
1977 + */
1978 +
1979 +#include "ops.h"
1980 +#include "stdio.h"
1981 +#include "cuboot.h"
1982 +#include "reg.h"
1983 +#include "dcr.h"
1984 +#include "4xx.h"
1985 +
1986 +#define TARGET_44x
1987 +#include "ppcboot.h"
1988 +
1989 +static bd_t bd;
1990 +
1991 +BSS_STACK(4096);
1992 +
1993 +static void taishan_fixups(void)
1994 +{
1995 +       /* FIXME: sysclk should be derived by reading the FPGA
1996 +          registers */
1997 +       unsigned long sysclk = 33000000;
1998 +
1999 +       ibm440gx_fixup_clocks(sysclk, 6 * 1843200, 25000000);
2000 +
2001 +       ibm4xx_sdram_fixup_memsize();
2002 +
2003 +       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
2004 +
2005 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
2006 +}
2007 +
2008 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
2009 +                  unsigned long r6, unsigned long r7)
2010 +{
2011 +       CUBOOT_INIT();
2012 +
2013 +       platform_ops.fixups = taishan_fixups;
2014 +       fdt_init(_dtb_start);
2015 +       serial_console_init();
2016 +}
2017 Index: linux-2.6.24.7/arch/powerpc/boot/cuboot-warp.c
2018 ===================================================================
2019 --- /dev/null
2020 +++ linux-2.6.24.7/arch/powerpc/boot/cuboot-warp.c
2021 @@ -0,0 +1,39 @@
2022 +/*
2023 + * Copyright (c) 2008 PIKA Technologies
2024 + *   Sean MacLennan <smaclennan@pikatech.com>
2025 + *
2026 + * This program is free software; you can redistribute it and/or modify it
2027 + * under the terms of the GNU General Public License version 2 as published
2028 + * by the Free Software Foundation.
2029 + */
2030 +
2031 +#include "ops.h"
2032 +#include "4xx.h"
2033 +#include "cuboot.h"
2034 +
2035 +#define TARGET_44x
2036 +#include "ppcboot.h"
2037 +
2038 +static bd_t bd;
2039 +
2040 +static void warp_fixups(void)
2041 +{
2042 +       unsigned long sysclk = 66000000;
2043 +
2044 +       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
2045 +       ibm4xx_sdram_fixup_memsize();
2046 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
2047 +       dt_fixup_mac_addresses(&bd.bi_enetaddr);
2048 +}
2049 +
2050 +
2051 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
2052 +                  unsigned long r6, unsigned long r7)
2053 +{
2054 +       CUBOOT_INIT();
2055 +
2056 +       platform_ops.fixups = warp_fixups;
2057 +       platform_ops.exit = ibm44x_dbcr_reset;
2058 +       fdt_init(_dtb_start);
2059 +       serial_console_init();
2060 +}
2061 Index: linux-2.6.24.7/arch/powerpc/boot/dcr.h
2062 ===================================================================
2063 --- linux-2.6.24.7.orig/arch/powerpc/boot/dcr.h
2064 +++ linux-2.6.24.7/arch/powerpc/boot/dcr.h
2065 @@ -14,12 +14,20 @@
2066  #define DCRN_SDRAM0_CFGADDR                            0x010
2067  #define DCRN_SDRAM0_CFGDATA                            0x011
2068  
2069 +#define SDRAM0_READ(offset) ({\
2070 +       mtdcr(DCRN_SDRAM0_CFGADDR, offset); \
2071 +       mfdcr(DCRN_SDRAM0_CFGDATA); })
2072 +#define SDRAM0_WRITE(offset, data) ({\
2073 +       mtdcr(DCRN_SDRAM0_CFGADDR, offset); \
2074 +       mtdcr(DCRN_SDRAM0_CFGDATA, data); })
2075 +
2076  #define        SDRAM0_B0CR                             0x40
2077  #define        SDRAM0_B1CR                             0x44
2078  #define        SDRAM0_B2CR                             0x48
2079  #define        SDRAM0_B3CR                             0x4c
2080  
2081 -static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR, SDRAM0_B2CR, SDRAM0_B3CR };
2082 +static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR,
2083 +                                           SDRAM0_B2CR, SDRAM0_B3CR };
2084  
2085  #define                        SDRAM_CONFIG_BANK_ENABLE        0x00000001
2086  #define                        SDRAM_CONFIG_SIZE_MASK          0x000e0000
2087 @@ -138,5 +146,54 @@ static const unsigned long sdram_bxcr[] 
2088  #define DCRN_CPC0_PLLMR 0xb0
2089  #define DCRN_405_CPC0_CR0 0xb1
2090  #define DCRN_405_CPC0_CR1 0xb2
2091 +#define DCRN_405_CPC0_PSR 0xb4
2092 +
2093 +/* 405EP Clocking/Power Management/Chip Control regs */
2094 +#define DCRN_CPC0_PLLMR0  0xf0
2095 +#define DCRN_CPC0_PLLMR1  0xf4
2096 +#define DCRN_CPC0_UCR     0xf5
2097 +
2098 +/* 440GX Clock control etc */
2099 +
2100 +
2101 +#define DCRN_CPR0_CLKUPD                               0x020
2102 +#define DCRN_CPR0_PLLC                                 0x040
2103 +#define DCRN_CPR0_PLLD                                 0x060
2104 +#define DCRN_CPR0_PRIMAD                               0x080
2105 +#define DCRN_CPR0_PRIMBD                               0x0a0
2106 +#define DCRN_CPR0_OPBD                                 0x0c0
2107 +#define DCRN_CPR0_PERD                                 0x0e0
2108 +#define DCRN_CPR0_MALD                                 0x100
2109 +
2110 +#define DCRN_SDR0_CONFIG_ADDR  0xe
2111 +#define DCRN_SDR0_CONFIG_DATA  0xf
2112 +
2113 +/* SDR read/write helper macros */
2114 +#define SDR0_READ(offset) ({\
2115 +       mtdcr(DCRN_SDR0_CONFIG_ADDR, offset); \
2116 +       mfdcr(DCRN_SDR0_CONFIG_DATA); })
2117 +#define SDR0_WRITE(offset, data) ({\
2118 +       mtdcr(DCRN_SDR0_CONFIG_ADDR, offset); \
2119 +       mtdcr(DCRN_SDR0_CONFIG_DATA, data); })
2120 +
2121 +#define DCRN_SDR0_UART0                0x0120
2122 +#define DCRN_SDR0_UART1                0x0121
2123 +#define DCRN_SDR0_UART2                0x0122
2124 +#define DCRN_SDR0_UART3                0x0123
2125 +
2126 +
2127 +/* CPRs read/write helper macros - based off include/asm-ppc/ibm44x.h */
2128 +
2129 +#define DCRN_CPR0_CFGADDR                              0xc
2130 +#define DCRN_CPR0_CFGDATA                              0xd
2131 +
2132 +#define CPR0_READ(offset) ({\
2133 +       mtdcr(DCRN_CPR0_CFGADDR, offset); \
2134 +       mfdcr(DCRN_CPR0_CFGDATA); })
2135 +#define CPR0_WRITE(offset, data) ({\
2136 +       mtdcr(DCRN_CPR0_CFGADDR, offset); \
2137 +       mtdcr(DCRN_CPR0_CFGDATA, data); })
2138 +
2139 +
2140  
2141  #endif /* _PPC_BOOT_DCR_H_ */
2142 Index: linux-2.6.24.7/arch/powerpc/boot/devtree.c
2143 ===================================================================
2144 --- linux-2.6.24.7.orig/arch/powerpc/boot/devtree.c
2145 +++ linux-2.6.24.7/arch/powerpc/boot/devtree.c
2146 @@ -88,6 +88,20 @@ void dt_fixup_clock(const char *path, u3
2147         }
2148  }
2149  
2150 +void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr)
2151 +{
2152 +       void *devp = find_node_by_alias(alias);
2153 +
2154 +       if (devp) {
2155 +               printf("%s: local-mac-address <-"
2156 +                      " %02x:%02x:%02x:%02x:%02x:%02x\n\r", alias,
2157 +                      addr[0], addr[1], addr[2],
2158 +                      addr[3], addr[4], addr[5]);
2159 +
2160 +               setprop(devp, "local-mac-address", addr, 6);
2161 +       }
2162 +}
2163 +
2164  void dt_fixup_mac_address(u32 index, const u8 *addr)
2165  {
2166         void *devp = find_node_by_prop_value(NULL, "linux,network-index",
2167 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/Makefile.dtc
2168 ===================================================================
2169 --- /dev/null
2170 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/Makefile.dtc
2171 @@ -0,0 +1,25 @@
2172 +# Makefile.dtc
2173 +#
2174 +# This is not a complete Makefile of itself.  Instead, it is designed to
2175 +# be easily embeddable into other systems of Makefiles.
2176 +#
2177 +DTC_SRCS = dtc.c flattree.c fstree.c data.c livetree.c treesource.c srcpos.c \
2178 +       checks.c
2179 +DTC_EXTRA = dtc.h srcpos.h
2180 +DTC_LEXFILES = dtc-lexer.l
2181 +DTC_BISONFILES = dtc-parser.y
2182 +
2183 +DTC_LEX_SRCS = $(DTC_LEXFILES:%.l=%.lex.c)
2184 +DTC_BISON_SRCS = $(DTC_BISONFILES:%.y=%.tab.c)
2185 +DTC_BISON_INCLUDES = $(DTC_BISONFILES:%.y=%.tab.h)
2186 +
2187 +DTC_GEN_SRCS = $(DTC_LEX_SRCS) $(DTC_BISON_SRCS)
2188 +DTC_GEN_ALL = $(DTC_GEN_SRCS) $(DTC_BISON_INCLUDES)
2189 +DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
2190 +
2191 +DTC_CLEANFILES = $(DTC_GEN_ALL)
2192 +
2193 +# We assume the containing Makefile system can do auto-dependencies for most
2194 +# things, but we supply the dependencies on generated header files explicitly
2195 +
2196 +$(addprefix $(DTC_objdir)/,$(DTC_GEN_SRCS:%.c=%.o)): $(addprefix $(DTC_objdir)/,$(DTC_BISON_INCLUDES))
2197 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/checks.c
2198 ===================================================================
2199 --- /dev/null
2200 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/checks.c
2201 @@ -0,0 +1,750 @@
2202 +/*
2203 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2007.
2204 + *
2205 + *
2206 + * This program is free software; you can redistribute it and/or
2207 + * modify it under the terms of the GNU General Public License as
2208 + * published by the Free Software Foundation; either version 2 of the
2209 + * License, or (at your option) any later version.
2210 + *
2211 + *  This program is distributed in the hope that it will be useful,
2212 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
2213 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2214 + *  General Public License for more details.
2215 + *
2216 + *  You should have received a copy of the GNU General Public License
2217 + *  along with this program; if not, write to the Free Software
2218 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
2219 + *                                                                   USA
2220 + */
2221 +
2222 +#include "dtc.h"
2223 +
2224 +#ifdef TRACE_CHECKS
2225 +#define TRACE(c, ...) \
2226 +       do { \
2227 +               fprintf(stderr, "=== %s: ", (c)->name); \
2228 +               fprintf(stderr, __VA_ARGS__); \
2229 +               fprintf(stderr, "\n"); \
2230 +       } while (0)
2231 +#else
2232 +#define TRACE(c, fmt, ...)     do { } while (0)
2233 +#endif
2234 +
2235 +enum checklevel {
2236 +       IGNORE = 0,
2237 +       WARN = 1,
2238 +       ERROR = 2,
2239 +};
2240 +
2241 +enum checkstatus {
2242 +       UNCHECKED = 0,
2243 +       PREREQ,
2244 +       PASSED,
2245 +       FAILED,
2246 +};
2247 +
2248 +struct check;
2249 +
2250 +typedef void (*tree_check_fn)(struct check *c, struct node *dt);
2251 +typedef void (*node_check_fn)(struct check *c, struct node *dt, struct node *node);
2252 +typedef void (*prop_check_fn)(struct check *c, struct node *dt,
2253 +                             struct node *node, struct property *prop);
2254 +
2255 +struct check {
2256 +       const char *name;
2257 +       tree_check_fn tree_fn;
2258 +       node_check_fn node_fn;
2259 +       prop_check_fn prop_fn;
2260 +       void *data;
2261 +       enum checklevel level;
2262 +       enum checkstatus status;
2263 +       int inprogress;
2264 +       int num_prereqs;
2265 +       struct check **prereq;
2266 +};
2267 +
2268 +#define CHECK(nm, tfn, nfn, pfn, d, lvl, ...) \
2269 +       static struct check *nm##_prereqs[] = { __VA_ARGS__ }; \
2270 +       static struct check nm = { \
2271 +               .name = #nm, \
2272 +               .tree_fn = (tfn), \
2273 +               .node_fn = (nfn), \
2274 +               .prop_fn = (pfn), \
2275 +               .data = (d), \
2276 +               .level = (lvl), \
2277 +               .status = UNCHECKED, \
2278 +               .num_prereqs = ARRAY_SIZE(nm##_prereqs), \
2279 +               .prereq = nm##_prereqs, \
2280 +       };
2281 +
2282 +#define TREE_CHECK(nm, d, lvl, ...) \
2283 +       CHECK(nm, check_##nm, NULL, NULL, d, lvl, __VA_ARGS__)
2284 +#define NODE_CHECK(nm, d, lvl, ...) \
2285 +       CHECK(nm, NULL, check_##nm, NULL, d, lvl, __VA_ARGS__)
2286 +#define PROP_CHECK(nm, d, lvl, ...) \
2287 +       CHECK(nm, NULL, NULL, check_##nm, d, lvl, __VA_ARGS__)
2288 +#define BATCH_CHECK(nm, lvl, ...) \
2289 +       CHECK(nm, NULL, NULL, NULL, NULL, lvl, __VA_ARGS__)
2290 +
2291 +#ifdef __GNUC__
2292 +static inline void check_msg(struct check *c, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
2293 +#endif
2294 +static inline void check_msg(struct check *c, const char *fmt, ...)
2295 +{
2296 +       va_list ap;
2297 +       va_start(ap, fmt);
2298 +
2299 +       if ((c->level < WARN) || (c->level <= quiet))
2300 +               return; /* Suppress message */
2301 +
2302 +       fprintf(stderr, "%s (%s): ",
2303 +               (c->level == ERROR) ? "ERROR" : "Warning", c->name);
2304 +       vfprintf(stderr, fmt, ap);
2305 +       fprintf(stderr, "\n");
2306 +}
2307 +
2308 +#define FAIL(c, ...) \
2309 +       do { \
2310 +               TRACE((c), "\t\tFAILED at %s:%d", __FILE__, __LINE__); \
2311 +               (c)->status = FAILED; \
2312 +               check_msg((c), __VA_ARGS__); \
2313 +       } while (0)
2314 +
2315 +static void check_nodes_props(struct check *c, struct node *dt, struct node *node)
2316 +{
2317 +       struct node *child;
2318 +       struct property *prop;
2319 +
2320 +       TRACE(c, "%s", node->fullpath);
2321 +       if (c->node_fn)
2322 +               c->node_fn(c, dt, node);
2323 +
2324 +       if (c->prop_fn)
2325 +               for_each_property(node, prop) {
2326 +                       TRACE(c, "%s\t'%s'", node->fullpath, prop->name);
2327 +                       c->prop_fn(c, dt, node, prop);
2328 +               }
2329 +
2330 +       for_each_child(node, child)
2331 +               check_nodes_props(c, dt, child);
2332 +}
2333 +
2334 +static int run_check(struct check *c, struct node *dt)
2335 +{
2336 +       int error = 0;
2337 +       int i;
2338 +
2339 +       assert(!c->inprogress);
2340 +
2341 +       if (c->status != UNCHECKED)
2342 +               goto out;
2343 +
2344 +       c->inprogress = 1;
2345 +
2346 +       for (i = 0; i < c->num_prereqs; i++) {
2347 +               struct check *prq = c->prereq[i];
2348 +               error |= run_check(prq, dt);
2349 +               if (prq->status != PASSED) {
2350 +                       c->status = PREREQ;
2351 +                       check_msg(c, "Failed prerequisite '%s'",
2352 +                                 c->prereq[i]->name);
2353 +               }
2354 +       }
2355 +
2356 +       if (c->status != UNCHECKED)
2357 +               goto out;
2358 +
2359 +       if (c->node_fn || c->prop_fn)
2360 +               check_nodes_props(c, dt, dt);
2361 +
2362 +       if (c->tree_fn)
2363 +               c->tree_fn(c, dt);
2364 +       if (c->status == UNCHECKED)
2365 +               c->status = PASSED;
2366 +
2367 +       TRACE(c, "\tCompleted, status %d", c->status);
2368 +
2369 +out:
2370 +       c->inprogress = 0;
2371 +       if ((c->status != PASSED) && (c->level == ERROR))
2372 +               error = 1;
2373 +       return error;
2374 +}
2375 +
2376 +/*
2377 + * Utility check functions
2378 + */
2379 +
2380 +static void check_is_string(struct check *c, struct node *root,
2381 +                           struct node *node)
2382 +{
2383 +       struct property *prop;
2384 +       char *propname = c->data;
2385 +
2386 +       prop = get_property(node, propname);
2387 +       if (!prop)
2388 +               return; /* Not present, assumed ok */
2389 +
2390 +       if (!data_is_one_string(prop->val))
2391 +               FAIL(c, "\"%s\" property in %s is not a string",
2392 +                    propname, node->fullpath);
2393 +}
2394 +#define CHECK_IS_STRING(nm, propname, lvl) \
2395 +       CHECK(nm, NULL, check_is_string, NULL, (propname), (lvl))
2396 +
2397 +static void check_is_cell(struct check *c, struct node *root,
2398 +                         struct node *node)
2399 +{
2400 +       struct property *prop;
2401 +       char *propname = c->data;
2402 +
2403 +       prop = get_property(node, propname);
2404 +       if (!prop)
2405 +               return; /* Not present, assumed ok */
2406 +
2407 +       if (prop->val.len != sizeof(cell_t))
2408 +               FAIL(c, "\"%s\" property in %s is not a single cell",
2409 +                    propname, node->fullpath);
2410 +}
2411 +#define CHECK_IS_CELL(nm, propname, lvl) \
2412 +       CHECK(nm, NULL, check_is_cell, NULL, (propname), (lvl))
2413 +
2414 +/*
2415 + * Structural check functions
2416 + */
2417 +
2418 +static void check_duplicate_node_names(struct check *c, struct node *dt,
2419 +                                      struct node *node)
2420 +{
2421 +       struct node *child, *child2;
2422 +
2423 +       for_each_child(node, child)
2424 +               for (child2 = child->next_sibling;
2425 +                    child2;
2426 +                    child2 = child2->next_sibling)
2427 +                       if (streq(child->name, child2->name))
2428 +                               FAIL(c, "Duplicate node name %s",
2429 +                                    child->fullpath);
2430 +}
2431 +NODE_CHECK(duplicate_node_names, NULL, ERROR);
2432 +
2433 +static void check_duplicate_property_names(struct check *c, struct node *dt,
2434 +                                          struct node *node)
2435 +{
2436 +       struct property *prop, *prop2;
2437 +
2438 +       for_each_property(node, prop)
2439 +               for (prop2 = prop->next; prop2; prop2 = prop2->next)
2440 +                       if (streq(prop->name, prop2->name))
2441 +                               FAIL(c, "Duplicate property name %s in %s",
2442 +                                    prop->name, node->fullpath);
2443 +}
2444 +NODE_CHECK(duplicate_property_names, NULL, ERROR);
2445 +
2446 +static void check_explicit_phandles(struct check *c, struct node *root,
2447 +                                         struct node *node)
2448 +{
2449 +       struct property *prop;
2450 +       struct node *other;
2451 +       cell_t phandle;
2452 +
2453 +       prop = get_property(node, "linux,phandle");
2454 +       if (! prop)
2455 +               return; /* No phandle, that's fine */
2456 +
2457 +       if (prop->val.len != sizeof(cell_t)) {
2458 +               FAIL(c, "%s has bad length (%d) linux,phandle property",
2459 +                    node->fullpath, prop->val.len);
2460 +               return;
2461 +       }
2462 +
2463 +       phandle = propval_cell(prop);
2464 +       if ((phandle == 0) || (phandle == -1)) {
2465 +               FAIL(c, "%s has invalid linux,phandle value 0x%x",
2466 +                    node->fullpath, phandle);
2467 +               return;
2468 +       }
2469 +
2470 +       other = get_node_by_phandle(root, phandle);
2471 +       if (other) {
2472 +               FAIL(c, "%s has duplicated phandle 0x%x (seen before at %s)",
2473 +                    node->fullpath, phandle, other->fullpath);
2474 +               return;
2475 +       }
2476 +
2477 +       node->phandle = phandle;
2478 +}
2479 +NODE_CHECK(explicit_phandles, NULL, ERROR);
2480 +
2481 +static void check_name_properties(struct check *c, struct node *root,
2482 +                                 struct node *node)
2483 +{
2484 +       struct property *prop;
2485 +
2486 +       prop = get_property(node, "name");
2487 +       if (!prop)
2488 +               return; /* No name property, that's fine */
2489 +
2490 +       if ((prop->val.len != node->basenamelen+1)
2491 +           || (memcmp(prop->val.val, node->name, node->basenamelen) != 0))
2492 +               FAIL(c, "\"name\" property in %s is incorrect (\"%s\" instead"
2493 +                    " of base node name)", node->fullpath, prop->val.val);
2494 +}
2495 +CHECK_IS_STRING(name_is_string, "name", ERROR);
2496 +NODE_CHECK(name_properties, NULL, ERROR, &name_is_string);
2497 +
2498 +/*
2499 + * Reference fixup functions
2500 + */
2501 +
2502 +static void fixup_phandle_references(struct check *c, struct node *dt,
2503 +                                    struct node *node, struct property *prop)
2504 +{
2505 +      struct marker *m = prop->val.markers;
2506 +      struct node *refnode;
2507 +      cell_t phandle;
2508 +
2509 +      for_each_marker_of_type(m, REF_PHANDLE) {
2510 +             assert(m->offset + sizeof(cell_t) <= prop->val.len);
2511 +
2512 +             refnode = get_node_by_ref(dt, m->ref);
2513 +             if (! refnode) {
2514 +                     FAIL(c, "Reference to non-existent node or label \"%s\"\n",
2515 +                          m->ref);
2516 +                     continue;
2517 +             }
2518 +
2519 +             phandle = get_node_phandle(dt, refnode);
2520 +             *((cell_t *)(prop->val.val + m->offset)) = cpu_to_be32(phandle);
2521 +      }
2522 +}
2523 +CHECK(phandle_references, NULL, NULL, fixup_phandle_references, NULL, ERROR,
2524 +      &duplicate_node_names, &explicit_phandles);
2525 +
2526 +static void fixup_path_references(struct check *c, struct node *dt,
2527 +                                 struct node *node, struct property *prop)
2528 +{
2529 +       struct marker *m = prop->val.markers;
2530 +       struct node *refnode;
2531 +       char *path;
2532 +
2533 +       for_each_marker_of_type(m, REF_PATH) {
2534 +               assert(m->offset <= prop->val.len);
2535 +
2536 +               refnode = get_node_by_ref(dt, m->ref);
2537 +               if (!refnode) {
2538 +                       FAIL(c, "Reference to non-existent node or label \"%s\"\n",
2539 +                            m->ref);
2540 +                       continue;
2541 +               }
2542 +
2543 +               path = refnode->fullpath;
2544 +               prop->val = data_insert_at_marker(prop->val, m, path,
2545 +                                                 strlen(path) + 1);
2546 +       }
2547 +}
2548 +CHECK(path_references, NULL, NULL, fixup_path_references, NULL, ERROR,
2549 +      &duplicate_node_names);
2550 +
2551 +/*
2552 + * Semantic checks
2553 + */
2554 +CHECK_IS_CELL(address_cells_is_cell, "#address-cells", WARN);
2555 +CHECK_IS_CELL(size_cells_is_cell, "#size-cells", WARN);
2556 +CHECK_IS_CELL(interrupt_cells_is_cell, "#interrupt-cells", WARN);
2557 +
2558 +CHECK_IS_STRING(device_type_is_string, "device_type", WARN);
2559 +CHECK_IS_STRING(model_is_string, "model", WARN);
2560 +CHECK_IS_STRING(status_is_string, "status", WARN);
2561 +
2562 +static void fixup_addr_size_cells(struct check *c, struct node *dt,
2563 +                                 struct node *node)
2564 +{
2565 +       struct property *prop;
2566 +
2567 +       node->addr_cells = -1;
2568 +       node->size_cells = -1;
2569 +
2570 +       prop = get_property(node, "#address-cells");
2571 +       if (prop)
2572 +               node->addr_cells = propval_cell(prop);
2573 +
2574 +       prop = get_property(node, "#size-cells");
2575 +       if (prop)
2576 +               node->size_cells = propval_cell(prop);
2577 +}
2578 +CHECK(addr_size_cells, NULL, fixup_addr_size_cells, NULL, NULL, WARN,
2579 +      &address_cells_is_cell, &size_cells_is_cell);
2580 +
2581 +#define node_addr_cells(n) \
2582 +       (((n)->addr_cells == -1) ? 2 : (n)->addr_cells)
2583 +#define node_size_cells(n) \
2584 +       (((n)->size_cells == -1) ? 1 : (n)->size_cells)
2585 +
2586 +static void check_reg_format(struct check *c, struct node *dt,
2587 +                            struct node *node)
2588 +{
2589 +       struct property *prop;
2590 +       int addr_cells, size_cells, entrylen;
2591 +
2592 +       prop = get_property(node, "reg");
2593 +       if (!prop)
2594 +               return; /* No "reg", that's fine */
2595 +
2596 +       if (!node->parent) {
2597 +               FAIL(c, "Root node has a \"reg\" property");
2598 +               return;
2599 +       }
2600 +
2601 +       if (prop->val.len == 0)
2602 +               FAIL(c, "\"reg\" property in %s is empty", node->fullpath);
2603 +
2604 +       addr_cells = node_addr_cells(node->parent);
2605 +       size_cells = node_size_cells(node->parent);
2606 +       entrylen = (addr_cells + size_cells) * sizeof(cell_t);
2607 +
2608 +       if ((prop->val.len % entrylen) != 0)
2609 +               FAIL(c, "\"reg\" property in %s has invalid length (%d bytes) "
2610 +                    "(#address-cells == %d, #size-cells == %d)",
2611 +                    node->fullpath, prop->val.len, addr_cells, size_cells);
2612 +}
2613 +NODE_CHECK(reg_format, NULL, WARN, &addr_size_cells);
2614 +
2615 +static void check_ranges_format(struct check *c, struct node *dt,
2616 +                               struct node *node)
2617 +{
2618 +       struct property *prop;
2619 +       int c_addr_cells, p_addr_cells, c_size_cells, p_size_cells, entrylen;
2620 +
2621 +       prop = get_property(node, "ranges");
2622 +       if (!prop)
2623 +               return;
2624 +
2625 +       if (!node->parent) {
2626 +               FAIL(c, "Root node has a \"ranges\" property");
2627 +               return;
2628 +       }
2629 +
2630 +       p_addr_cells = node_addr_cells(node->parent);
2631 +       p_size_cells = node_size_cells(node->parent);
2632 +       c_addr_cells = node_addr_cells(node);
2633 +       c_size_cells = node_size_cells(node);
2634 +       entrylen = (p_addr_cells + c_addr_cells + c_size_cells) * sizeof(cell_t);
2635 +
2636 +       if (prop->val.len == 0) {
2637 +               if (p_addr_cells != c_addr_cells)
2638 +                       FAIL(c, "%s has empty \"ranges\" property but its "
2639 +                            "#address-cells (%d) differs from %s (%d)",
2640 +                            node->fullpath, c_addr_cells, node->parent->fullpath,
2641 +                            p_addr_cells);
2642 +               if (p_size_cells != c_size_cells)
2643 +                       FAIL(c, "%s has empty \"ranges\" property but its "
2644 +                            "#size-cells (%d) differs from %s (%d)",
2645 +                            node->fullpath, c_size_cells, node->parent->fullpath,
2646 +                            p_size_cells);
2647 +       } else if ((prop->val.len % entrylen) != 0) {
2648 +               FAIL(c, "\"ranges\" property in %s has invalid length (%d bytes) "
2649 +                    "(parent #address-cells == %d, child #address-cells == %d, "
2650 +                    "#size-cells == %d)", node->fullpath, prop->val.len,
2651 +                    p_addr_cells, c_addr_cells, c_size_cells);
2652 +       }
2653 +}
2654 +NODE_CHECK(ranges_format, NULL, WARN, &addr_size_cells);
2655 +
2656 +/*
2657 + * Style checks
2658 + */
2659 +static void check_avoid_default_addr_size(struct check *c, struct node *dt,
2660 +                                         struct node *node)
2661 +{
2662 +       struct property *reg, *ranges;
2663 +
2664 +       if (!node->parent)
2665 +               return; /* Ignore root node */
2666 +
2667 +       reg = get_property(node, "reg");
2668 +       ranges = get_property(node, "ranges");
2669 +
2670 +       if (!reg && !ranges)
2671 +               return;
2672 +
2673 +       if ((node->parent->addr_cells == -1))
2674 +               FAIL(c, "Relying on default #address-cells value for %s",
2675 +                    node->fullpath);
2676 +
2677 +       if ((node->parent->size_cells == -1))
2678 +               FAIL(c, "Relying on default #size-cells value for %s",
2679 +                    node->fullpath);
2680 +}
2681 +NODE_CHECK(avoid_default_addr_size, NULL, WARN, &addr_size_cells);
2682 +
2683 +static void check_obsolete_chosen_interrupt_controller(struct check *c,
2684 +                                                      struct node *dt)
2685 +{
2686 +       struct node *chosen;
2687 +       struct property *prop;
2688 +
2689 +       chosen = get_node_by_path(dt, "/chosen");
2690 +       if (!chosen)
2691 +               return;
2692 +
2693 +       prop = get_property(chosen, "interrupt-controller");
2694 +       if (prop)
2695 +               FAIL(c, "/chosen has obsolete \"interrupt-controller\" "
2696 +                    "property");
2697 +}
2698 +TREE_CHECK(obsolete_chosen_interrupt_controller, NULL, WARN);
2699 +
2700 +static struct check *check_table[] = {
2701 +       &duplicate_node_names, &duplicate_property_names,
2702 +       &name_is_string, &name_properties,
2703 +       &explicit_phandles,
2704 +       &phandle_references, &path_references,
2705 +
2706 +       &address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell,
2707 +       &device_type_is_string, &model_is_string, &status_is_string,
2708 +
2709 +       &addr_size_cells, &reg_format, &ranges_format,
2710 +
2711 +       &avoid_default_addr_size,
2712 +       &obsolete_chosen_interrupt_controller,
2713 +};
2714 +
2715 +int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys);
2716 +
2717 +void process_checks(int force, struct boot_info *bi,
2718 +                   int checkflag, int outversion, int boot_cpuid_phys)
2719 +{
2720 +       struct node *dt = bi->dt;
2721 +       int i;
2722 +       int error = 0;
2723 +
2724 +       for (i = 0; i < ARRAY_SIZE(check_table); i++) {
2725 +               struct check *c = check_table[i];
2726 +
2727 +               if (c->level != IGNORE)
2728 +                       error = error || run_check(c, dt);
2729 +       }
2730 +
2731 +       if (error) {
2732 +               if (!force) {
2733 +                       fprintf(stderr, "ERROR: Input tree has errors, aborting "
2734 +                               "(use -f to force output)\n");
2735 +                       exit(2);
2736 +               } else if (quiet < 3) {
2737 +                       fprintf(stderr, "Warning: Input tree has errors, "
2738 +                               "output forced\n");
2739 +               }
2740 +       }
2741 +
2742 +       if (checkflag) {
2743 +               if (error) {
2744 +                       fprintf(stderr, "Warning: Skipping semantic checks due to structural errors\n");
2745 +               } else {
2746 +                       if (!check_semantics(bi->dt, outversion,
2747 +                                            boot_cpuid_phys))
2748 +                               fprintf(stderr, "Warning: Input tree has semantic errors\n");
2749 +               }
2750 +       }
2751 +}
2752 +
2753 +/*
2754 + * Semantic check functions
2755 + */
2756 +
2757 +#define ERRMSG(...) if (quiet < 2) fprintf(stderr, "ERROR: " __VA_ARGS__)
2758 +#define WARNMSG(...) if (quiet < 1) fprintf(stderr, "Warning: " __VA_ARGS__)
2759 +
2760 +#define DO_ERR(...) do {ERRMSG(__VA_ARGS__); ok = 0; } while (0)
2761 +
2762 +#define CHECK_HAVE(node, propname) \
2763 +       do { \
2764 +               if (! (prop = get_property((node), (propname)))) \
2765 +                       DO_ERR("Missing \"%s\" property in %s\n", (propname), \
2766 +                               (node)->fullpath); \
2767 +       } while (0);
2768 +
2769 +#define CHECK_HAVE_WARN(node, propname) \
2770 +       do { \
2771 +               if (! (prop  = get_property((node), (propname)))) \
2772 +                       WARNMSG("%s has no \"%s\" property\n", \
2773 +                               (node)->fullpath, (propname)); \
2774 +       } while (0)
2775 +
2776 +#define CHECK_HAVE_STRING(node, propname) \
2777 +       do { \
2778 +               CHECK_HAVE((node), (propname)); \
2779 +               if (prop && !data_is_one_string(prop->val)) \
2780 +                       DO_ERR("\"%s\" property in %s is not a string\n", \
2781 +                               (propname), (node)->fullpath); \
2782 +       } while (0)
2783 +
2784 +#define CHECK_HAVE_STREQ(node, propname, value) \
2785 +       do { \
2786 +               CHECK_HAVE_STRING((node), (propname)); \
2787 +               if (prop && !streq(prop->val.val, (value))) \
2788 +                       DO_ERR("%s has wrong %s, %s (should be %s\n", \
2789 +                               (node)->fullpath, (propname), \
2790 +                               prop->val.val, (value)); \
2791 +       } while (0)
2792 +
2793 +#define CHECK_HAVE_ONECELL(node, propname) \
2794 +       do { \
2795 +               CHECK_HAVE((node), (propname)); \
2796 +               if (prop && (prop->val.len != sizeof(cell_t))) \
2797 +                       DO_ERR("\"%s\" property in %s has wrong size %d (should be 1 cell)\n", (propname), (node)->fullpath, prop->val.len); \
2798 +       } while (0)
2799 +
2800 +#define CHECK_HAVE_WARN_ONECELL(node, propname) \
2801 +       do { \
2802 +               CHECK_HAVE_WARN((node), (propname)); \
2803 +               if (prop && (prop->val.len != sizeof(cell_t))) \
2804 +                       DO_ERR("\"%s\" property in %s has wrong size %d (should be 1 cell)\n", (propname), (node)->fullpath, prop->val.len); \
2805 +       } while (0)
2806 +
2807 +#define CHECK_HAVE_WARN_PHANDLE(xnode, propname, root) \
2808 +       do { \
2809 +               struct node *ref; \
2810 +               CHECK_HAVE_WARN_ONECELL((xnode), (propname)); \
2811 +               if (prop) {\
2812 +                       cell_t phandle = propval_cell(prop); \
2813 +                       if ((phandle == 0) || (phandle == -1)) { \
2814 +                               DO_ERR("\"%s\" property in %s contains an invalid phandle %x\n", (propname), (xnode)->fullpath, phandle); \
2815 +                       } else { \
2816 +                               ref = get_node_by_phandle((root), propval_cell(prop)); \
2817 +                               if (! ref) \
2818 +                                       DO_ERR("\"%s\" property in %s refers to non-existant phandle %x\n", (propname), (xnode)->fullpath, propval_cell(prop)); \
2819 +                       } \
2820 +               } \
2821 +       } while (0)
2822 +
2823 +#define CHECK_HAVE_WARN_STRING(node, propname) \
2824 +       do { \
2825 +               CHECK_HAVE_WARN((node), (propname)); \
2826 +               if (prop && !data_is_one_string(prop->val)) \
2827 +                       DO_ERR("\"%s\" property in %s is not a string\n", \
2828 +                               (propname), (node)->fullpath); \
2829 +       } while (0)
2830 +
2831 +static int check_root(struct node *root)
2832 +{
2833 +       struct property *prop;
2834 +       int ok = 1;
2835 +
2836 +       CHECK_HAVE_STRING(root, "model");
2837 +       CHECK_HAVE_WARN(root, "compatible");
2838 +
2839 +       return ok;
2840 +}
2841 +
2842 +static int check_cpus(struct node *root, int outversion, int boot_cpuid_phys)
2843 +{
2844 +       struct node *cpus, *cpu;
2845 +       struct property *prop;
2846 +       struct node *bootcpu = NULL;
2847 +       int ok = 1;
2848 +
2849 +       cpus = get_subnode(root, "cpus");
2850 +       if (! cpus) {
2851 +               ERRMSG("Missing /cpus node\n");
2852 +               return 0;
2853 +       }
2854 +
2855 +       if (cpus->addr_cells != 1)
2856 +               DO_ERR("%s has bad #address-cells value %d (should be 1)\n",
2857 +                      cpus->fullpath, cpus->addr_cells);
2858 +       if (cpus->size_cells != 0)
2859 +               DO_ERR("%s has bad #size-cells value %d (should be 0)\n",
2860 +                      cpus->fullpath, cpus->size_cells);
2861 +
2862 +       for_each_child(cpus, cpu) {
2863 +               CHECK_HAVE_STREQ(cpu, "device_type", "cpu");
2864 +
2865 +               CHECK_HAVE_ONECELL(cpu, "reg");
2866 +               if (prop) {
2867 +                       cell_t unitnum;
2868 +                       char *eptr;
2869 +
2870 +                       unitnum = strtol(get_unitname(cpu), &eptr, 16);
2871 +                       if (*eptr) {
2872 +                               WARNMSG("%s has bad format unit name %s (should be CPU number\n",
2873 +                                       cpu->fullpath, get_unitname(cpu));
2874 +                       } else if (unitnum != propval_cell(prop)) {
2875 +                               WARNMSG("%s unit name \"%s\" does not match \"reg\" property <%x>\n",
2876 +                                      cpu->fullpath, get_unitname(cpu),
2877 +                                      propval_cell(prop));
2878 +                       }
2879 +               }
2880 +
2881 +/*             CHECK_HAVE_ONECELL(cpu, "d-cache-line-size"); */
2882 +/*             CHECK_HAVE_ONECELL(cpu, "i-cache-line-size"); */
2883 +               CHECK_HAVE_ONECELL(cpu, "d-cache-size");
2884 +               CHECK_HAVE_ONECELL(cpu, "i-cache-size");
2885 +
2886 +               CHECK_HAVE_WARN_ONECELL(cpu, "clock-frequency");
2887 +               CHECK_HAVE_WARN_ONECELL(cpu, "timebase-frequency");
2888 +
2889 +               prop = get_property(cpu, "linux,boot-cpu");
2890 +               if (prop) {
2891 +                       if (prop->val.len)
2892 +                               WARNMSG("\"linux,boot-cpu\" property in %s is non-empty\n",
2893 +                                       cpu->fullpath);
2894 +                       if (bootcpu)
2895 +                               DO_ERR("Multiple boot cpus (%s and %s)\n",
2896 +                                      bootcpu->fullpath, cpu->fullpath);
2897 +                       else
2898 +                               bootcpu = cpu;
2899 +               }
2900 +       }
2901 +
2902 +       if (outversion < 2) {
2903 +               if (! bootcpu)
2904 +                       WARNMSG("No cpu has \"linux,boot-cpu\" property\n");
2905 +       } else {
2906 +               if (bootcpu)
2907 +                       WARNMSG("\"linux,boot-cpu\" property is deprecated in blob version 2 or higher\n");
2908 +               if (boot_cpuid_phys == 0xfeedbeef)
2909 +                       WARNMSG("physical boot CPU not set.  Use -b option to set\n");
2910 +       }
2911 +
2912 +       return ok;
2913 +}
2914 +
2915 +static int check_memory(struct node *root)
2916 +{
2917 +       struct node *mem;
2918 +       struct property *prop;
2919 +       int nnodes = 0;
2920 +       int ok = 1;
2921 +
2922 +       for_each_child(root, mem) {
2923 +               if (! strneq(mem->name, "memory", mem->basenamelen))
2924 +                       continue;
2925 +
2926 +               nnodes++;
2927 +
2928 +               CHECK_HAVE_STREQ(mem, "device_type", "memory");
2929 +               CHECK_HAVE(mem, "reg");
2930 +       }
2931 +
2932 +       if (nnodes == 0) {
2933 +               ERRMSG("No memory nodes\n");
2934 +               return 0;
2935 +       }
2936 +
2937 +       return ok;
2938 +}
2939 +
2940 +int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys)
2941 +{
2942 +       int ok = 1;
2943 +
2944 +       ok = ok && check_root(dt);
2945 +       ok = ok && check_cpus(dt, outversion, boot_cpuid_phys);
2946 +       ok = ok && check_memory(dt);
2947 +       if (! ok)
2948 +               return 0;
2949 +
2950 +       return 1;
2951 +}
2952 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/data.c
2953 ===================================================================
2954 --- /dev/null
2955 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/data.c
2956 @@ -0,0 +1,321 @@
2957 +/*
2958 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
2959 + *
2960 + *
2961 + * This program is free software; you can redistribute it and/or
2962 + * modify it under the terms of the GNU General Public License as
2963 + * published by the Free Software Foundation; either version 2 of the
2964 + * License, or (at your option) any later version.
2965 + *
2966 + *  This program is distributed in the hope that it will be useful,
2967 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
2968 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2969 + *  General Public License for more details.
2970 + *
2971 + *  You should have received a copy of the GNU General Public License
2972 + *  along with this program; if not, write to the Free Software
2973 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
2974 + *                                                                   USA
2975 + */
2976 +
2977 +#include "dtc.h"
2978 +
2979 +void data_free(struct data d)
2980 +{
2981 +       struct marker *m, *nm;
2982 +
2983 +       m = d.markers;
2984 +       while (m) {
2985 +               nm = m->next;
2986 +               free(m->ref);
2987 +               free(m);
2988 +               m = nm;
2989 +       }
2990 +
2991 +       assert(!d.val || d.asize);
2992 +
2993 +       if (d.val)
2994 +               free(d.val);
2995 +}
2996 +
2997 +struct data data_grow_for(struct data d, int xlen)
2998 +{
2999 +       struct data nd;
3000 +       int newsize;
3001 +
3002 +       /* we must start with an allocated datum */
3003 +       assert(!d.val || d.asize);
3004 +
3005 +       if (xlen == 0)
3006 +               return d;
3007 +
3008 +       nd = d;
3009 +
3010 +       newsize = xlen;
3011 +
3012 +       while ((d.len + xlen) > newsize)
3013 +               newsize *= 2;
3014 +
3015 +       nd.asize = newsize;
3016 +       nd.val = xrealloc(d.val, newsize);
3017 +
3018 +       assert(nd.asize >= (d.len + xlen));
3019 +
3020 +       return nd;
3021 +}
3022 +
3023 +struct data data_copy_mem(const char *mem, int len)
3024 +{
3025 +       struct data d;
3026 +
3027 +       d = data_grow_for(empty_data, len);
3028 +
3029 +       d.len = len;
3030 +       memcpy(d.val, mem, len);
3031 +
3032 +       return d;
3033 +}
3034 +
3035 +static char get_oct_char(const char *s, int *i)
3036 +{
3037 +       char x[4];
3038 +       char *endx;
3039 +       long val;
3040 +
3041 +       x[3] = '\0';
3042 +       x[0] = s[(*i)];
3043 +       if (x[0]) {
3044 +               x[1] = s[(*i)+1];
3045 +               if (x[1])
3046 +                       x[2] = s[(*i)+2];
3047 +       }
3048 +
3049 +       val = strtol(x, &endx, 8);
3050 +       if ((endx - x) == 0)
3051 +               fprintf(stderr, "Empty \\nnn escape\n");
3052 +
3053 +       (*i) += endx - x;
3054 +       return val;
3055 +}
3056 +
3057 +static char get_hex_char(const char *s, int *i)
3058 +{
3059 +       char x[3];
3060 +       char *endx;
3061 +       long val;
3062 +
3063 +       x[2] = '\0';
3064 +       x[0] = s[(*i)];
3065 +       if (x[0])
3066 +               x[1] = s[(*i)+1];
3067 +
3068 +       val = strtol(x, &endx, 16);
3069 +       if ((endx - x) == 0)
3070 +               fprintf(stderr, "Empty \\x escape\n");
3071 +
3072 +       (*i) += endx - x;
3073 +       return val;
3074 +}
3075 +
3076 +struct data data_copy_escape_string(const char *s, int len)
3077 +{
3078 +       int i = 0;
3079 +       struct data d;
3080 +       char *q;
3081 +
3082 +       d = data_grow_for(empty_data, strlen(s)+1);
3083 +
3084 +       q = d.val;
3085 +       while (i < len) {
3086 +               char c = s[i++];
3087 +
3088 +               if (c != '\\') {
3089 +                       q[d.len++] = c;
3090 +                       continue;
3091 +               }
3092 +
3093 +               c = s[i++];
3094 +               assert(c);
3095 +               switch (c) {
3096 +               case 'a':
3097 +                       q[d.len++] = '\a';
3098 +                       break;
3099 +               case 'b':
3100 +                       q[d.len++] = '\b';
3101 +                       break;
3102 +               case 't':
3103 +                       q[d.len++] = '\t';
3104 +                       break;
3105 +               case 'n':
3106 +                       q[d.len++] = '\n';
3107 +                       break;
3108 +               case 'v':
3109 +                       q[d.len++] = '\v';
3110 +                       break;
3111 +               case 'f':
3112 +                       q[d.len++] = '\f';
3113 +                       break;
3114 +               case 'r':
3115 +                       q[d.len++] = '\r';
3116 +                       break;
3117 +               case '0':
3118 +               case '1':
3119 +               case '2':
3120 +               case '3':
3121 +               case '4':
3122 +               case '5':
3123 +               case '6':
3124 +               case '7':
3125 +                       i--; /* need to re-read the first digit as
3126 +                             * part of the octal value */
3127 +                       q[d.len++] = get_oct_char(s, &i);
3128 +                       break;
3129 +               case 'x':
3130 +                       q[d.len++] = get_hex_char(s, &i);
3131 +                       break;
3132 +               default:
3133 +                       q[d.len++] = c;
3134 +               }
3135 +       }
3136 +
3137 +       q[d.len++] = '\0';
3138 +       return d;
3139 +}
3140 +
3141 +struct data data_copy_file(FILE *f, size_t len)
3142 +{
3143 +       struct data d;
3144 +
3145 +       d = data_grow_for(empty_data, len);
3146 +
3147 +       d.len = len;
3148 +       fread(d.val, len, 1, f);
3149 +
3150 +       return d;
3151 +}
3152 +
3153 +struct data data_append_data(struct data d, const void *p, int len)
3154 +{
3155 +       d = data_grow_for(d, len);
3156 +       memcpy(d.val + d.len, p, len);
3157 +       d.len += len;
3158 +       return d;
3159 +}
3160 +
3161 +struct data data_insert_at_marker(struct data d, struct marker *m,
3162 +                                 const void *p, int len)
3163 +{
3164 +       d = data_grow_for(d, len);
3165 +       memmove(d.val + m->offset + len, d.val + m->offset, d.len - m->offset);
3166 +       memcpy(d.val + m->offset, p, len);
3167 +       d.len += len;
3168 +
3169 +       /* Adjust all markers after the one we're inserting at */
3170 +       m = m->next;
3171 +       for_each_marker(m)
3172 +               m->offset += len;
3173 +       return d;
3174 +}
3175 +
3176 +struct data data_append_markers(struct data d, struct marker *m)
3177 +{
3178 +       struct marker **mp = &d.markers;
3179 +
3180 +       /* Find the end of the markerlist */
3181 +       while (*mp)
3182 +               mp = &((*mp)->next);
3183 +       *mp = m;
3184 +       return d;
3185 +}
3186 +
3187 +struct data data_merge(struct data d1, struct data d2)
3188 +{
3189 +       struct data d;
3190 +       struct marker *m2 = d2.markers;
3191 +
3192 +       d = data_append_markers(data_append_data(d1, d2.val, d2.len), m2);
3193 +
3194 +       /* Adjust for the length of d1 */
3195 +       for_each_marker(m2)
3196 +               m2->offset += d1.len;
3197 +
3198 +       d2.markers = NULL; /* So data_free() doesn't clobber them */
3199 +       data_free(d2);
3200 +
3201 +       return d;
3202 +}
3203 +
3204 +struct data data_append_cell(struct data d, cell_t word)
3205 +{
3206 +       cell_t beword = cpu_to_be32(word);
3207 +
3208 +       return data_append_data(d, &beword, sizeof(beword));
3209 +}
3210 +
3211 +struct data data_append_re(struct data d, const struct fdt_reserve_entry *re)
3212 +{
3213 +       struct fdt_reserve_entry bere;
3214 +
3215 +       bere.address = cpu_to_be64(re->address);
3216 +       bere.size = cpu_to_be64(re->size);
3217 +
3218 +       return data_append_data(d, &bere, sizeof(bere));
3219 +}
3220 +
3221 +struct data data_append_addr(struct data d, u64 addr)
3222 +{
3223 +       u64 beaddr = cpu_to_be64(addr);
3224 +
3225 +       return data_append_data(d, &beaddr, sizeof(beaddr));
3226 +}
3227 +
3228 +struct data data_append_byte(struct data d, uint8_t byte)
3229 +{
3230 +       return data_append_data(d, &byte, 1);
3231 +}
3232 +
3233 +struct data data_append_zeroes(struct data d, int len)
3234 +{
3235 +       d = data_grow_for(d, len);
3236 +
3237 +       memset(d.val + d.len, 0, len);
3238 +       d.len += len;
3239 +       return d;
3240 +}
3241 +
3242 +struct data data_append_align(struct data d, int align)
3243 +{
3244 +       int newlen = ALIGN(d.len, align);
3245 +       return data_append_zeroes(d, newlen - d.len);
3246 +}
3247 +
3248 +struct data data_add_marker(struct data d, enum markertype type, char *ref)
3249 +{
3250 +       struct marker *m;
3251 +
3252 +       m = xmalloc(sizeof(*m));
3253 +       m->offset = d.len;
3254 +       m->type = type;
3255 +       m->ref = ref;
3256 +       m->next = NULL;
3257 +
3258 +       return data_append_markers(d, m);
3259 +}
3260 +
3261 +int data_is_one_string(struct data d)
3262 +{
3263 +       int i;
3264 +       int len = d.len;
3265 +
3266 +       if (len == 0)
3267 +               return 0;
3268 +
3269 +       for (i = 0; i < len-1; i++)
3270 +               if (d.val[i] == '\0')
3271 +                       return 0;
3272 +
3273 +       if (d.val[len-1] != '\0')
3274 +               return 0;
3275 +
3276 +       return 1;
3277 +}
3278 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc-lexer.l
3279 ===================================================================
3280 --- /dev/null
3281 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc-lexer.l
3282 @@ -0,0 +1,328 @@
3283 +/*
3284 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
3285 + *
3286 + *
3287 + * This program is free software; you can redistribute it and/or
3288 + * modify it under the terms of the GNU General Public License as
3289 + * published by the Free Software Foundation; either version 2 of the
3290 + * License, or (at your option) any later version.
3291 + *
3292 + *  This program is distributed in the hope that it will be useful,
3293 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
3294 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3295 + *  General Public License for more details.
3296 + *
3297 + *  You should have received a copy of the GNU General Public License
3298 + *  along with this program; if not, write to the Free Software
3299 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
3300 + *                                                                   USA
3301 + */
3302 +
3303 +%option noyywrap nounput yylineno
3304 +
3305 +%x INCLUDE
3306 +%x BYTESTRING
3307 +%x PROPNODENAME
3308 +%s V1
3309 +
3310 +PROPNODECHAR   [a-zA-Z0-9,._+*#?@-]
3311 +PATHCHAR       ({PROPNODECHAR}|[/])
3312 +LABEL          [a-zA-Z_][a-zA-Z0-9_]*
3313 +
3314 +%{
3315 +#include "dtc.h"
3316 +#include "srcpos.h"
3317 +#include "dtc-parser.tab.h"
3318 +
3319 +
3320 +/*#define LEXDEBUG     1*/
3321 +
3322 +#ifdef LEXDEBUG
3323 +#define DPRINT(fmt, ...)       fprintf(stderr, fmt, ##__VA_ARGS__)
3324 +#else
3325 +#define DPRINT(fmt, ...)       do { } while (0)
3326 +#endif
3327 +
3328 +static int dts_version; /* = 0 */
3329 +
3330 +#define BEGIN_DEFAULT()        if (dts_version == 0) { \
3331 +                               DPRINT("<INITIAL>\n"); \
3332 +                               BEGIN(INITIAL); \
3333 +                       } else { \
3334 +                               DPRINT("<V1>\n"); \
3335 +                               BEGIN(V1); \
3336 +                       }
3337 +%}
3338 +
3339 +%%
3340 +<*>"/include/"         BEGIN(INCLUDE);
3341 +
3342 +<INCLUDE>\"[^"\n]*\"   {
3343 +                       yytext[strlen(yytext) - 1] = 0;
3344 +                       if (!push_input_file(yytext + 1)) {
3345 +                               /* Some unrecoverable error.*/
3346 +                               exit(1);
3347 +                       }
3348 +                       BEGIN_DEFAULT();
3349 +               }
3350 +
3351 +
3352 +<*><<EOF>>             {
3353 +                       if (!pop_input_file()) {
3354 +                               yyterminate();
3355 +                       }
3356 +               }
3357 +
3358 +<*>\"([^\\"]|\\.)*\"   {
3359 +                       yylloc.filenum = srcpos_filenum;
3360 +                       yylloc.first_line = yylineno;
3361 +                       DPRINT("String: %s\n", yytext);
3362 +                       yylval.data = data_copy_escape_string(yytext+1,
3363 +                                       yyleng-2);
3364 +                       yylloc.first_line = yylineno;
3365 +                       return DT_STRING;
3366 +               }
3367 +
3368 +<*>"/dts-v1/"  {
3369 +                       yylloc.filenum = srcpos_filenum;
3370 +                       yylloc.first_line = yylineno;
3371 +                       DPRINT("Keyword: /dts-v1/\n");
3372 +                       dts_version = 1;
3373 +                       BEGIN_DEFAULT();
3374 +                       return DT_V1;
3375 +               }
3376 +
3377 +<*>"/memreserve/"      {
3378 +                       yylloc.filenum = srcpos_filenum;
3379 +                       yylloc.first_line = yylineno;
3380 +                       DPRINT("Keyword: /memreserve/\n");
3381 +                       BEGIN_DEFAULT();
3382 +                       return DT_MEMRESERVE;
3383 +               }
3384 +
3385 +<*>{LABEL}:    {
3386 +                       yylloc.filenum = srcpos_filenum;
3387 +                       yylloc.first_line = yylineno;
3388 +                       DPRINT("Label: %s\n", yytext);
3389 +                       yylval.labelref = strdup(yytext);
3390 +                       yylval.labelref[yyleng-1] = '\0';
3391 +                       return DT_LABEL;
3392 +               }
3393 +
3394 +<INITIAL>[bodh]# {
3395 +                       yylloc.filenum = srcpos_filenum;
3396 +                       yylloc.first_line = yylineno;
3397 +                       if (*yytext == 'b')
3398 +                               yylval.cbase = 2;
3399 +                       else if (*yytext == 'o')
3400 +                               yylval.cbase = 8;
3401 +                       else if (*yytext == 'd')
3402 +                               yylval.cbase = 10;
3403 +                       else
3404 +                               yylval.cbase = 16;
3405 +                       DPRINT("Base: %d\n", yylval.cbase);
3406 +                       return DT_BASE;
3407 +               }
3408 +
3409 +<INITIAL>[0-9a-fA-F]+  {
3410 +                       yylloc.filenum = srcpos_filenum;
3411 +                       yylloc.first_line = yylineno;
3412 +                       yylval.literal = strdup(yytext);
3413 +                       DPRINT("Literal: '%s'\n", yylval.literal);
3414 +                       return DT_LEGACYLITERAL;
3415 +               }
3416 +
3417 +<V1>[0-9]+|0[xX][0-9a-fA-F]+      {
3418 +                       yylloc.filenum = srcpos_filenum;
3419 +                       yylloc.first_line = yylineno;
3420 +                       yylval.literal = strdup(yytext);
3421 +                       DPRINT("Literal: '%s'\n", yylval.literal);
3422 +                       return DT_LITERAL;
3423 +               }
3424 +
3425 +\&{LABEL}      {       /* label reference */
3426 +                       yylloc.filenum = srcpos_filenum;
3427 +                       yylloc.first_line = yylineno;
3428 +                       DPRINT("Ref: %s\n", yytext+1);
3429 +                       yylval.labelref = strdup(yytext+1);
3430 +                       return DT_REF;
3431 +               }
3432 +
3433 +"&{/"{PATHCHAR}+\}     {       /* new-style path reference */
3434 +                       yylloc.filenum = srcpos_filenum;
3435 +                       yylloc.first_line = yylineno;
3436 +                       yytext[yyleng-1] = '\0';
3437 +                       DPRINT("Ref: %s\n", yytext+2);
3438 +                       yylval.labelref = strdup(yytext+2);
3439 +                       return DT_REF;
3440 +               }
3441 +
3442 +<INITIAL>"&/"{PATHCHAR}+ {     /* old-style path reference */
3443 +                       yylloc.filenum = srcpos_filenum;
3444 +                       yylloc.first_line = yylineno;
3445 +                       DPRINT("Ref: %s\n", yytext+1);
3446 +                       yylval.labelref = strdup(yytext+1);
3447 +                       return DT_REF;
3448 +               }
3449 +
3450 +<BYTESTRING>[0-9a-fA-F]{2} {
3451 +                       yylloc.filenum = srcpos_filenum;
3452 +                       yylloc.first_line = yylineno;
3453 +                       yylval.byte = strtol(yytext, NULL, 16);
3454 +                       DPRINT("Byte: %02x\n", (int)yylval.byte);
3455 +                       return DT_BYTE;
3456 +               }
3457 +
3458 +<BYTESTRING>"]"        {
3459 +                       yylloc.filenum = srcpos_filenum;
3460 +                       yylloc.first_line = yylineno;
3461 +                       DPRINT("/BYTESTRING\n");
3462 +                       BEGIN_DEFAULT();
3463 +                       return ']';
3464 +               }
3465 +
3466 +<PROPNODENAME>{PROPNODECHAR}+ {
3467 +                       yylloc.filenum = srcpos_filenum;
3468 +                       yylloc.first_line = yylineno;
3469 +                       DPRINT("PropNodeName: %s\n", yytext);
3470 +                       yylval.propnodename = strdup(yytext);
3471 +                       BEGIN_DEFAULT();
3472 +                       return DT_PROPNODENAME;
3473 +               }
3474 +
3475 +
3476 +<*>[[:space:]]+        /* eat whitespace */
3477 +
3478 +<*>"/*"([^*]|\*+[^*/])*\*+"/"  {
3479 +                       yylloc.filenum = srcpos_filenum;
3480 +                       yylloc.first_line = yylineno;
3481 +                       DPRINT("Comment: %s\n", yytext);
3482 +                       /* eat comments */
3483 +               }
3484 +
3485 +<*>"//".*\n    /* eat line comments */
3486 +
3487 +<*>.           {
3488 +                       yylloc.filenum = srcpos_filenum;
3489 +                       yylloc.first_line = yylineno;
3490 +                       DPRINT("Char: %c (\\x%02x)\n", yytext[0],
3491 +                               (unsigned)yytext[0]);
3492 +                       if (yytext[0] == '[') {
3493 +                               DPRINT("<BYTESTRING>\n");
3494 +                               BEGIN(BYTESTRING);
3495 +                       }
3496 +                       if ((yytext[0] == '{')
3497 +                           || (yytext[0] == ';')) {
3498 +                               DPRINT("<PROPNODENAME>\n");
3499 +                               BEGIN(PROPNODENAME);
3500 +                       }
3501 +                       return yytext[0];
3502 +               }
3503 +
3504 +%%
3505 +
3506 +
3507 +/*
3508 + * Stack of nested include file contexts.
3509 + */
3510 +
3511 +struct incl_file {
3512 +       int filenum;
3513 +       FILE *file;
3514 +       YY_BUFFER_STATE yy_prev_buf;
3515 +       int yy_prev_lineno;
3516 +       struct incl_file *prev;
3517 +};
3518 +
3519 +struct incl_file *incl_file_stack;
3520 +
3521 +
3522 +/*
3523 + * Detect infinite include recursion.
3524 + */
3525 +#define MAX_INCLUDE_DEPTH      (100)
3526 +
3527 +static int incl_depth = 0;
3528 +
3529 +
3530 +int push_input_file(const char *filename)
3531 +{
3532 +       FILE *f;
3533 +       struct incl_file *incl_file;
3534 +
3535 +       if (!filename) {
3536 +               yyerror("No include file name given.");
3537 +               return 0;
3538 +       }
3539 +
3540 +       if (incl_depth++ >= MAX_INCLUDE_DEPTH) {
3541 +               yyerror("Includes nested too deeply");
3542 +               return 0;
3543 +       }
3544 +
3545 +       f = dtc_open_file(filename);
3546 +
3547 +       incl_file = malloc(sizeof(struct incl_file));
3548 +       if (!incl_file) {
3549 +               yyerror("Can not allocate include file space.");
3550 +               return 0;
3551 +       }
3552 +
3553 +       /*
3554 +        * Save current context.
3555 +        */
3556 +       incl_file->yy_prev_buf = YY_CURRENT_BUFFER;
3557 +       incl_file->yy_prev_lineno = yylineno;
3558 +       incl_file->filenum = srcpos_filenum;
3559 +       incl_file->file = yyin;
3560 +       incl_file->prev = incl_file_stack;
3561 +
3562 +       incl_file_stack = incl_file;
3563 +
3564 +       /*
3565 +        * Establish new context.
3566 +        */
3567 +       srcpos_filenum = lookup_file_name(filename, 0);
3568 +       yylineno = 1;
3569 +       yyin = f;
3570 +       yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
3571 +
3572 +       return 1;
3573 +}
3574 +
3575 +
3576 +int pop_input_file(void)
3577 +{
3578 +       struct incl_file *incl_file;
3579 +
3580 +       if (incl_file_stack == 0)
3581 +               return 0;
3582 +
3583 +       fclose(yyin);
3584 +
3585 +       /*
3586 +        * Pop.
3587 +        */
3588 +       --incl_depth;
3589 +       incl_file = incl_file_stack;
3590 +       incl_file_stack = incl_file->prev;
3591 +
3592 +       /*
3593 +        * Recover old context.
3594 +        */
3595 +       yy_delete_buffer(YY_CURRENT_BUFFER);
3596 +       yy_switch_to_buffer(incl_file->yy_prev_buf);
3597 +       yylineno = incl_file->yy_prev_lineno;
3598 +       srcpos_filenum = incl_file->filenum;
3599 +       yyin = incl_file->file;
3600 +
3601 +       /*
3602 +        * Free old state.
3603 +        */
3604 +       free(incl_file);
3605 +
3606 +       if (YY_CURRENT_BUFFER == 0)
3607 +               return 0;
3608 +
3609 +       return 1;
3610 +}
3611 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped
3612 ===================================================================
3613 --- /dev/null
3614 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped
3615 @@ -0,0 +1,2174 @@
3616 +#line 2 "dtc-lexer.lex.c"
3617 +
3618 +#line 4 "dtc-lexer.lex.c"
3619 +
3620 +#define  YY_INT_ALIGNED short int
3621 +
3622 +/* A lexical scanner generated by flex */
3623 +
3624 +#define FLEX_SCANNER
3625 +#define YY_FLEX_MAJOR_VERSION 2
3626 +#define YY_FLEX_MINOR_VERSION 5
3627 +#define YY_FLEX_SUBMINOR_VERSION 33
3628 +#if YY_FLEX_SUBMINOR_VERSION > 0
3629 +#define FLEX_BETA
3630 +#endif
3631 +
3632 +/* First, we deal with  platform-specific or compiler-specific issues. */
3633 +
3634 +/* begin standard C headers. */
3635 +#include <stdio.h>
3636 +#include <string.h>
3637 +#include <errno.h>
3638 +#include <stdlib.h>
3639 +
3640 +/* end standard C headers. */
3641 +
3642 +/* flex integer type definitions */
3643 +
3644 +#ifndef FLEXINT_H
3645 +#define FLEXINT_H
3646 +
3647 +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
3648 +
3649 +#if __STDC_VERSION__ >= 199901L
3650 +
3651 +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
3652 + * if you want the limit (max/min) macros for int types. 
3653 + */
3654 +#ifndef __STDC_LIMIT_MACROS
3655 +#define __STDC_LIMIT_MACROS 1
3656 +#endif
3657 +
3658 +#include <inttypes.h>
3659 +typedef int8_t flex_int8_t;
3660 +typedef uint8_t flex_uint8_t;
3661 +typedef int16_t flex_int16_t;
3662 +typedef uint16_t flex_uint16_t;
3663 +typedef int32_t flex_int32_t;
3664 +typedef uint32_t flex_uint32_t;
3665 +#else
3666 +typedef signed char flex_int8_t;
3667 +typedef short int flex_int16_t;
3668 +typedef int flex_int32_t;
3669 +typedef unsigned char flex_uint8_t; 
3670 +typedef unsigned short int flex_uint16_t;
3671 +typedef unsigned int flex_uint32_t;
3672 +#endif /* ! C99 */
3673 +
3674 +/* Limits of integral types. */
3675 +#ifndef INT8_MIN
3676 +#define INT8_MIN               (-128)
3677 +#endif
3678 +#ifndef INT16_MIN
3679 +#define INT16_MIN              (-32767-1)
3680 +#endif
3681 +#ifndef INT32_MIN
3682 +#define INT32_MIN              (-2147483647-1)
3683 +#endif
3684 +#ifndef INT8_MAX
3685 +#define INT8_MAX               (127)
3686 +#endif
3687 +#ifndef INT16_MAX
3688 +#define INT16_MAX              (32767)
3689 +#endif
3690 +#ifndef INT32_MAX
3691 +#define INT32_MAX              (2147483647)
3692 +#endif
3693 +#ifndef UINT8_MAX
3694 +#define UINT8_MAX              (255U)
3695 +#endif
3696 +#ifndef UINT16_MAX
3697 +#define UINT16_MAX             (65535U)
3698 +#endif
3699 +#ifndef UINT32_MAX
3700 +#define UINT32_MAX             (4294967295U)
3701 +#endif
3702 +
3703 +#endif /* ! FLEXINT_H */
3704 +
3705 +#ifdef __cplusplus
3706 +
3707 +/* The "const" storage-class-modifier is valid. */
3708 +#define YY_USE_CONST
3709 +
3710 +#else  /* ! __cplusplus */
3711 +
3712 +#if __STDC__
3713 +
3714 +#define YY_USE_CONST
3715 +
3716 +#endif /* __STDC__ */
3717 +#endif /* ! __cplusplus */
3718 +
3719 +#ifdef YY_USE_CONST
3720 +#define yyconst const
3721 +#else
3722 +#define yyconst
3723 +#endif
3724 +
3725 +/* Returned upon end-of-file. */
3726 +#define YY_NULL 0
3727 +
3728 +/* Promotes a possibly negative, possibly signed char to an unsigned
3729 + * integer for use as an array index.  If the signed char is negative,
3730 + * we want to instead treat it as an 8-bit unsigned char, hence the
3731 + * double cast.
3732 + */
3733 +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
3734 +
3735 +/* Enter a start condition.  This macro really ought to take a parameter,
3736 + * but we do it the disgusting crufty way forced on us by the ()-less
3737 + * definition of BEGIN.
3738 + */
3739 +#define BEGIN (yy_start) = 1 + 2 *
3740 +
3741 +/* Translate the current start state into a value that can be later handed
3742 + * to BEGIN to return to the state.  The YYSTATE alias is for lex
3743 + * compatibility.
3744 + */
3745 +#define YY_START (((yy_start) - 1) / 2)
3746 +#define YYSTATE YY_START
3747 +
3748 +/* Action number for EOF rule of a given start state. */
3749 +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
3750 +
3751 +/* Special action meaning "start processing a new file". */
3752 +#define YY_NEW_FILE yyrestart(yyin  )
3753 +
3754 +#define YY_END_OF_BUFFER_CHAR 0
3755 +
3756 +/* Size of default input buffer. */
3757 +#ifndef YY_BUF_SIZE
3758 +#define YY_BUF_SIZE 16384
3759 +#endif
3760 +
3761 +/* The state buf must be large enough to hold one state per character in the main buffer.
3762 + */
3763 +#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
3764 +
3765 +#ifndef YY_TYPEDEF_YY_BUFFER_STATE
3766 +#define YY_TYPEDEF_YY_BUFFER_STATE
3767 +typedef struct yy_buffer_state *YY_BUFFER_STATE;
3768 +#endif
3769 +
3770 +extern int yyleng;
3771 +
3772 +extern FILE *yyin, *yyout;
3773 +
3774 +#define EOB_ACT_CONTINUE_SCAN 0
3775 +#define EOB_ACT_END_OF_FILE 1
3776 +#define EOB_ACT_LAST_MATCH 2
3777 +
3778 +    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
3779 +     *       access to the local variable yy_act. Since yyless() is a macro, it would break
3780 +     *       existing scanners that call yyless() from OUTSIDE yylex. 
3781 +     *       One obvious solution it to make yy_act a global. I tried that, and saw
3782 +     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
3783 +     *       normally declared as a register variable-- so it is not worth it.
3784 +     */
3785 +    #define  YY_LESS_LINENO(n) \
3786 +            do { \
3787 +                int yyl;\
3788 +                for ( yyl = n; yyl < yyleng; ++yyl )\
3789 +                    if ( yytext[yyl] == '\n' )\
3790 +                        --yylineno;\
3791 +            }while(0)
3792 +    
3793 +/* Return all but the first "n" matched characters back to the input stream. */
3794 +#define yyless(n) \
3795 +       do \
3796 +               { \
3797 +               /* Undo effects of setting up yytext. */ \
3798 +        int yyless_macro_arg = (n); \
3799 +        YY_LESS_LINENO(yyless_macro_arg);\
3800 +               *yy_cp = (yy_hold_char); \
3801 +               YY_RESTORE_YY_MORE_OFFSET \
3802 +               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
3803 +               YY_DO_BEFORE_ACTION; /* set up yytext again */ \
3804 +               } \
3805 +       while ( 0 )
3806 +
3807 +#define unput(c) yyunput( c, (yytext_ptr)  )
3808 +
3809 +/* The following is because we cannot portably get our hands on size_t
3810 + * (without autoconf's help, which isn't available because we want
3811 + * flex-generated scanners to compile on their own).
3812 + */
3813 +
3814 +#ifndef YY_TYPEDEF_YY_SIZE_T
3815 +#define YY_TYPEDEF_YY_SIZE_T
3816 +typedef unsigned int yy_size_t;
3817 +#endif
3818 +
3819 +#ifndef YY_STRUCT_YY_BUFFER_STATE
3820 +#define YY_STRUCT_YY_BUFFER_STATE
3821 +struct yy_buffer_state
3822 +       {
3823 +       FILE *yy_input_file;
3824 +
3825 +       char *yy_ch_buf;                /* input buffer */
3826 +       char *yy_buf_pos;               /* current position in input buffer */
3827 +
3828 +       /* Size of input buffer in bytes, not including room for EOB
3829 +        * characters.
3830 +        */
3831 +       yy_size_t yy_buf_size;
3832 +
3833 +       /* Number of characters read into yy_ch_buf, not including EOB
3834 +        * characters.
3835 +        */
3836 +       int yy_n_chars;
3837 +
3838 +       /* Whether we "own" the buffer - i.e., we know we created it,
3839 +        * and can realloc() it to grow it, and should free() it to
3840 +        * delete it.
3841 +        */
3842 +       int yy_is_our_buffer;
3843 +
3844 +       /* Whether this is an "interactive" input source; if so, and
3845 +        * if we're using stdio for input, then we want to use getc()
3846 +        * instead of fread(), to make sure we stop fetching input after
3847 +        * each newline.
3848 +        */
3849 +       int yy_is_interactive;
3850 +
3851 +       /* Whether we're considered to be at the beginning of a line.
3852 +        * If so, '^' rules will be active on the next match, otherwise
3853 +        * not.
3854 +        */
3855 +       int yy_at_bol;
3856 +
3857 +    int yy_bs_lineno; /**< The line count. */
3858 +    int yy_bs_column; /**< The column count. */
3859 +    
3860 +       /* Whether to try to fill the input buffer when we reach the
3861 +        * end of it.
3862 +        */
3863 +       int yy_fill_buffer;
3864 +
3865 +       int yy_buffer_status;
3866 +
3867 +#define YY_BUFFER_NEW 0
3868 +#define YY_BUFFER_NORMAL 1
3869 +       /* When an EOF's been seen but there's still some text to process
3870 +        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
3871 +        * shouldn't try reading from the input source any more.  We might
3872 +        * still have a bunch of tokens to match, though, because of
3873 +        * possible backing-up.
3874 +        *
3875 +        * When we actually see the EOF, we change the status to "new"
3876 +        * (via yyrestart()), so that the user can continue scanning by
3877 +        * just pointing yyin at a new input file.
3878 +        */
3879 +#define YY_BUFFER_EOF_PENDING 2
3880 +
3881 +       };
3882 +#endif /* !YY_STRUCT_YY_BUFFER_STATE */
3883 +
3884 +/* Stack of input buffers. */
3885 +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
3886 +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
3887 +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
3888 +
3889 +/* We provide macros for accessing buffer states in case in the
3890 + * future we want to put the buffer states in a more general
3891 + * "scanner state".
3892 + *
3893 + * Returns the top of the stack, or NULL.
3894 + */
3895 +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
3896 +                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
3897 +                          : NULL)
3898 +
3899 +/* Same as previous macro, but useful when we know that the buffer stack is not
3900 + * NULL or when we need an lvalue. For internal use only.
3901 + */
3902 +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
3903 +
3904 +/* yy_hold_char holds the character lost when yytext is formed. */
3905 +static char yy_hold_char;
3906 +static int yy_n_chars;         /* number of characters read into yy_ch_buf */
3907 +int yyleng;
3908 +
3909 +/* Points to current character in buffer. */
3910 +static char *yy_c_buf_p = (char *) 0;
3911 +static int yy_init = 0;                /* whether we need to initialize */
3912 +static int yy_start = 0;       /* start state number */
3913 +
3914 +/* Flag which is used to allow yywrap()'s to do buffer switches
3915 + * instead of setting up a fresh yyin.  A bit of a hack ...
3916 + */
3917 +static int yy_did_buffer_switch_on_eof;
3918 +
3919 +void yyrestart (FILE *input_file  );
3920 +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
3921 +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
3922 +void yy_delete_buffer (YY_BUFFER_STATE b  );
3923 +void yy_flush_buffer (YY_BUFFER_STATE b  );
3924 +void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
3925 +void yypop_buffer_state (void );
3926 +
3927 +static void yyensure_buffer_stack (void );
3928 +static void yy_load_buffer_state (void );
3929 +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
3930 +
3931 +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
3932 +
3933 +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
3934 +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
3935 +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
3936 +
3937 +void *yyalloc (yy_size_t  );
3938 +void *yyrealloc (void *,yy_size_t  );
3939 +void yyfree (void *  );
3940 +
3941 +#define yy_new_buffer yy_create_buffer
3942 +
3943 +#define yy_set_interactive(is_interactive) \
3944 +       { \
3945 +       if ( ! YY_CURRENT_BUFFER ){ \
3946 +        yyensure_buffer_stack (); \
3947 +               YY_CURRENT_BUFFER_LVALUE =    \
3948 +            yy_create_buffer(yyin,YY_BUF_SIZE ); \
3949 +       } \
3950 +       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
3951 +       }
3952 +
3953 +#define yy_set_bol(at_bol) \
3954 +       { \
3955 +       if ( ! YY_CURRENT_BUFFER ){\
3956 +        yyensure_buffer_stack (); \
3957 +               YY_CURRENT_BUFFER_LVALUE =    \
3958 +            yy_create_buffer(yyin,YY_BUF_SIZE ); \
3959 +       } \
3960 +       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
3961 +       }
3962 +
3963 +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
3964 +
3965 +/* Begin user sect3 */
3966 +
3967 +#define yywrap() 1
3968 +#define YY_SKIP_YYWRAP
3969 +
3970 +typedef unsigned char YY_CHAR;
3971 +
3972 +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
3973 +
3974 +typedef int yy_state_type;
3975 +
3976 +extern int yylineno;
3977 +
3978 +int yylineno = 1;
3979 +
3980 +extern char *yytext;
3981 +#define yytext_ptr yytext
3982 +
3983 +static yy_state_type yy_get_previous_state (void );
3984 +static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
3985 +static int yy_get_next_buffer (void );
3986 +static void yy_fatal_error (yyconst char msg[]  );
3987 +
3988 +/* Done after the current pattern has been matched and before the
3989 + * corresponding action - sets up yytext.
3990 + */
3991 +#define YY_DO_BEFORE_ACTION \
3992 +       (yytext_ptr) = yy_bp; \
3993 +       yyleng = (size_t) (yy_cp - yy_bp); \
3994 +       (yy_hold_char) = *yy_cp; \
3995 +       *yy_cp = '\0'; \
3996 +       (yy_c_buf_p) = yy_cp;
3997 +
3998 +#define YY_NUM_RULES 20
3999 +#define YY_END_OF_BUFFER 21
4000 +/* This struct is not used in this scanner,
4001 +   but its presence is necessary. */
4002 +struct yy_trans_info
4003 +       {
4004 +       flex_int32_t yy_verify;
4005 +       flex_int32_t yy_nxt;
4006 +       };
4007 +static yyconst flex_int16_t yy_accept[94] =
4008 +    {   0,
4009 +        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
4010 +       21,   19,   16,   16,   19,   19,   19,    8,    8,   19,
4011 +        8,   19,   19,   19,   19,   14,   15,   15,   19,    9,
4012 +        9,   16,    0,    3,    0,    0,   10,    0,    0,    0,
4013 +        0,    0,    0,    8,    8,    6,    0,    7,    0,    2,
4014 +        0,   13,   13,   15,   15,    9,    0,   12,   10,    0,
4015 +        0,    0,    0,   18,    0,    0,    0,    2,    9,    0,
4016 +       17,    0,    0,    0,   11,    0,    0,    0,    0,    0,
4017 +        0,    0,    0,    0,    4,    0,    0,    1,    0,    0,
4018 +        0,    5,    0
4019 +
4020 +    } ;
4021 +
4022 +static yyconst flex_int32_t yy_ec[256] =
4023 +    {   0,
4024 +        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
4025 +        2,    2,    2,    1,    1,    1,    1,    1,    1,    1,
4026 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4027 +        1,    2,    1,    4,    5,    1,    1,    6,    1,    1,
4028 +        1,    7,    8,    8,    9,    8,   10,   11,   12,   13,
4029 +       13,   13,   13,   13,   13,   13,   13,   14,    1,    1,
4030 +        1,    1,    8,    8,   15,   15,   15,   15,   15,   15,
4031 +       16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
4032 +       16,   16,   16,   16,   16,   16,   16,   17,   16,   16,
4033 +        1,   18,   19,    1,   16,    1,   15,   20,   21,   22,
4034 +
4035 +       23,   15,   16,   24,   25,   16,   16,   26,   27,   28,
4036 +       24,   16,   16,   29,   30,   31,   32,   33,   16,   17,
4037 +       16,   16,   34,    1,   35,    1,    1,    1,    1,    1,
4038 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4039 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4040 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4041 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4042 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4043 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4044 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4045 +
4046 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4047 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4048 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4049 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4050 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4051 +        1,    1,    1,    1,    1
4052 +    } ;
4053 +
4054 +static yyconst flex_int32_t yy_meta[36] =
4055 +    {   0,
4056 +        1,    1,    1,    1,    2,    1,    2,    2,    2,    3,
4057 +        4,    4,    4,    5,    6,    7,    7,    1,    1,    6,
4058 +        6,    6,    6,    7,    7,    7,    7,    7,    7,    7,
4059 +        7,    7,    7,    8,    1
4060 +    } ;
4061 +
4062 +static yyconst flex_int16_t yy_base[107] =
4063 +    {   0,
4064 +        0,    0,   32,    0,   53,    0,   76,    0,  108,  111,
4065 +      280,  288,   37,   39,   33,   36,  106,    0,  123,  146,
4066 +      255,  251,   45,    0,  159,  288,    0,   53,  108,  172,
4067 +      114,  127,  158,  288,  245,    0,    0,  234,  235,  236,
4068 +      197,  195,  199,    0,    0,  288,    0,  288,  160,  288,
4069 +      183,  288,    0,    0,  183,  182,    0,    0,    0,    0,
4070 +      204,  189,  207,  288,  179,  187,  180,  194,    0,  171,
4071 +      288,  196,  178,  174,  288,  169,  169,  177,  165,  153,
4072 +      143,  155,  137,  118,  288,  122,   42,  288,   36,   36,
4073 +       40,  288,  288,  212,  218,  223,  229,  234,  239,  245,
4074 +
4075 +      251,  255,  262,  270,  275,  280
4076 +    } ;
4077 +
4078 +static yyconst flex_int16_t yy_def[107] =
4079 +    {   0,
4080 +       93,    1,    1,    3,    3,    5,   93,    7,    3,    3,
4081 +       93,   93,   93,   93,   94,   95,   93,   96,   93,   19,
4082 +       19,   20,   97,   98,   20,   93,   99,  100,   95,   93,
4083 +       93,   93,   94,   93,   94,  101,  102,   93,  103,  104,
4084 +       93,   93,   93,   96,   19,   93,   20,   93,   97,   93,
4085 +       97,   93,   20,   99,  100,   93,  105,  101,  102,  106,
4086 +      103,  103,  104,   93,   93,   93,   93,   94,  105,  106,
4087 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4088 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4089 +       93,   93,    0,   93,   93,   93,   93,   93,   93,   93,
4090 +
4091 +       93,   93,   93,   93,   93,   93
4092 +    } ;
4093 +
4094 +static yyconst flex_int16_t yy_nxt[324] =
4095 +    {   0,
4096 +       12,   13,   14,   15,   12,   16,   12,   12,   12,   17,
4097 +       18,   18,   18,   12,   19,   20,   20,   12,   12,   21,
4098 +       19,   21,   19,   22,   20,   20,   20,   20,   20,   20,
4099 +       20,   20,   20,   12,   12,   23,   34,   12,   32,   32,
4100 +       32,   32,   12,   12,   12,   36,   20,   33,   50,   92,
4101 +       35,   20,   20,   20,   20,   20,   15,   54,   91,   54,
4102 +       54,   54,   51,   24,   24,   24,   46,   25,   90,   38,
4103 +       89,   26,   25,   25,   25,   25,   12,   13,   14,   15,
4104 +       27,   12,   27,   27,   27,   17,   27,   27,   27,   12,
4105 +       28,   28,   28,   12,   12,   28,   28,   28,   28,   28,
4106 +
4107 +       28,   28,   28,   28,   28,   28,   28,   28,   28,   12,
4108 +       12,   15,   39,   29,   15,   40,   29,   93,   30,   31,
4109 +       31,   30,   31,   31,   56,   56,   56,   41,   32,   32,
4110 +       42,   88,   43,   45,   45,   45,   46,   45,   47,   47,
4111 +       87,   38,   45,   45,   45,   45,   47,   47,   47,   47,
4112 +       47,   47,   47,   47,   47,   47,   47,   47,   47,   86,
4113 +       47,   34,   33,   50,   85,   47,   47,   47,   47,   53,
4114 +       53,   53,   84,   53,   83,   35,   82,   51,   53,   53,
4115 +       53,   53,   56,   56,   56,   93,   68,   54,   57,   54,
4116 +       54,   54,   56,   56,   56,   62,   46,   34,   71,   81,
4117 +
4118 +       80,   79,   78,   77,   76,   75,   74,   73,   72,   64,
4119 +       62,   35,   33,   33,   33,   33,   33,   33,   33,   33,
4120 +       37,   67,   66,   37,   37,   37,   44,   65,   44,   49,
4121 +       49,   49,   49,   49,   49,   49,   49,   52,   64,   52,
4122 +       54,   62,   54,   60,   54,   54,   55,   93,   55,   55,
4123 +       55,   55,   58,   58,   58,   48,   58,   58,   59,   48,
4124 +       59,   59,   61,   61,   61,   61,   61,   61,   61,   61,
4125 +       63,   63,   63,   63,   63,   63,   63,   63,   69,   93,
4126 +       69,   70,   70,   70,   93,   70,   70,   11,   93,   93,
4127 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4128 +
4129 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4130 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4131 +       93,   93,   93
4132 +    } ;
4133 +
4134 +static yyconst flex_int16_t yy_chk[324] =
4135 +    {   0,
4136 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4137 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4138 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4139 +        1,    1,    1,    1,    1,    3,   15,    3,   13,   13,
4140 +       14,   14,    3,    3,    3,   16,    3,   23,   23,   91,
4141 +       15,    3,    3,    3,    3,    3,    5,   28,   90,   28,
4142 +       28,   28,   23,    5,    5,    5,   28,    5,   89,   16,
4143 +       87,    5,    5,    5,    5,    5,    7,    7,    7,    7,
4144 +        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
4145 +        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
4146 +
4147 +        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
4148 +        7,    9,   17,    9,   10,   17,   10,   29,    9,    9,
4149 +        9,   10,   10,   10,   31,   31,   31,   17,   32,   32,
4150 +       17,   86,   17,   19,   19,   19,   19,   19,   19,   19,
4151 +       84,   29,   19,   19,   19,   19,   19,   19,   19,   19,
4152 +       19,   19,   19,   19,   19,   19,   20,   20,   20,   83,
4153 +       20,   33,   49,   49,   82,   20,   20,   20,   20,   25,
4154 +       25,   25,   81,   25,   80,   33,   79,   49,   25,   25,
4155 +       25,   25,   30,   30,   30,   51,   51,   55,   30,   55,
4156 +       55,   55,   56,   56,   56,   62,   55,   68,   62,   78,
4157 +
4158 +       77,   76,   74,   73,   72,   70,   67,   66,   65,   63,
4159 +       61,   68,   94,   94,   94,   94,   94,   94,   94,   94,
4160 +       95,   43,   42,   95,   95,   95,   96,   41,   96,   97,
4161 +       97,   97,   97,   97,   97,   97,   97,   98,   40,   98,
4162 +       99,   39,   99,   38,   99,   99,  100,   35,  100,  100,
4163 +      100,  100,  101,  101,  101,   22,  101,  101,  102,   21,
4164 +      102,  102,  103,  103,  103,  103,  103,  103,  103,  103,
4165 +      104,  104,  104,  104,  104,  104,  104,  104,  105,   11,
4166 +      105,  106,  106,  106,    0,  106,  106,   93,   93,   93,
4167 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4168 +
4169 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4170 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4171 +       93,   93,   93
4172 +    } ;
4173 +
4174 +/* Table of booleans, true if rule could match eol. */
4175 +static yyconst flex_int32_t yy_rule_can_match_eol[21] =
4176 +    {   0,
4177 +0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 
4178 +    0,     };
4179 +
4180 +static yy_state_type yy_last_accepting_state;
4181 +static char *yy_last_accepting_cpos;
4182 +
4183 +extern int yy_flex_debug;
4184 +int yy_flex_debug = 0;
4185 +
4186 +/* The intent behind this definition is that it'll catch
4187 + * any uses of REJECT which flex missed.
4188 + */
4189 +#define REJECT reject_used_but_not_detected
4190 +#define yymore() yymore_used_but_not_detected
4191 +#define YY_MORE_ADJ 0
4192 +#define YY_RESTORE_YY_MORE_OFFSET
4193 +char *yytext;
4194 +#line 1 "dtc-lexer.l"
4195 +/*
4196 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
4197 + *
4198 + *
4199 + * This program is free software; you can redistribute it and/or
4200 + * modify it under the terms of the GNU General Public License as
4201 + * published by the Free Software Foundation; either version 2 of the
4202 + * License, or (at your option) any later version.
4203 + *
4204 + *  This program is distributed in the hope that it will be useful,
4205 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
4206 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4207 + *  General Public License for more details.
4208 + *
4209 + *  You should have received a copy of the GNU General Public License
4210 + *  along with this program; if not, write to the Free Software
4211 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
4212 + *                                                                   USA
4213 + */
4214 +
4215 +
4216 +
4217 +
4218 +#line 33 "dtc-lexer.l"
4219 +#include "dtc.h"
4220 +#include "srcpos.h"
4221 +#include "dtc-parser.tab.h"
4222 +
4223 +
4224 +/*#define LEXDEBUG     1*/
4225 +
4226 +#ifdef LEXDEBUG
4227 +#define DPRINT(fmt, ...)       fprintf(stderr, fmt, ##__VA_ARGS__)
4228 +#else
4229 +#define DPRINT(fmt, ...)       do { } while (0)
4230 +#endif
4231 +
4232 +static int dts_version; /* = 0 */
4233 +
4234 +#define BEGIN_DEFAULT()        if (dts_version == 0) { \
4235 +                               DPRINT("<INITIAL>\n"); \
4236 +                               BEGIN(INITIAL); \
4237 +                       } else { \
4238 +                               DPRINT("<V1>\n"); \
4239 +                               BEGIN(V1); \
4240 +                       }
4241 +#line 627 "dtc-lexer.lex.c"
4242 +
4243 +#define INITIAL 0
4244 +#define INCLUDE 1
4245 +#define BYTESTRING 2
4246 +#define PROPNODENAME 3
4247 +#define V1 4
4248 +
4249 +#ifndef YY_NO_UNISTD_H
4250 +/* Special case for "unistd.h", since it is non-ANSI. We include it way
4251 + * down here because we want the user's section 1 to have been scanned first.
4252 + * The user has a chance to override it with an option.
4253 + */
4254 +#include <unistd.h>
4255 +#endif
4256 +
4257 +#ifndef YY_EXTRA_TYPE
4258 +#define YY_EXTRA_TYPE void *
4259 +#endif
4260 +
4261 +static int yy_init_globals (void );
4262 +
4263 +/* Macros after this point can all be overridden by user definitions in
4264 + * section 1.
4265 + */
4266 +
4267 +#ifndef YY_SKIP_YYWRAP
4268 +#ifdef __cplusplus
4269 +extern "C" int yywrap (void );
4270 +#else
4271 +extern int yywrap (void );
4272 +#endif
4273 +#endif
4274 +
4275 +#ifndef yytext_ptr
4276 +static void yy_flex_strncpy (char *,yyconst char *,int );
4277 +#endif
4278 +
4279 +#ifdef YY_NEED_STRLEN
4280 +static int yy_flex_strlen (yyconst char * );
4281 +#endif
4282 +
4283 +#ifndef YY_NO_INPUT
4284 +
4285 +#ifdef __cplusplus
4286 +static int yyinput (void );
4287 +#else
4288 +static int input (void );
4289 +#endif
4290 +
4291 +#endif
4292 +
4293 +/* Amount of stuff to slurp up with each read. */
4294 +#ifndef YY_READ_BUF_SIZE
4295 +#define YY_READ_BUF_SIZE 8192
4296 +#endif
4297 +
4298 +/* Copy whatever the last rule matched to the standard output. */
4299 +#ifndef ECHO
4300 +/* This used to be an fputs(), but since the string might contain NUL's,
4301 + * we now use fwrite().
4302 + */
4303 +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
4304 +#endif
4305 +
4306 +/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
4307 + * is returned in "result".
4308 + */
4309 +#ifndef YY_INPUT
4310 +#define YY_INPUT(buf,result,max_size) \
4311 +       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
4312 +               { \
4313 +               int c = '*'; \
4314 +               size_t n; \
4315 +               for ( n = 0; n < max_size && \
4316 +                            (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
4317 +                       buf[n] = (char) c; \
4318 +               if ( c == '\n' ) \
4319 +                       buf[n++] = (char) c; \
4320 +               if ( c == EOF && ferror( yyin ) ) \
4321 +                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
4322 +               result = n; \
4323 +               } \
4324 +       else \
4325 +               { \
4326 +               errno=0; \
4327 +               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
4328 +                       { \
4329 +                       if( errno != EINTR) \
4330 +                               { \
4331 +                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
4332 +                               break; \
4333 +                               } \
4334 +                       errno=0; \
4335 +                       clearerr(yyin); \
4336 +                       } \
4337 +               }\
4338 +\
4339 +
4340 +#endif
4341 +
4342 +/* No semi-colon after return; correct usage is to write "yyterminate();" -
4343 + * we don't want an extra ';' after the "return" because that will cause
4344 + * some compilers to complain about unreachable statements.
4345 + */
4346 +#ifndef yyterminate
4347 +#define yyterminate() return YY_NULL
4348 +#endif
4349 +
4350 +/* Number of entries by which start-condition stack grows. */
4351 +#ifndef YY_START_STACK_INCR
4352 +#define YY_START_STACK_INCR 25
4353 +#endif
4354 +
4355 +/* Report a fatal error. */
4356 +#ifndef YY_FATAL_ERROR
4357 +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
4358 +#endif
4359 +
4360 +/* end tables serialization structures and prototypes */
4361 +
4362 +/* Default declaration of generated scanner - a define so the user can
4363 + * easily add parameters.
4364 + */
4365 +#ifndef YY_DECL
4366 +#define YY_DECL_IS_OURS 1
4367 +
4368 +extern int yylex (void);
4369 +
4370 +#define YY_DECL int yylex (void)
4371 +#endif /* !YY_DECL */
4372 +
4373 +/* Code executed at the beginning of each rule, after yytext and yyleng
4374 + * have been set up.
4375 + */
4376 +#ifndef YY_USER_ACTION
4377 +#define YY_USER_ACTION
4378 +#endif
4379 +
4380 +/* Code executed at the end of each rule. */
4381 +#ifndef YY_BREAK
4382 +#define YY_BREAK break;
4383 +#endif
4384 +
4385 +#define YY_RULE_SETUP \
4386 +       YY_USER_ACTION
4387 +
4388 +/** The main scanner function which does all the work.
4389 + */
4390 +YY_DECL
4391 +{
4392 +       register yy_state_type yy_current_state;
4393 +       register char *yy_cp, *yy_bp;
4394 +       register int yy_act;
4395 +    
4396 +#line 57 "dtc-lexer.l"
4397 +
4398 +#line 784 "dtc-lexer.lex.c"
4399 +
4400 +       if ( !(yy_init) )
4401 +               {
4402 +               (yy_init) = 1;
4403 +
4404 +#ifdef YY_USER_INIT
4405 +               YY_USER_INIT;
4406 +#endif
4407 +
4408 +               if ( ! (yy_start) )
4409 +                       (yy_start) = 1; /* first start state */
4410 +
4411 +               if ( ! yyin )
4412 +                       yyin = stdin;
4413 +
4414 +               if ( ! yyout )
4415 +                       yyout = stdout;
4416 +
4417 +               if ( ! YY_CURRENT_BUFFER ) {
4418 +                       yyensure_buffer_stack ();
4419 +                       YY_CURRENT_BUFFER_LVALUE =
4420 +                               yy_create_buffer(yyin,YY_BUF_SIZE );
4421 +               }
4422 +
4423 +               yy_load_buffer_state( );
4424 +               }
4425 +
4426 +       while ( 1 )             /* loops until end-of-file is reached */
4427 +               {
4428 +               yy_cp = (yy_c_buf_p);
4429 +
4430 +               /* Support of yytext. */
4431 +               *yy_cp = (yy_hold_char);
4432 +
4433 +               /* yy_bp points to the position in yy_ch_buf of the start of
4434 +                * the current run.
4435 +                */
4436 +               yy_bp = yy_cp;
4437 +
4438 +               yy_current_state = (yy_start);
4439 +yy_match:
4440 +               do
4441 +                       {
4442 +                       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
4443 +                       if ( yy_accept[yy_current_state] )
4444 +                               {
4445 +                               (yy_last_accepting_state) = yy_current_state;
4446 +                               (yy_last_accepting_cpos) = yy_cp;
4447 +                               }
4448 +                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
4449 +                               {
4450 +                               yy_current_state = (int) yy_def[yy_current_state];
4451 +                               if ( yy_current_state >= 94 )
4452 +                                       yy_c = yy_meta[(unsigned int) yy_c];
4453 +                               }
4454 +                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
4455 +                       ++yy_cp;
4456 +                       }
4457 +               while ( yy_base[yy_current_state] != 288 );
4458 +
4459 +yy_find_action:
4460 +               yy_act = yy_accept[yy_current_state];
4461 +               if ( yy_act == 0 )
4462 +                       { /* have to back up */
4463 +                       yy_cp = (yy_last_accepting_cpos);
4464 +                       yy_current_state = (yy_last_accepting_state);
4465 +                       yy_act = yy_accept[yy_current_state];
4466 +                       }
4467 +
4468 +               YY_DO_BEFORE_ACTION;
4469 +
4470 +               if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
4471 +                       {
4472 +                       int yyl;
4473 +                       for ( yyl = 0; yyl < yyleng; ++yyl )
4474 +                               if ( yytext[yyl] == '\n' )
4475 +                                          
4476 +    yylineno++;
4477 +;
4478 +                       }
4479 +
4480 +do_action:     /* This label is used only to access EOF actions. */
4481 +
4482 +               switch ( yy_act )
4483 +       { /* beginning of action switch */
4484 +                       case 0: /* must back up */
4485 +                       /* undo the effects of YY_DO_BEFORE_ACTION */
4486 +                       *yy_cp = (yy_hold_char);
4487 +                       yy_cp = (yy_last_accepting_cpos);
4488 +                       yy_current_state = (yy_last_accepting_state);
4489 +                       goto yy_find_action;
4490 +
4491 +case 1:
4492 +YY_RULE_SETUP
4493 +#line 58 "dtc-lexer.l"
4494 +BEGIN(INCLUDE);
4495 +       YY_BREAK
4496 +case 2:
4497 +YY_RULE_SETUP
4498 +#line 60 "dtc-lexer.l"
4499 +{
4500 +                       yytext[strlen(yytext) - 1] = 0;
4501 +                       if (!push_input_file(yytext + 1)) {
4502 +                               /* Some unrecoverable error.*/
4503 +                               exit(1);
4504 +                       }
4505 +                       BEGIN_DEFAULT();
4506 +               }
4507 +       YY_BREAK
4508 +case YY_STATE_EOF(INITIAL):
4509 +case YY_STATE_EOF(INCLUDE):
4510 +case YY_STATE_EOF(BYTESTRING):
4511 +case YY_STATE_EOF(PROPNODENAME):
4512 +case YY_STATE_EOF(V1):
4513 +#line 70 "dtc-lexer.l"
4514 +{
4515 +                       if (!pop_input_file()) {
4516 +                               yyterminate();
4517 +                       }
4518 +               }
4519 +       YY_BREAK
4520 +case 3:
4521 +/* rule 3 can match eol */
4522 +YY_RULE_SETUP
4523 +#line 76 "dtc-lexer.l"
4524 +{
4525 +                       yylloc.filenum = srcpos_filenum;
4526 +                       yylloc.first_line = yylineno;
4527 +                       DPRINT("String: %s\n", yytext);
4528 +                       yylval.data = data_copy_escape_string(yytext+1,
4529 +                                       yyleng-2);
4530 +                       yylloc.first_line = yylineno;
4531 +                       return DT_STRING;
4532 +               }
4533 +       YY_BREAK
4534 +case 4:
4535 +YY_RULE_SETUP
4536 +#line 86 "dtc-lexer.l"
4537 +{
4538 +                       yylloc.filenum = srcpos_filenum;
4539 +                       yylloc.first_line = yylineno;
4540 +                       DPRINT("Keyword: /dts-v1/\n");
4541 +                       dts_version = 1;
4542 +                       BEGIN_DEFAULT();
4543 +                       return DT_V1;
4544 +               }
4545 +       YY_BREAK
4546 +case 5:
4547 +YY_RULE_SETUP
4548 +#line 95 "dtc-lexer.l"
4549 +{
4550 +                       yylloc.filenum = srcpos_filenum;
4551 +                       yylloc.first_line = yylineno;
4552 +                       DPRINT("Keyword: /memreserve/\n");
4553 +                       BEGIN_DEFAULT();
4554 +                       return DT_MEMRESERVE;
4555 +               }
4556 +       YY_BREAK
4557 +case 6:
4558 +YY_RULE_SETUP
4559 +#line 103 "dtc-lexer.l"
4560 +{
4561 +                       yylloc.filenum = srcpos_filenum;
4562 +                       yylloc.first_line = yylineno;
4563 +                       DPRINT("Label: %s\n", yytext);
4564 +                       yylval.labelref = strdup(yytext);
4565 +                       yylval.labelref[yyleng-1] = '\0';
4566 +                       return DT_LABEL;
4567 +               }
4568 +       YY_BREAK
4569 +case 7:
4570 +YY_RULE_SETUP
4571 +#line 112 "dtc-lexer.l"
4572 +{
4573 +                       yylloc.filenum = srcpos_filenum;
4574 +                       yylloc.first_line = yylineno;
4575 +                       if (*yytext == 'b')
4576 +                               yylval.cbase = 2;
4577 +                       else if (*yytext == 'o')
4578 +                               yylval.cbase = 8;
4579 +                       else if (*yytext == 'd')
4580 +                               yylval.cbase = 10;
4581 +                       else
4582 +                               yylval.cbase = 16;
4583 +                       DPRINT("Base: %d\n", yylval.cbase);
4584 +                       return DT_BASE;
4585 +               }
4586 +       YY_BREAK
4587 +case 8:
4588 +YY_RULE_SETUP
4589 +#line 127 "dtc-lexer.l"
4590 +{
4591 +                       yylloc.filenum = srcpos_filenum;
4592 +                       yylloc.first_line = yylineno;
4593 +                       yylval.literal = strdup(yytext);
4594 +                       DPRINT("Literal: '%s'\n", yylval.literal);
4595 +                       return DT_LEGACYLITERAL;
4596 +               }
4597 +       YY_BREAK
4598 +case 9:
4599 +YY_RULE_SETUP
4600 +#line 135 "dtc-lexer.l"
4601 +{
4602 +                       yylloc.filenum = srcpos_filenum;
4603 +                       yylloc.first_line = yylineno;
4604 +                       yylval.literal = strdup(yytext);
4605 +                       DPRINT("Literal: '%s'\n", yylval.literal);
4606 +                       return DT_LITERAL;
4607 +               }
4608 +       YY_BREAK
4609 +case 10:
4610 +YY_RULE_SETUP
4611 +#line 143 "dtc-lexer.l"
4612 +{      /* label reference */
4613 +                       yylloc.filenum = srcpos_filenum;
4614 +                       yylloc.first_line = yylineno;
4615 +                       DPRINT("Ref: %s\n", yytext+1);
4616 +                       yylval.labelref = strdup(yytext+1);
4617 +                       return DT_REF;
4618 +               }
4619 +       YY_BREAK
4620 +case 11:
4621 +YY_RULE_SETUP
4622 +#line 151 "dtc-lexer.l"
4623 +{      /* new-style path reference */
4624 +                       yylloc.filenum = srcpos_filenum;
4625 +                       yylloc.first_line = yylineno;
4626 +                       yytext[yyleng-1] = '\0';
4627 +                       DPRINT("Ref: %s\n", yytext+2);
4628 +                       yylval.labelref = strdup(yytext+2);
4629 +                       return DT_REF;
4630 +               }
4631 +       YY_BREAK
4632 +case 12:
4633 +YY_RULE_SETUP
4634 +#line 160 "dtc-lexer.l"
4635 +{      /* old-style path reference */
4636 +                       yylloc.filenum = srcpos_filenum;
4637 +                       yylloc.first_line = yylineno;
4638 +                       DPRINT("Ref: %s\n", yytext+1);
4639 +                       yylval.labelref = strdup(yytext+1);
4640 +                       return DT_REF;
4641 +               }
4642 +       YY_BREAK
4643 +case 13:
4644 +YY_RULE_SETUP
4645 +#line 168 "dtc-lexer.l"
4646 +{
4647 +                       yylloc.filenum = srcpos_filenum;
4648 +                       yylloc.first_line = yylineno;
4649 +                       yylval.byte = strtol(yytext, NULL, 16);
4650 +                       DPRINT("Byte: %02x\n", (int)yylval.byte);
4651 +                       return DT_BYTE;
4652 +               }
4653 +       YY_BREAK
4654 +case 14:
4655 +YY_RULE_SETUP
4656 +#line 176 "dtc-lexer.l"
4657 +{
4658 +                       yylloc.filenum = srcpos_filenum;
4659 +                       yylloc.first_line = yylineno;
4660 +                       DPRINT("/BYTESTRING\n");
4661 +                       BEGIN_DEFAULT();
4662 +                       return ']';
4663 +               }
4664 +       YY_BREAK
4665 +case 15:
4666 +YY_RULE_SETUP
4667 +#line 184 "dtc-lexer.l"
4668 +{
4669 +                       yylloc.filenum = srcpos_filenum;
4670 +                       yylloc.first_line = yylineno;
4671 +                       DPRINT("PropNodeName: %s\n", yytext);
4672 +                       yylval.propnodename = strdup(yytext);
4673 +                       BEGIN_DEFAULT();
4674 +                       return DT_PROPNODENAME;
4675 +               }
4676 +       YY_BREAK
4677 +case 16:
4678 +/* rule 16 can match eol */
4679 +YY_RULE_SETUP
4680 +#line 194 "dtc-lexer.l"
4681 +/* eat whitespace */
4682 +       YY_BREAK
4683 +case 17:
4684 +/* rule 17 can match eol */
4685 +YY_RULE_SETUP
4686 +#line 196 "dtc-lexer.l"
4687 +{
4688 +                       yylloc.filenum = srcpos_filenum;
4689 +                       yylloc.first_line = yylineno;
4690 +                       DPRINT("Comment: %s\n", yytext);
4691 +                       /* eat comments */
4692 +               }
4693 +       YY_BREAK
4694 +case 18:
4695 +/* rule 18 can match eol */
4696 +YY_RULE_SETUP
4697 +#line 203 "dtc-lexer.l"
4698 +/* eat line comments */
4699 +       YY_BREAK
4700 +case 19:
4701 +YY_RULE_SETUP
4702 +#line 205 "dtc-lexer.l"
4703 +{
4704 +                       yylloc.filenum = srcpos_filenum;
4705 +                       yylloc.first_line = yylineno;
4706 +                       DPRINT("Char: %c (\\x%02x)\n", yytext[0],
4707 +                               (unsigned)yytext[0]);
4708 +                       if (yytext[0] == '[') {
4709 +                               DPRINT("<BYTESTRING>\n");
4710 +                               BEGIN(BYTESTRING);
4711 +                       }
4712 +                       if ((yytext[0] == '{')
4713 +                           || (yytext[0] == ';')) {
4714 +                               DPRINT("<PROPNODENAME>\n");
4715 +                               BEGIN(PROPNODENAME);
4716 +                       }
4717 +                       return yytext[0];
4718 +               }
4719 +       YY_BREAK
4720 +case 20:
4721 +YY_RULE_SETUP
4722 +#line 222 "dtc-lexer.l"
4723 +ECHO;
4724 +       YY_BREAK
4725 +#line 1111 "dtc-lexer.lex.c"
4726 +
4727 +       case YY_END_OF_BUFFER:
4728 +               {
4729 +               /* Amount of text matched not including the EOB char. */
4730 +               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
4731 +
4732 +               /* Undo the effects of YY_DO_BEFORE_ACTION. */
4733 +               *yy_cp = (yy_hold_char);
4734 +               YY_RESTORE_YY_MORE_OFFSET
4735 +
4736 +               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
4737 +                       {
4738 +                       /* We're scanning a new file or input source.  It's
4739 +                        * possible that this happened because the user
4740 +                        * just pointed yyin at a new source and called
4741 +                        * yylex().  If so, then we have to assure
4742 +                        * consistency between YY_CURRENT_BUFFER and our
4743 +                        * globals.  Here is the right place to do so, because
4744 +                        * this is the first action (other than possibly a
4745 +                        * back-up) that will match for the new input source.
4746 +                        */
4747 +                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
4748 +                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
4749 +                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
4750 +                       }
4751 +
4752 +               /* Note that here we test for yy_c_buf_p "<=" to the position
4753 +                * of the first EOB in the buffer, since yy_c_buf_p will
4754 +                * already have been incremented past the NUL character
4755 +                * (since all states make transitions on EOB to the
4756 +                * end-of-buffer state).  Contrast this with the test
4757 +                * in input().
4758 +                */
4759 +               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
4760 +                       { /* This was really a NUL. */
4761 +                       yy_state_type yy_next_state;
4762 +
4763 +                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
4764 +
4765 +                       yy_current_state = yy_get_previous_state(  );
4766 +
4767 +                       /* Okay, we're now positioned to make the NUL
4768 +                        * transition.  We couldn't have
4769 +                        * yy_get_previous_state() go ahead and do it
4770 +                        * for us because it doesn't know how to deal
4771 +                        * with the possibility of jamming (and we don't
4772 +                        * want to build jamming into it because then it
4773 +                        * will run more slowly).
4774 +                        */
4775 +
4776 +                       yy_next_state = yy_try_NUL_trans( yy_current_state );
4777 +
4778 +                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
4779 +
4780 +                       if ( yy_next_state )
4781 +                               {
4782 +                               /* Consume the NUL. */
4783 +                               yy_cp = ++(yy_c_buf_p);
4784 +                               yy_current_state = yy_next_state;
4785 +                               goto yy_match;
4786 +                               }
4787 +
4788 +                       else
4789 +                               {
4790 +                               yy_cp = (yy_c_buf_p);
4791 +                               goto yy_find_action;
4792 +                               }
4793 +                       }
4794 +
4795 +               else switch ( yy_get_next_buffer(  ) )
4796 +                       {
4797 +                       case EOB_ACT_END_OF_FILE:
4798 +                               {
4799 +                               (yy_did_buffer_switch_on_eof) = 0;
4800 +
4801 +                               if ( yywrap( ) )
4802 +                                       {
4803 +                                       /* Note: because we've taken care in
4804 +                                        * yy_get_next_buffer() to have set up
4805 +                                        * yytext, we can now set up
4806 +                                        * yy_c_buf_p so that if some total
4807 +                                        * hoser (like flex itself) wants to
4808 +                                        * call the scanner after we return the
4809 +                                        * YY_NULL, it'll still work - another
4810 +                                        * YY_NULL will get returned.
4811 +                                        */
4812 +                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
4813 +
4814 +                                       yy_act = YY_STATE_EOF(YY_START);
4815 +                                       goto do_action;
4816 +                                       }
4817 +
4818 +                               else
4819 +                                       {
4820 +                                       if ( ! (yy_did_buffer_switch_on_eof) )
4821 +                                               YY_NEW_FILE;
4822 +                                       }
4823 +                               break;
4824 +                               }
4825 +
4826 +                       case EOB_ACT_CONTINUE_SCAN:
4827 +                               (yy_c_buf_p) =
4828 +                                       (yytext_ptr) + yy_amount_of_matched_text;
4829 +
4830 +                               yy_current_state = yy_get_previous_state(  );
4831 +
4832 +                               yy_cp = (yy_c_buf_p);
4833 +                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
4834 +                               goto yy_match;
4835 +
4836 +                       case EOB_ACT_LAST_MATCH:
4837 +                               (yy_c_buf_p) =
4838 +                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
4839 +
4840 +                               yy_current_state = yy_get_previous_state(  );
4841 +
4842 +                               yy_cp = (yy_c_buf_p);
4843 +                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
4844 +                               goto yy_find_action;
4845 +                       }
4846 +               break;
4847 +               }
4848 +
4849 +       default:
4850 +               YY_FATAL_ERROR(
4851 +                       "fatal flex scanner internal error--no action found" );
4852 +       } /* end of action switch */
4853 +               } /* end of scanning one token */
4854 +} /* end of yylex */
4855 +
4856 +/* yy_get_next_buffer - try to read in a new buffer
4857 + *
4858 + * Returns a code representing an action:
4859 + *     EOB_ACT_LAST_MATCH -
4860 + *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
4861 + *     EOB_ACT_END_OF_FILE - end of file
4862 + */
4863 +static int yy_get_next_buffer (void)
4864 +{
4865 +       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
4866 +       register char *source = (yytext_ptr);
4867 +       register int number_to_move, i;
4868 +       int ret_val;
4869 +
4870 +       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
4871 +               YY_FATAL_ERROR(
4872 +               "fatal flex scanner internal error--end of buffer missed" );
4873 +
4874 +       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
4875 +               { /* Don't try to fill the buffer, so this is an EOF. */
4876 +               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
4877 +                       {
4878 +                       /* We matched a single character, the EOB, so
4879 +                        * treat this as a final EOF.
4880 +                        */
4881 +                       return EOB_ACT_END_OF_FILE;
4882 +                       }
4883 +
4884 +               else
4885 +                       {
4886 +                       /* We matched some text prior to the EOB, first
4887 +                        * process it.
4888 +                        */
4889 +                       return EOB_ACT_LAST_MATCH;
4890 +                       }
4891 +               }
4892 +
4893 +       /* Try to read more data. */
4894 +
4895 +       /* First move last chars to start of buffer. */
4896 +       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
4897 +
4898 +       for ( i = 0; i < number_to_move; ++i )
4899 +               *(dest++) = *(source++);
4900 +
4901 +       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
4902 +               /* don't do the read, it's not guaranteed to return an EOF,
4903 +                * just force an EOF
4904 +                */
4905 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
4906 +
4907 +       else
4908 +               {
4909 +                       int num_to_read =
4910 +                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
4911 +
4912 +               while ( num_to_read <= 0 )
4913 +                       { /* Not enough room in the buffer - grow it. */
4914 +
4915 +                       /* just a shorter name for the current buffer */
4916 +                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
4917 +
4918 +                       int yy_c_buf_p_offset =
4919 +                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
4920 +
4921 +                       if ( b->yy_is_our_buffer )
4922 +                               {
4923 +                               int new_size = b->yy_buf_size * 2;
4924 +
4925 +                               if ( new_size <= 0 )
4926 +                                       b->yy_buf_size += b->yy_buf_size / 8;
4927 +                               else
4928 +                                       b->yy_buf_size *= 2;
4929 +
4930 +                               b->yy_ch_buf = (char *)
4931 +                                       /* Include room in for 2 EOB chars. */
4932 +                                       yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
4933 +                               }
4934 +                       else
4935 +                               /* Can't grow it, we don't own it. */
4936 +                               b->yy_ch_buf = 0;
4937 +
4938 +                       if ( ! b->yy_ch_buf )
4939 +                               YY_FATAL_ERROR(
4940 +                               "fatal error - scanner input buffer overflow" );
4941 +
4942 +                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
4943 +
4944 +                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
4945 +                                               number_to_move - 1;
4946 +
4947 +                       }
4948 +
4949 +               if ( num_to_read > YY_READ_BUF_SIZE )
4950 +                       num_to_read = YY_READ_BUF_SIZE;
4951 +
4952 +               /* Read in more data. */
4953 +               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
4954 +                       (yy_n_chars), (size_t) num_to_read );
4955 +
4956 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
4957 +               }
4958 +
4959 +       if ( (yy_n_chars) == 0 )
4960 +               {
4961 +               if ( number_to_move == YY_MORE_ADJ )
4962 +                       {
4963 +                       ret_val = EOB_ACT_END_OF_FILE;
4964 +                       yyrestart(yyin  );
4965 +                       }
4966 +
4967 +               else
4968 +                       {
4969 +                       ret_val = EOB_ACT_LAST_MATCH;
4970 +                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
4971 +                               YY_BUFFER_EOF_PENDING;
4972 +                       }
4973 +               }
4974 +
4975 +       else
4976 +               ret_val = EOB_ACT_CONTINUE_SCAN;
4977 +
4978 +       (yy_n_chars) += number_to_move;
4979 +       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
4980 +       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
4981 +
4982 +       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
4983 +
4984 +       return ret_val;
4985 +}
4986 +
4987 +/* yy_get_previous_state - get the state just before the EOB char was reached */
4988 +
4989 +    static yy_state_type yy_get_previous_state (void)
4990 +{
4991 +       register yy_state_type yy_current_state;
4992 +       register char *yy_cp;
4993 +    
4994 +       yy_current_state = (yy_start);
4995 +
4996 +       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
4997 +               {
4998 +               register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
4999 +               if ( yy_accept[yy_current_state] )
5000 +                       {
5001 +                       (yy_last_accepting_state) = yy_current_state;
5002 +                       (yy_last_accepting_cpos) = yy_cp;
5003 +                       }
5004 +               while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
5005 +                       {
5006 +                       yy_current_state = (int) yy_def[yy_current_state];
5007 +                       if ( yy_current_state >= 94 )
5008 +                               yy_c = yy_meta[(unsigned int) yy_c];
5009 +                       }
5010 +               yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
5011 +               }
5012 +
5013 +       return yy_current_state;
5014 +}
5015 +
5016 +/* yy_try_NUL_trans - try to make a transition on the NUL character
5017 + *
5018 + * synopsis
5019 + *     next_state = yy_try_NUL_trans( current_state );
5020 + */
5021 +    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
5022 +{
5023 +       register int yy_is_jam;
5024 +       register char *yy_cp = (yy_c_buf_p);
5025 +
5026 +       register YY_CHAR yy_c = 1;
5027 +       if ( yy_accept[yy_current_state] )
5028 +               {
5029 +               (yy_last_accepting_state) = yy_current_state;
5030 +               (yy_last_accepting_cpos) = yy_cp;
5031 +               }
5032 +       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
5033 +               {
5034 +               yy_current_state = (int) yy_def[yy_current_state];
5035 +               if ( yy_current_state >= 94 )
5036 +                       yy_c = yy_meta[(unsigned int) yy_c];
5037 +               }
5038 +       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
5039 +       yy_is_jam = (yy_current_state == 93);
5040 +
5041 +       return yy_is_jam ? 0 : yy_current_state;
5042 +}
5043 +
5044 +#ifndef YY_NO_INPUT
5045 +#ifdef __cplusplus
5046 +    static int yyinput (void)
5047 +#else
5048 +    static int input  (void)
5049 +#endif
5050 +
5051 +{
5052 +       int c;
5053 +    
5054 +       *(yy_c_buf_p) = (yy_hold_char);
5055 +
5056 +       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
5057 +               {
5058 +               /* yy_c_buf_p now points to the character we want to return.
5059 +                * If this occurs *before* the EOB characters, then it's a
5060 +                * valid NUL; if not, then we've hit the end of the buffer.
5061 +                */
5062 +               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
5063 +                       /* This was really a NUL. */
5064 +                       *(yy_c_buf_p) = '\0';
5065 +
5066 +               else
5067 +                       { /* need more input */
5068 +                       int offset = (yy_c_buf_p) - (yytext_ptr);
5069 +                       ++(yy_c_buf_p);
5070 +
5071 +                       switch ( yy_get_next_buffer(  ) )
5072 +                               {
5073 +                               case EOB_ACT_LAST_MATCH:
5074 +                                       /* This happens because yy_g_n_b()
5075 +                                        * sees that we've accumulated a
5076 +                                        * token and flags that we need to
5077 +                                        * try matching the token before
5078 +                                        * proceeding.  But for input(),
5079 +                                        * there's no matching to consider.
5080 +                                        * So convert the EOB_ACT_LAST_MATCH
5081 +                                        * to EOB_ACT_END_OF_FILE.
5082 +                                        */
5083 +
5084 +                                       /* Reset buffer status. */
5085 +                                       yyrestart(yyin );
5086 +
5087 +                                       /*FALLTHROUGH*/
5088 +
5089 +                               case EOB_ACT_END_OF_FILE:
5090 +                                       {
5091 +                                       if ( yywrap( ) )
5092 +                                               return EOF;
5093 +
5094 +                                       if ( ! (yy_did_buffer_switch_on_eof) )
5095 +                                               YY_NEW_FILE;
5096 +#ifdef __cplusplus
5097 +                                       return yyinput();
5098 +#else
5099 +                                       return input();
5100 +#endif
5101 +                                       }
5102 +
5103 +                               case EOB_ACT_CONTINUE_SCAN:
5104 +                                       (yy_c_buf_p) = (yytext_ptr) + offset;
5105 +                                       break;
5106 +                               }
5107 +                       }
5108 +               }
5109 +
5110 +       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
5111 +       *(yy_c_buf_p) = '\0';   /* preserve yytext */
5112 +       (yy_hold_char) = *++(yy_c_buf_p);
5113 +
5114 +       if ( c == '\n' )
5115 +                  
5116 +    yylineno++;
5117 +;
5118 +
5119 +       return c;
5120 +}
5121 +#endif /* ifndef YY_NO_INPUT */
5122 +
5123 +/** Immediately switch to a different input stream.
5124 + * @param input_file A readable stream.
5125 + * 
5126 + * @note This function does not reset the start condition to @c INITIAL .
5127 + */
5128 +    void yyrestart  (FILE * input_file )
5129 +{
5130 +    
5131 +       if ( ! YY_CURRENT_BUFFER ){
5132 +        yyensure_buffer_stack ();
5133 +               YY_CURRENT_BUFFER_LVALUE =
5134 +            yy_create_buffer(yyin,YY_BUF_SIZE );
5135 +       }
5136 +
5137 +       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
5138 +       yy_load_buffer_state( );
5139 +}
5140 +
5141 +/** Switch to a different input buffer.
5142 + * @param new_buffer The new input buffer.
5143 + * 
5144 + */
5145 +    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
5146 +{
5147 +    
5148 +       /* TODO. We should be able to replace this entire function body
5149 +        * with
5150 +        *              yypop_buffer_state();
5151 +        *              yypush_buffer_state(new_buffer);
5152 +     */
5153 +       yyensure_buffer_stack ();
5154 +       if ( YY_CURRENT_BUFFER == new_buffer )
5155 +               return;
5156 +
5157 +       if ( YY_CURRENT_BUFFER )
5158 +               {
5159 +               /* Flush out information for old buffer. */
5160 +               *(yy_c_buf_p) = (yy_hold_char);
5161 +               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
5162 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
5163 +               }
5164 +
5165 +       YY_CURRENT_BUFFER_LVALUE = new_buffer;
5166 +       yy_load_buffer_state( );
5167 +
5168 +       /* We don't actually know whether we did this switch during
5169 +        * EOF (yywrap()) processing, but the only time this flag
5170 +        * is looked at is after yywrap() is called, so it's safe
5171 +        * to go ahead and always set it.
5172 +        */
5173 +       (yy_did_buffer_switch_on_eof) = 1;
5174 +}
5175 +
5176 +static void yy_load_buffer_state  (void)
5177 +{
5178 +       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
5179 +       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
5180 +       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
5181 +       (yy_hold_char) = *(yy_c_buf_p);
5182 +}
5183 +
5184 +/** Allocate and initialize an input buffer state.
5185 + * @param file A readable stream.
5186 + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
5187 + * 
5188 + * @return the allocated buffer state.
5189 + */
5190 +    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
5191 +{
5192 +       YY_BUFFER_STATE b;
5193 +    
5194 +       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
5195 +       if ( ! b )
5196 +               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
5197 +
5198 +       b->yy_buf_size = size;
5199 +
5200 +       /* yy_ch_buf has to be 2 characters longer than the size given because
5201 +        * we need to put in 2 end-of-buffer characters.
5202 +        */
5203 +       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
5204 +       if ( ! b->yy_ch_buf )
5205 +               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
5206 +
5207 +       b->yy_is_our_buffer = 1;
5208 +
5209 +       yy_init_buffer(b,file );
5210 +
5211 +       return b;
5212 +}
5213 +
5214 +/** Destroy the buffer.
5215 + * @param b a buffer created with yy_create_buffer()
5216 + * 
5217 + */
5218 +    void yy_delete_buffer (YY_BUFFER_STATE  b )
5219 +{
5220 +    
5221 +       if ( ! b )
5222 +               return;
5223 +
5224 +       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
5225 +               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
5226 +
5227 +       if ( b->yy_is_our_buffer )
5228 +               yyfree((void *) b->yy_ch_buf  );
5229 +
5230 +       yyfree((void *) b  );
5231 +}
5232 +
5233 +#ifndef __cplusplus
5234 +extern int isatty (int );
5235 +#endif /* __cplusplus */
5236 +    
5237 +/* Initializes or reinitializes a buffer.
5238 + * This function is sometimes called more than once on the same buffer,
5239 + * such as during a yyrestart() or at EOF.
5240 + */
5241 +    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
5242 +
5243 +{
5244 +       int oerrno = errno;
5245 +    
5246 +       yy_flush_buffer(b );
5247 +
5248 +       b->yy_input_file = file;
5249 +       b->yy_fill_buffer = 1;
5250 +
5251 +    /* If b is the current buffer, then yy_init_buffer was _probably_
5252 +     * called from yyrestart() or through yy_get_next_buffer.
5253 +     * In that case, we don't want to reset the lineno or column.
5254 +     */
5255 +    if (b != YY_CURRENT_BUFFER){
5256 +        b->yy_bs_lineno = 1;
5257 +        b->yy_bs_column = 0;
5258 +    }
5259 +
5260 +        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
5261 +    
5262 +       errno = oerrno;
5263 +}
5264 +
5265 +/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
5266 + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
5267 + * 
5268 + */
5269 +    void yy_flush_buffer (YY_BUFFER_STATE  b )
5270 +{
5271 +       if ( ! b )
5272 +               return;
5273 +
5274 +       b->yy_n_chars = 0;
5275 +
5276 +       /* We always need two end-of-buffer characters.  The first causes
5277 +        * a transition to the end-of-buffer state.  The second causes
5278 +        * a jam in that state.
5279 +        */
5280 +       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
5281 +       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
5282 +
5283 +       b->yy_buf_pos = &b->yy_ch_buf[0];
5284 +
5285 +       b->yy_at_bol = 1;
5286 +       b->yy_buffer_status = YY_BUFFER_NEW;
5287 +
5288 +       if ( b == YY_CURRENT_BUFFER )
5289 +               yy_load_buffer_state( );
5290 +}
5291 +
5292 +/** Pushes the new state onto the stack. The new state becomes
5293 + *  the current state. This function will allocate the stack
5294 + *  if necessary.
5295 + *  @param new_buffer The new state.
5296 + *  
5297 + */
5298 +void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
5299 +{
5300 +       if (new_buffer == NULL)
5301 +               return;
5302 +
5303 +       yyensure_buffer_stack();
5304 +
5305 +       /* This block is copied from yy_switch_to_buffer. */
5306 +       if ( YY_CURRENT_BUFFER )
5307 +               {
5308 +               /* Flush out information for old buffer. */
5309 +               *(yy_c_buf_p) = (yy_hold_char);
5310 +               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
5311 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
5312 +               }
5313 +
5314 +       /* Only push if top exists. Otherwise, replace top. */
5315 +       if (YY_CURRENT_BUFFER)
5316 +               (yy_buffer_stack_top)++;
5317 +       YY_CURRENT_BUFFER_LVALUE = new_buffer;
5318 +
5319 +       /* copied from yy_switch_to_buffer. */
5320 +       yy_load_buffer_state( );
5321 +       (yy_did_buffer_switch_on_eof) = 1;
5322 +}
5323 +
5324 +/** Removes and deletes the top of the stack, if present.
5325 + *  The next element becomes the new top.
5326 + *  
5327 + */
5328 +void yypop_buffer_state (void)
5329 +{
5330 +       if (!YY_CURRENT_BUFFER)
5331 +               return;
5332 +
5333 +       yy_delete_buffer(YY_CURRENT_BUFFER );
5334 +       YY_CURRENT_BUFFER_LVALUE = NULL;
5335 +       if ((yy_buffer_stack_top) > 0)
5336 +               --(yy_buffer_stack_top);
5337 +
5338 +       if (YY_CURRENT_BUFFER) {
5339 +               yy_load_buffer_state( );
5340 +               (yy_did_buffer_switch_on_eof) = 1;
5341 +       }
5342 +}
5343 +
5344 +/* Allocates the stack if it does not exist.
5345 + *  Guarantees space for at least one push.
5346 + */
5347 +static void yyensure_buffer_stack (void)
5348 +{
5349 +       int num_to_alloc;
5350 +    
5351 +       if (!(yy_buffer_stack)) {
5352 +
5353 +               /* First allocation is just for 2 elements, since we don't know if this
5354 +                * scanner will even need a stack. We use 2 instead of 1 to avoid an
5355 +                * immediate realloc on the next call.
5356 +         */
5357 +               num_to_alloc = 1;
5358 +               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
5359 +                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
5360 +                                                               );
5361 +               
5362 +               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
5363 +                               
5364 +               (yy_buffer_stack_max) = num_to_alloc;
5365 +               (yy_buffer_stack_top) = 0;
5366 +               return;
5367 +       }
5368 +
5369 +       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
5370 +
5371 +               /* Increase the buffer to prepare for a possible push. */
5372 +               int grow_size = 8 /* arbitrary grow size */;
5373 +
5374 +               num_to_alloc = (yy_buffer_stack_max) + grow_size;
5375 +               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
5376 +                                                               ((yy_buffer_stack),
5377 +                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
5378 +                                                               );
5379 +
5380 +               /* zero only the new slots.*/
5381 +               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
5382 +               (yy_buffer_stack_max) = num_to_alloc;
5383 +       }
5384 +}
5385 +
5386 +/** Setup the input buffer state to scan directly from a user-specified character buffer.
5387 + * @param base the character buffer
5388 + * @param size the size in bytes of the character buffer
5389 + * 
5390 + * @return the newly allocated buffer state object. 
5391 + */
5392 +YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
5393 +{
5394 +       YY_BUFFER_STATE b;
5395 +    
5396 +       if ( size < 2 ||
5397 +            base[size-2] != YY_END_OF_BUFFER_CHAR ||
5398 +            base[size-1] != YY_END_OF_BUFFER_CHAR )
5399 +               /* They forgot to leave room for the EOB's. */
5400 +               return 0;
5401 +
5402 +       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
5403 +       if ( ! b )
5404 +               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
5405 +
5406 +       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
5407 +       b->yy_buf_pos = b->yy_ch_buf = base;
5408 +       b->yy_is_our_buffer = 0;
5409 +       b->yy_input_file = 0;
5410 +       b->yy_n_chars = b->yy_buf_size;
5411 +       b->yy_is_interactive = 0;
5412 +       b->yy_at_bol = 1;
5413 +       b->yy_fill_buffer = 0;
5414 +       b->yy_buffer_status = YY_BUFFER_NEW;
5415 +
5416 +       yy_switch_to_buffer(b  );
5417 +
5418 +       return b;
5419 +}
5420 +
5421 +/** Setup the input buffer state to scan a string. The next call to yylex() will
5422 + * scan from a @e copy of @a str.
5423 + * @param yystr a NUL-terminated string to scan
5424 + * 
5425 + * @return the newly allocated buffer state object.
5426 + * @note If you want to scan bytes that may contain NUL values, then use
5427 + *       yy_scan_bytes() instead.
5428 + */
5429 +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
5430 +{
5431 +    
5432 +       return yy_scan_bytes(yystr,strlen(yystr) );
5433 +}
5434 +
5435 +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
5436 + * scan from a @e copy of @a bytes.
5437 + * @param bytes the byte buffer to scan
5438 + * @param len the number of bytes in the buffer pointed to by @a bytes.
5439 + * 
5440 + * @return the newly allocated buffer state object.
5441 + */
5442 +YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
5443 +{
5444 +       YY_BUFFER_STATE b;
5445 +       char *buf;
5446 +       yy_size_t n;
5447 +       int i;
5448 +    
5449 +       /* Get memory for full buffer, including space for trailing EOB's. */
5450 +       n = _yybytes_len + 2;
5451 +       buf = (char *) yyalloc(n  );
5452 +       if ( ! buf )
5453 +               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
5454 +
5455 +       for ( i = 0; i < _yybytes_len; ++i )
5456 +               buf[i] = yybytes[i];
5457 +
5458 +       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
5459 +
5460 +       b = yy_scan_buffer(buf,n );
5461 +       if ( ! b )
5462 +               YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
5463 +
5464 +       /* It's okay to grow etc. this buffer, and we should throw it
5465 +        * away when we're done.
5466 +        */
5467 +       b->yy_is_our_buffer = 1;
5468 +
5469 +       return b;
5470 +}
5471 +
5472 +#ifndef YY_EXIT_FAILURE
5473 +#define YY_EXIT_FAILURE 2
5474 +#endif
5475 +
5476 +static void yy_fatal_error (yyconst char* msg )
5477 +{
5478 +       (void) fprintf( stderr, "%s\n", msg );
5479 +       exit( YY_EXIT_FAILURE );
5480 +}
5481 +
5482 +/* Redefine yyless() so it works in section 3 code. */
5483 +
5484 +#undef yyless
5485 +#define yyless(n) \
5486 +       do \
5487 +               { \
5488 +               /* Undo effects of setting up yytext. */ \
5489 +        int yyless_macro_arg = (n); \
5490 +        YY_LESS_LINENO(yyless_macro_arg);\
5491 +               yytext[yyleng] = (yy_hold_char); \
5492 +               (yy_c_buf_p) = yytext + yyless_macro_arg; \
5493 +               (yy_hold_char) = *(yy_c_buf_p); \
5494 +               *(yy_c_buf_p) = '\0'; \
5495 +               yyleng = yyless_macro_arg; \
5496 +               } \
5497 +       while ( 0 )
5498 +
5499 +/* Accessor  methods (get/set functions) to struct members. */
5500 +
5501 +/** Get the current line number.
5502 + * 
5503 + */
5504 +int yyget_lineno  (void)
5505 +{
5506 +        
5507 +    return yylineno;
5508 +}
5509 +
5510 +/** Get the input stream.
5511 + * 
5512 + */
5513 +FILE *yyget_in  (void)
5514 +{
5515 +        return yyin;
5516 +}
5517 +
5518 +/** Get the output stream.
5519 + * 
5520 + */
5521 +FILE *yyget_out  (void)
5522 +{
5523 +        return yyout;
5524 +}
5525 +
5526 +/** Get the length of the current token.
5527 + * 
5528 + */
5529 +int yyget_leng  (void)
5530 +{
5531 +        return yyleng;
5532 +}
5533 +
5534 +/** Get the current token.
5535 + * 
5536 + */
5537 +
5538 +char *yyget_text  (void)
5539 +{
5540 +        return yytext;
5541 +}
5542 +
5543 +/** Set the current line number.
5544 + * @param line_number
5545 + * 
5546 + */
5547 +void yyset_lineno (int  line_number )
5548 +{
5549 +    
5550 +    yylineno = line_number;
5551 +}
5552 +
5553 +/** Set the input stream. This does not discard the current
5554 + * input buffer.
5555 + * @param in_str A readable stream.
5556 + * 
5557 + * @see yy_switch_to_buffer
5558 + */
5559 +void yyset_in (FILE *  in_str )
5560 +{
5561 +        yyin = in_str ;
5562 +}
5563 +
5564 +void yyset_out (FILE *  out_str )
5565 +{
5566 +        yyout = out_str ;
5567 +}
5568 +
5569 +int yyget_debug  (void)
5570 +{
5571 +        return yy_flex_debug;
5572 +}
5573 +
5574 +void yyset_debug (int  bdebug )
5575 +{
5576 +        yy_flex_debug = bdebug ;
5577 +}
5578 +
5579 +static int yy_init_globals (void)
5580 +{
5581 +        /* Initialization is the same as for the non-reentrant scanner.
5582 +     * This function is called from yylex_destroy(), so don't allocate here.
5583 +     */
5584 +
5585 +    /* We do not touch yylineno unless the option is enabled. */
5586 +    yylineno =  1;
5587 +    
5588 +    (yy_buffer_stack) = 0;
5589 +    (yy_buffer_stack_top) = 0;
5590 +    (yy_buffer_stack_max) = 0;
5591 +    (yy_c_buf_p) = (char *) 0;
5592 +    (yy_init) = 0;
5593 +    (yy_start) = 0;
5594 +
5595 +/* Defined in main.c */
5596 +#ifdef YY_STDINIT
5597 +    yyin = stdin;
5598 +    yyout = stdout;
5599 +#else
5600 +    yyin = (FILE *) 0;
5601 +    yyout = (FILE *) 0;
5602 +#endif
5603 +
5604 +    /* For future reference: Set errno on error, since we are called by
5605 +     * yylex_init()
5606 +     */
5607 +    return 0;
5608 +}
5609 +
5610 +/* yylex_destroy is for both reentrant and non-reentrant scanners. */
5611 +int yylex_destroy  (void)
5612 +{
5613 +    
5614 +    /* Pop the buffer stack, destroying each element. */
5615 +       while(YY_CURRENT_BUFFER){
5616 +               yy_delete_buffer(YY_CURRENT_BUFFER  );
5617 +               YY_CURRENT_BUFFER_LVALUE = NULL;
5618 +               yypop_buffer_state();
5619 +       }
5620 +
5621 +       /* Destroy the stack itself. */
5622 +       yyfree((yy_buffer_stack) );
5623 +       (yy_buffer_stack) = NULL;
5624 +
5625 +    /* Reset the globals. This is important in a non-reentrant scanner so the next time
5626 +     * yylex() is called, initialization will occur. */
5627 +    yy_init_globals( );
5628 +
5629 +    return 0;
5630 +}
5631 +
5632 +/*
5633 + * Internal utility routines.
5634 + */
5635 +
5636 +#ifndef yytext_ptr
5637 +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
5638 +{
5639 +       register int i;
5640 +       for ( i = 0; i < n; ++i )
5641 +               s1[i] = s2[i];
5642 +}
5643 +#endif
5644 +
5645 +#ifdef YY_NEED_STRLEN
5646 +static int yy_flex_strlen (yyconst char * s )
5647 +{
5648 +       register int n;
5649 +       for ( n = 0; s[n]; ++n )
5650 +               ;
5651 +
5652 +       return n;
5653 +}
5654 +#endif
5655 +
5656 +void *yyalloc (yy_size_t  size )
5657 +{
5658 +       return (void *) malloc( size );
5659 +}
5660 +
5661 +void *yyrealloc  (void * ptr, yy_size_t  size )
5662 +{
5663 +       /* The cast to (char *) in the following accommodates both
5664 +        * implementations that use char* generic pointers, and those
5665 +        * that use void* generic pointers.  It works with the latter
5666 +        * because both ANSI C and C++ allow castless assignment from
5667 +        * any pointer type to void*, and deal with argument conversions
5668 +        * as though doing an assignment.
5669 +        */
5670 +       return (void *) realloc( (char *) ptr, size );
5671 +}
5672 +
5673 +void yyfree (void * ptr )
5674 +{
5675 +       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
5676 +}
5677 +
5678 +#define YYTABLES_NAME "yytables"
5679 +
5680 +#line 222 "dtc-lexer.l"
5681 +
5682 +
5683 +
5684 +
5685 +/*
5686 + * Stack of nested include file contexts.
5687 + */
5688 +
5689 +struct incl_file {
5690 +       int filenum;
5691 +       FILE *file;
5692 +       YY_BUFFER_STATE yy_prev_buf;
5693 +       int yy_prev_lineno;
5694 +       struct incl_file *prev;
5695 +};
5696 +
5697 +struct incl_file *incl_file_stack;
5698 +
5699 +
5700 +/*
5701 + * Detect infinite include recursion.
5702 + */
5703 +#define MAX_INCLUDE_DEPTH      (100)
5704 +
5705 +static int incl_depth = 0;
5706 +
5707 +
5708 +int push_input_file(const char *filename)
5709 +{
5710 +       FILE *f;
5711 +       struct incl_file *incl_file;
5712 +
5713 +       if (!filename) {
5714 +               yyerror("No include file name given.");
5715 +               return 0;
5716 +       }
5717 +
5718 +       if (incl_depth++ >= MAX_INCLUDE_DEPTH) {
5719 +               yyerror("Includes nested too deeply");
5720 +               return 0;
5721 +       }
5722 +
5723 +       f = dtc_open_file(filename);
5724 +
5725 +       incl_file = malloc(sizeof(struct incl_file));
5726 +       if (!incl_file) {
5727 +               yyerror("Can not allocate include file space.");
5728 +               return 0;
5729 +       }
5730 +
5731 +       /*
5732 +        * Save current context.
5733 +        */
5734 +       incl_file->yy_prev_buf = YY_CURRENT_BUFFER;
5735 +       incl_file->yy_prev_lineno = yylineno;
5736 +       incl_file->filenum = srcpos_filenum;
5737 +       incl_file->file = yyin;
5738 +       incl_file->prev = incl_file_stack;
5739 +
5740 +       incl_file_stack = incl_file;
5741 +
5742 +       /*
5743 +        * Establish new context.
5744 +        */
5745 +       srcpos_filenum = lookup_file_name(filename, 0);
5746 +       yylineno = 1;
5747 +       yyin = f;
5748 +       yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
5749 +
5750 +       return 1;
5751 +}
5752 +
5753 +
5754 +int pop_input_file(void)
5755 +{
5756 +       struct incl_file *incl_file;
5757 +
5758 +       if (incl_file_stack == 0)
5759 +               return 0;
5760 +
5761 +       fclose(yyin);
5762 +
5763 +       /*
5764 +        * Pop.
5765 +        */
5766 +       --incl_depth;
5767 +       incl_file = incl_file_stack;
5768 +       incl_file_stack = incl_file->prev;
5769 +
5770 +       /*
5771 +        * Recover old context.
5772 +        */
5773 +       yy_delete_buffer(YY_CURRENT_BUFFER);
5774 +       yy_switch_to_buffer(incl_file->yy_prev_buf);
5775 +       yylineno = incl_file->yy_prev_lineno;
5776 +       srcpos_filenum = incl_file->filenum;
5777 +       yyin = incl_file->file;
5778 +
5779 +       /*
5780 +        * Free old state.
5781 +        */
5782 +       free(incl_file);
5783 +
5784 +       if (YY_CURRENT_BUFFER == 0)
5785 +               return 0;
5786 +
5787 +       return 1;
5788 +}
5789 +
5790 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped
5791 ===================================================================
5792 --- /dev/null
5793 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped
5794 @@ -0,0 +1,1983 @@
5795 +/* A Bison parser, made by GNU Bison 2.3.  */
5796 +
5797 +/* Skeleton implementation for Bison's Yacc-like parsers in C
5798 +
5799 +   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
5800 +   Free Software Foundation, Inc.
5801 +
5802 +   This program is free software; you can redistribute it and/or modify
5803 +   it under the terms of the GNU General Public License as published by
5804 +   the Free Software Foundation; either version 2, or (at your option)
5805 +   any later version.
5806 +
5807 +   This program is distributed in the hope that it will be useful,
5808 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
5809 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5810 +   GNU General Public License for more details.
5811 +
5812 +   You should have received a copy of the GNU General Public License
5813 +   along with this program; if not, write to the Free Software
5814 +   Foundation, Inc., 51 Franklin Street, Fifth Floor,
5815 +   Boston, MA 02110-1301, USA.  */
5816 +
5817 +/* As a special exception, you may create a larger work that contains
5818 +   part or all of the Bison parser skeleton and distribute that work
5819 +   under terms of your choice, so long as that work isn't itself a
5820 +   parser generator using the skeleton or a modified version thereof
5821 +   as a parser skeleton.  Alternatively, if you modify or redistribute
5822 +   the parser skeleton itself, you may (at your option) remove this
5823 +   special exception, which will cause the skeleton and the resulting
5824 +   Bison output files to be licensed under the GNU General Public
5825 +   License without this special exception.
5826 +
5827 +   This special exception was added by the Free Software Foundation in
5828 +   version 2.2 of Bison.  */
5829 +
5830 +/* C LALR(1) parser skeleton written by Richard Stallman, by
5831 +   simplifying the original so-called "semantic" parser.  */
5832 +
5833 +/* All symbols defined below should begin with yy or YY, to avoid
5834 +   infringing on user name space.  This should be done even for local
5835 +   variables, as they might otherwise be expanded by user macros.
5836 +   There are some unavoidable exceptions within include files to
5837 +   define necessary library symbols; they are noted "INFRINGES ON
5838 +   USER NAME SPACE" below.  */
5839 +
5840 +/* Identify Bison output.  */
5841 +#define YYBISON 1
5842 +
5843 +/* Bison version.  */
5844 +#define YYBISON_VERSION "2.3"
5845 +
5846 +/* Skeleton name.  */
5847 +#define YYSKELETON_NAME "yacc.c"
5848 +
5849 +/* Pure parsers.  */
5850 +#define YYPURE 0
5851 +
5852 +/* Using locations.  */
5853 +#define YYLSP_NEEDED 1
5854 +
5855 +
5856 +
5857 +/* Tokens.  */
5858 +#ifndef YYTOKENTYPE
5859 +# define YYTOKENTYPE
5860 +   /* Put the tokens into the symbol table, so that GDB and other debuggers
5861 +      know about them.  */
5862 +   enum yytokentype {
5863 +     DT_V1 = 258,
5864 +     DT_MEMRESERVE = 259,
5865 +     DT_PROPNODENAME = 260,
5866 +     DT_LITERAL = 261,
5867 +     DT_LEGACYLITERAL = 262,
5868 +     DT_BASE = 263,
5869 +     DT_BYTE = 264,
5870 +     DT_STRING = 265,
5871 +     DT_LABEL = 266,
5872 +     DT_REF = 267
5873 +   };
5874 +#endif
5875 +/* Tokens.  */
5876 +#define DT_V1 258
5877 +#define DT_MEMRESERVE 259
5878 +#define DT_PROPNODENAME 260
5879 +#define DT_LITERAL 261
5880 +#define DT_LEGACYLITERAL 262
5881 +#define DT_BASE 263
5882 +#define DT_BYTE 264
5883 +#define DT_STRING 265
5884 +#define DT_LABEL 266
5885 +#define DT_REF 267
5886 +
5887 +
5888 +
5889 +
5890 +/* Copy the first part of user declarations.  */
5891 +#line 23 "dtc-parser.y"
5892 +
5893 +#include "dtc.h"
5894 +#include "srcpos.h"
5895 +
5896 +int yylex(void);
5897 +unsigned long long eval_literal(const char *s, int base, int bits);
5898 +
5899 +extern struct boot_info *the_boot_info;
5900 +
5901 +
5902 +
5903 +/* Enabling traces.  */
5904 +#ifndef YYDEBUG
5905 +# define YYDEBUG 0
5906 +#endif
5907 +
5908 +/* Enabling verbose error messages.  */
5909 +#ifdef YYERROR_VERBOSE
5910 +# undef YYERROR_VERBOSE
5911 +# define YYERROR_VERBOSE 1
5912 +#else
5913 +# define YYERROR_VERBOSE 0
5914 +#endif
5915 +
5916 +/* Enabling the token table.  */
5917 +#ifndef YYTOKEN_TABLE
5918 +# define YYTOKEN_TABLE 0
5919 +#endif
5920 +
5921 +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
5922 +typedef union YYSTYPE
5923 +#line 34 "dtc-parser.y"
5924 +{
5925 +       char *propnodename;
5926 +       char *literal;
5927 +       char *labelref;
5928 +       unsigned int cbase;
5929 +       u8 byte;
5930 +       struct data data;
5931 +
5932 +       u64 addr;
5933 +       cell_t cell;
5934 +       struct property *prop;
5935 +       struct property *proplist;
5936 +       struct node *node;
5937 +       struct node *nodelist;
5938 +       struct reserve_info *re;
5939 +}
5940 +/* Line 187 of yacc.c.  */
5941 +#line 148 "dtc-parser.tab.c"
5942 +       YYSTYPE;
5943 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */
5944 +# define YYSTYPE_IS_DECLARED 1
5945 +# define YYSTYPE_IS_TRIVIAL 1
5946 +#endif
5947 +
5948 +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
5949 +typedef struct YYLTYPE
5950 +{
5951 +  int first_line;
5952 +  int first_column;
5953 +  int last_line;
5954 +  int last_column;
5955 +} YYLTYPE;
5956 +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
5957 +# define YYLTYPE_IS_DECLARED 1
5958 +# define YYLTYPE_IS_TRIVIAL 1
5959 +#endif
5960 +
5961 +
5962 +/* Copy the second part of user declarations.  */
5963 +
5964 +
5965 +/* Line 216 of yacc.c.  */
5966 +#line 173 "dtc-parser.tab.c"
5967 +
5968 +#ifdef short
5969 +# undef short
5970 +#endif
5971 +
5972 +#ifdef YYTYPE_UINT8
5973 +typedef YYTYPE_UINT8 yytype_uint8;
5974 +#else
5975 +typedef unsigned char yytype_uint8;
5976 +#endif
5977 +
5978 +#ifdef YYTYPE_INT8
5979 +typedef YYTYPE_INT8 yytype_int8;
5980 +#elif (defined __STDC__ || defined __C99__FUNC__ \
5981 +     || defined __cplusplus || defined _MSC_VER)
5982 +typedef signed char yytype_int8;
5983 +#else
5984 +typedef short int yytype_int8;
5985 +#endif
5986 +
5987 +#ifdef YYTYPE_UINT16
5988 +typedef YYTYPE_UINT16 yytype_uint16;
5989 +#else
5990 +typedef unsigned short int yytype_uint16;
5991 +#endif
5992 +
5993 +#ifdef YYTYPE_INT16
5994 +typedef YYTYPE_INT16 yytype_int16;
5995 +#else
5996 +typedef short int yytype_int16;
5997 +#endif
5998 +
5999 +#ifndef YYSIZE_T
6000 +# ifdef __SIZE_TYPE__
6001 +#  define YYSIZE_T __SIZE_TYPE__
6002 +# elif defined size_t
6003 +#  define YYSIZE_T size_t
6004 +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
6005 +     || defined __cplusplus || defined _MSC_VER)
6006 +#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
6007 +#  define YYSIZE_T size_t
6008 +# else
6009 +#  define YYSIZE_T unsigned int
6010 +# endif
6011 +#endif
6012 +
6013 +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
6014 +
6015 +#ifndef YY_
6016 +# if YYENABLE_NLS
6017 +#  if ENABLE_NLS
6018 +#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
6019 +#   define YY_(msgid) dgettext ("bison-runtime", msgid)
6020 +#  endif
6021 +# endif
6022 +# ifndef YY_
6023 +#  define YY_(msgid) msgid
6024 +# endif
6025 +#endif
6026 +
6027 +/* Suppress unused-variable warnings by "using" E.  */
6028 +#if ! defined lint || defined __GNUC__
6029 +# define YYUSE(e) ((void) (e))
6030 +#else
6031 +# define YYUSE(e) /* empty */
6032 +#endif
6033 +
6034 +/* Identity function, used to suppress warnings about constant conditions.  */
6035 +#ifndef lint
6036 +# define YYID(n) (n)
6037 +#else
6038 +#if (defined __STDC__ || defined __C99__FUNC__ \
6039 +     || defined __cplusplus || defined _MSC_VER)
6040 +static int
6041 +YYID (int i)
6042 +#else
6043 +static int
6044 +YYID (i)
6045 +    int i;
6046 +#endif
6047 +{
6048 +  return i;
6049 +}
6050 +#endif
6051 +
6052 +#if ! defined yyoverflow || YYERROR_VERBOSE
6053 +
6054 +/* The parser invokes alloca or malloc; define the necessary symbols.  */
6055 +
6056 +# ifdef YYSTACK_USE_ALLOCA
6057 +#  if YYSTACK_USE_ALLOCA
6058 +#   ifdef __GNUC__
6059 +#    define YYSTACK_ALLOC __builtin_alloca
6060 +#   elif defined __BUILTIN_VA_ARG_INCR
6061 +#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
6062 +#   elif defined _AIX
6063 +#    define YYSTACK_ALLOC __alloca
6064 +#   elif defined _MSC_VER
6065 +#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
6066 +#    define alloca _alloca
6067 +#   else
6068 +#    define YYSTACK_ALLOC alloca
6069 +#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
6070 +     || defined __cplusplus || defined _MSC_VER)
6071 +#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
6072 +#     ifndef _STDLIB_H
6073 +#      define _STDLIB_H 1
6074 +#     endif
6075 +#    endif
6076 +#   endif
6077 +#  endif
6078 +# endif
6079 +
6080 +# ifdef YYSTACK_ALLOC
6081 +   /* Pacify GCC's `empty if-body' warning.  */
6082 +#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
6083 +#  ifndef YYSTACK_ALLOC_MAXIMUM
6084 +    /* The OS might guarantee only one guard page at the bottom of the stack,
6085 +       and a page size can be as small as 4096 bytes.  So we cannot safely
6086 +       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
6087 +       to allow for a few compiler-allocated temporary stack slots.  */
6088 +#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
6089 +#  endif
6090 +# else
6091 +#  define YYSTACK_ALLOC YYMALLOC
6092 +#  define YYSTACK_FREE YYFREE
6093 +#  ifndef YYSTACK_ALLOC_MAXIMUM
6094 +#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
6095 +#  endif
6096 +#  if (defined __cplusplus && ! defined _STDLIB_H \
6097 +       && ! ((defined YYMALLOC || defined malloc) \
6098 +            && (defined YYFREE || defined free)))
6099 +#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
6100 +#   ifndef _STDLIB_H
6101 +#    define _STDLIB_H 1
6102 +#   endif
6103 +#  endif
6104 +#  ifndef YYMALLOC
6105 +#   define YYMALLOC malloc
6106 +#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
6107 +     || defined __cplusplus || defined _MSC_VER)
6108 +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
6109 +#   endif
6110 +#  endif
6111 +#  ifndef YYFREE
6112 +#   define YYFREE free
6113 +#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
6114 +     || defined __cplusplus || defined _MSC_VER)
6115 +void free (void *); /* INFRINGES ON USER NAME SPACE */
6116 +#   endif
6117 +#  endif
6118 +# endif
6119 +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
6120 +
6121 +
6122 +#if (! defined yyoverflow \
6123 +     && (! defined __cplusplus \
6124 +        || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
6125 +            && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
6126 +
6127 +/* A type that is properly aligned for any stack member.  */
6128 +union yyalloc
6129 +{
6130 +  yytype_int16 yyss;
6131 +  YYSTYPE yyvs;
6132 +    YYLTYPE yyls;
6133 +};
6134 +
6135 +/* The size of the maximum gap between one aligned stack and the next.  */
6136 +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
6137 +
6138 +/* The size of an array large to enough to hold all stacks, each with
6139 +   N elements.  */
6140 +# define YYSTACK_BYTES(N) \
6141 +     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
6142 +      + 2 * YYSTACK_GAP_MAXIMUM)
6143 +
6144 +/* Copy COUNT objects from FROM to TO.  The source and destination do
6145 +   not overlap.  */
6146 +# ifndef YYCOPY
6147 +#  if defined __GNUC__ && 1 < __GNUC__
6148 +#   define YYCOPY(To, From, Count) \
6149 +      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
6150 +#  else
6151 +#   define YYCOPY(To, From, Count)             \
6152 +      do                                       \
6153 +       {                                       \
6154 +         YYSIZE_T yyi;                         \
6155 +         for (yyi = 0; yyi < (Count); yyi++)   \
6156 +           (To)[yyi] = (From)[yyi];            \
6157 +       }                                       \
6158 +      while (YYID (0))
6159 +#  endif
6160 +# endif
6161 +
6162 +/* Relocate STACK from its old location to the new one.  The
6163 +   local variables YYSIZE and YYSTACKSIZE give the old and new number of
6164 +   elements in the stack, and YYPTR gives the new location of the
6165 +   stack.  Advance YYPTR to a properly aligned location for the next
6166 +   stack.  */
6167 +# define YYSTACK_RELOCATE(Stack)                                       \
6168 +    do                                                                 \
6169 +      {                                                                        \
6170 +       YYSIZE_T yynewbytes;                                            \
6171 +       YYCOPY (&yyptr->Stack, Stack, yysize);                          \
6172 +       Stack = &yyptr->Stack;                                          \
6173 +       yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
6174 +       yyptr += yynewbytes / sizeof (*yyptr);                          \
6175 +      }                                                                        \
6176 +    while (YYID (0))
6177 +
6178 +#endif
6179 +
6180 +/* YYFINAL -- State number of the termination state.  */
6181 +#define YYFINAL  9
6182 +/* YYLAST -- Last index in YYTABLE.  */
6183 +#define YYLAST   60
6184 +
6185 +/* YYNTOKENS -- Number of terminals.  */
6186 +#define YYNTOKENS  24
6187 +/* YYNNTS -- Number of nonterminals.  */
6188 +#define YYNNTS  20
6189 +/* YYNRULES -- Number of rules.  */
6190 +#define YYNRULES  43
6191 +/* YYNRULES -- Number of states.  */
6192 +#define YYNSTATES  67
6193 +
6194 +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
6195 +#define YYUNDEFTOK  2
6196 +#define YYMAXUTOK   267
6197 +
6198 +#define YYTRANSLATE(YYX)                                               \
6199 +  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
6200 +
6201 +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
6202 +static const yytype_uint8 yytranslate[] =
6203 +{
6204 +       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6205 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6206 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6207 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6208 +       2,     2,     2,     2,    23,    14,     2,    15,     2,     2,
6209 +       2,     2,     2,     2,     2,     2,     2,     2,     2,    13,
6210 +      19,    18,    20,     2,     2,     2,     2,     2,     2,     2,
6211 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6212 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6213 +       2,    21,     2,    22,     2,     2,     2,     2,     2,     2,
6214 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6215 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6216 +       2,     2,     2,    16,     2,    17,     2,     2,     2,     2,
6217 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6218 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6219 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6220 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6221 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6222 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6223 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6224 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6225 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6226 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6227 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6228 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6229 +       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
6230 +       5,     6,     7,     8,     9,    10,    11,    12
6231 +};
6232 +
6233 +#if YYDEBUG
6234 +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
6235 +   YYRHS.  */
6236 +static const yytype_uint8 yyprhs[] =
6237 +{
6238 +       0,     0,     3,     8,    11,    12,    15,    21,    22,    25,
6239 +      27,    34,    36,    38,    41,    47,    48,    51,    57,    61,
6240 +      64,    69,    74,    77,    80,    81,    84,    87,    88,    91,
6241 +      94,    97,    98,   100,   102,   105,   106,   109,   112,   113,
6242 +     116,   119,   123,   124
6243 +};
6244 +
6245 +/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
6246 +static const yytype_int8 yyrhs[] =
6247 +{
6248 +      25,     0,    -1,     3,    13,    26,    31,    -1,    28,    31,
6249 +      -1,    -1,    27,    26,    -1,    43,     4,    30,    30,    13,
6250 +      -1,    -1,    29,    28,    -1,    27,    -1,    43,     4,    30,
6251 +      14,    30,    13,    -1,     6,    -1,     7,    -1,    15,    32,
6252 +      -1,    16,    33,    41,    17,    13,    -1,    -1,    33,    34,
6253 +      -1,    43,     5,    18,    35,    13,    -1,    43,     5,    13,
6254 +      -1,    36,    10,    -1,    36,    19,    37,    20,    -1,    36,
6255 +      21,    40,    22,    -1,    36,    12,    -1,    35,    11,    -1,
6256 +      -1,    35,    23,    -1,    36,    11,    -1,    -1,    37,    39,
6257 +      -1,    37,    12,    -1,    37,    11,    -1,    -1,     8,    -1,
6258 +       6,    -1,    38,     7,    -1,    -1,    40,     9,    -1,    40,
6259 +      11,    -1,    -1,    42,    41,    -1,    42,    34,    -1,    43,
6260 +       5,    32,    -1,    -1,    11,    -1
6261 +};
6262 +
6263 +/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
6264 +static const yytype_uint16 yyrline[] =
6265 +{
6266 +       0,    85,    85,    89,    97,   100,   107,   115,   118,   125,
6267 +     129,   136,   140,   147,   154,   162,   165,   172,   176,   183,
6268 +     187,   191,   195,   199,   207,   210,   214,   222,   225,   229,
6269 +     234,   242,   245,   249,   253,   261,   264,   268,   276,   279,
6270 +     283,   291,   299,   302
6271 +};
6272 +#endif
6273 +
6274 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
6275 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
6276 +   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
6277 +static const char *const yytname[] =
6278 +{
6279 +  "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE",
6280 +  "DT_PROPNODENAME", "DT_LITERAL", "DT_LEGACYLITERAL", "DT_BASE",
6281 +  "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF", "';'", "'-'", "'/'", "'{'",
6282 +  "'}'", "'='", "'<'", "'>'", "'['", "']'", "','", "$accept", "sourcefile",
6283 +  "memreserves", "memreserve", "v0_memreserves", "v0_memreserve", "addr",
6284 +  "devicetree", "nodedef", "proplist", "propdef", "propdata",
6285 +  "propdataprefix", "celllist", "cellbase", "cellval", "bytestring",
6286 +  "subnodes", "subnode", "label", 0
6287 +};
6288 +#endif
6289 +
6290 +# ifdef YYPRINT
6291 +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
6292 +   token YYLEX-NUM.  */
6293 +static const yytype_uint16 yytoknum[] =
6294 +{
6295 +       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
6296 +     265,   266,   267,    59,    45,    47,   123,   125,    61,    60,
6297 +      62,    91,    93,    44
6298 +};
6299 +# endif
6300 +
6301 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
6302 +static const yytype_uint8 yyr1[] =
6303 +{
6304 +       0,    24,    25,    25,    26,    26,    27,    28,    28,    29,
6305 +      29,    30,    30,    31,    32,    33,    33,    34,    34,    35,
6306 +      35,    35,    35,    35,    36,    36,    36,    37,    37,    37,
6307 +      37,    38,    38,    39,    39,    40,    40,    40,    41,    41,
6308 +      41,    42,    43,    43
6309 +};
6310 +
6311 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
6312 +static const yytype_uint8 yyr2[] =
6313 +{
6314 +       0,     2,     4,     2,     0,     2,     5,     0,     2,     1,
6315 +       6,     1,     1,     2,     5,     0,     2,     5,     3,     2,
6316 +       4,     4,     2,     2,     0,     2,     2,     0,     2,     2,
6317 +       2,     0,     1,     1,     2,     0,     2,     2,     0,     2,
6318 +       2,     3,     0,     1
6319 +};
6320 +
6321 +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
6322 +   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
6323 +   means the default is an error.  */
6324 +static const yytype_uint8 yydefact[] =
6325 +{
6326 +       7,     0,    43,     0,     9,     0,     7,     0,     4,     1,
6327 +       0,     3,     8,     0,     0,     4,     0,    15,    13,    11,
6328 +      12,     0,     2,     5,     0,    38,     0,     0,     0,    16,
6329 +       0,    38,     0,     0,     6,     0,    40,    39,     0,    10,
6330 +      14,    18,    24,    41,     0,     0,    23,    17,    25,    19,
6331 +      26,    22,    27,    35,    31,     0,    33,    32,    30,    29,
6332 +      20,     0,    28,    36,    37,    21,    34
6333 +};
6334 +
6335 +/* YYDEFGOTO[NTERM-NUM].  */
6336 +static const yytype_int8 yydefgoto[] =
6337 +{
6338 +      -1,     3,    14,     4,     5,     6,    27,    11,    18,    25,
6339 +      29,    44,    45,    54,    61,    62,    55,    30,    31,     7
6340 +};
6341 +
6342 +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
6343 +   STATE-NUM.  */
6344 +#define YYPACT_NINF -13
6345 +static const yytype_int8 yypact[] =
6346 +{
6347 +      23,    11,   -13,    37,   -13,    -4,    18,    39,    18,   -13,
6348 +      28,   -13,   -13,    34,    -4,    18,    41,   -13,   -13,   -13,
6349 +     -13,    25,   -13,   -13,    34,    -3,    34,    33,    34,   -13,
6350 +      30,    -3,    43,    36,   -13,    38,   -13,   -13,    20,   -13,
6351 +     -13,   -13,   -13,   -13,     2,     9,   -13,   -13,   -13,   -13,
6352 +     -13,   -13,   -13,   -13,    -2,    -6,   -13,   -13,   -13,   -13,
6353 +     -13,    45,   -13,   -13,   -13,   -13,   -13
6354 +};
6355 +
6356 +/* YYPGOTO[NTERM-NUM].  */
6357 +static const yytype_int8 yypgoto[] =
6358 +{
6359 +     -13,   -13,    35,    27,    47,   -13,   -12,    40,    17,   -13,
6360 +      26,   -13,   -13,   -13,   -13,   -13,   -13,    29,   -13,    -8
6361 +};
6362 +
6363 +/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
6364 +   positive, shift that token.  If negative, reduce the rule which
6365 +   number is the opposite.  If zero, do what YYDEFACT says.
6366 +   If YYTABLE_NINF, syntax error.  */
6367 +#define YYTABLE_NINF -43
6368 +static const yytype_int8 yytable[] =
6369 +{
6370 +      16,    21,   -42,    63,    56,    64,    57,    16,     2,    58,
6371 +      59,    10,    28,    46,    33,    47,    65,    32,    60,    49,
6372 +      50,    51,   -42,    32,     8,    48,     1,   -42,    52,     2,
6373 +      53,    19,    20,    41,     2,    15,    17,     9,    42,    26,
6374 +      19,    20,    15,    13,    17,    24,    34,    35,    38,    39,
6375 +      23,    40,    66,    12,    22,    43,     0,    36,     0,     0,
6376 +      37
6377 +};
6378 +
6379 +static const yytype_int8 yycheck[] =
6380 +{
6381 +       8,    13,     5,     9,     6,    11,     8,    15,    11,    11,
6382 +      12,    15,    24,    11,    26,    13,    22,    25,    20,    10,
6383 +      11,    12,     4,    31,    13,    23,     3,     4,    19,    11,
6384 +      21,     6,     7,    13,    11,     8,    16,     0,    18,    14,
6385 +       6,     7,    15,     4,    16,     4,    13,    17,     5,    13,
6386 +      15,    13,     7,     6,    14,    38,    -1,    31,    -1,    -1,
6387 +      31
6388 +};
6389 +
6390 +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
6391 +   symbol of state STATE-NUM.  */
6392 +static const yytype_uint8 yystos[] =
6393 +{
6394 +       0,     3,    11,    25,    27,    28,    29,    43,    13,     0,
6395 +      15,    31,    28,     4,    26,    27,    43,    16,    32,     6,
6396 +       7,    30,    31,    26,     4,    33,    14,    30,    30,    34,
6397 +      41,    42,    43,    30,    13,    17,    34,    41,     5,    13,
6398 +      13,    13,    18,    32,    35,    36,    11,    13,    23,    10,
6399 +      11,    12,    19,    21,    37,    40,     6,     8,    11,    12,
6400 +      20,    38,    39,     9,    11,    22,     7
6401 +};
6402 +
6403 +#define yyerrok                (yyerrstatus = 0)
6404 +#define yyclearin      (yychar = YYEMPTY)
6405 +#define YYEMPTY                (-2)
6406 +#define YYEOF          0
6407 +
6408 +#define YYACCEPT       goto yyacceptlab
6409 +#define YYABORT                goto yyabortlab
6410 +#define YYERROR                goto yyerrorlab
6411 +
6412 +
6413 +/* Like YYERROR except do call yyerror.  This remains here temporarily
6414 +   to ease the transition to the new meaning of YYERROR, for GCC.
6415 +   Once GCC version 2 has supplanted version 1, this can go.  */
6416 +
6417 +#define YYFAIL         goto yyerrlab
6418 +
6419 +#define YYRECOVERING()  (!!yyerrstatus)
6420 +
6421 +#define YYBACKUP(Token, Value)                                 \
6422 +do                                                             \
6423 +  if (yychar == YYEMPTY && yylen == 1)                         \
6424 +    {                                                          \
6425 +      yychar = (Token);                                                \
6426 +      yylval = (Value);                                                \
6427 +      yytoken = YYTRANSLATE (yychar);                          \
6428 +      YYPOPSTACK (1);                                          \
6429 +      goto yybackup;                                           \
6430 +    }                                                          \
6431 +  else                                                         \
6432 +    {                                                          \
6433 +      yyerror (YY_("syntax error: cannot back up")); \
6434 +      YYERROR;                                                 \
6435 +    }                                                          \
6436 +while (YYID (0))
6437 +
6438 +
6439 +#define YYTERROR       1
6440 +#define YYERRCODE      256
6441 +
6442 +
6443 +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
6444 +   If N is 0, then set CURRENT to the empty location which ends
6445 +   the previous symbol: RHS[0] (always defined).  */
6446 +
6447 +#define YYRHSLOC(Rhs, K) ((Rhs)[K])
6448 +#ifndef YYLLOC_DEFAULT
6449 +# define YYLLOC_DEFAULT(Current, Rhs, N)                               \
6450 +    do                                                                 \
6451 +      if (YYID (N))                                                    \
6452 +       {                                                               \
6453 +         (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
6454 +         (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
6455 +         (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
6456 +         (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
6457 +       }                                                               \
6458 +      else                                                             \
6459 +       {                                                               \
6460 +         (Current).first_line   = (Current).last_line   =              \
6461 +           YYRHSLOC (Rhs, 0).last_line;                                \
6462 +         (Current).first_column = (Current).last_column =              \
6463 +           YYRHSLOC (Rhs, 0).last_column;                              \
6464 +       }                                                               \
6465 +    while (YYID (0))
6466 +#endif
6467 +
6468 +
6469 +/* YY_LOCATION_PRINT -- Print the location on the stream.
6470 +   This macro was not mandated originally: define only if we know
6471 +   we won't break user code: when these are the locations we know.  */
6472 +
6473 +#ifndef YY_LOCATION_PRINT
6474 +# if YYLTYPE_IS_TRIVIAL
6475 +#  define YY_LOCATION_PRINT(File, Loc)                 \
6476 +     fprintf (File, "%d.%d-%d.%d",                     \
6477 +             (Loc).first_line, (Loc).first_column,     \
6478 +             (Loc).last_line,  (Loc).last_column)
6479 +# else
6480 +#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
6481 +# endif
6482 +#endif
6483 +
6484 +
6485 +/* YYLEX -- calling `yylex' with the right arguments.  */
6486 +
6487 +#ifdef YYLEX_PARAM
6488 +# define YYLEX yylex (YYLEX_PARAM)
6489 +#else
6490 +# define YYLEX yylex ()
6491 +#endif
6492 +
6493 +/* Enable debugging if requested.  */
6494 +#if YYDEBUG
6495 +
6496 +# ifndef YYFPRINTF
6497 +#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
6498 +#  define YYFPRINTF fprintf
6499 +# endif
6500 +
6501 +# define YYDPRINTF(Args)                       \
6502 +do {                                           \
6503 +  if (yydebug)                                 \
6504 +    YYFPRINTF Args;                            \
6505 +} while (YYID (0))
6506 +
6507 +# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                   \
6508 +do {                                                                     \
6509 +  if (yydebug)                                                           \
6510 +    {                                                                    \
6511 +      YYFPRINTF (stderr, "%s ", Title);                                          \
6512 +      yy_symbol_print (stderr,                                           \
6513 +                 Type, Value, Location); \
6514 +      YYFPRINTF (stderr, "\n");                                                  \
6515 +    }                                                                    \
6516 +} while (YYID (0))
6517 +
6518 +
6519 +/*--------------------------------.
6520 +| Print this symbol on YYOUTPUT.  |
6521 +`--------------------------------*/
6522 +
6523 +/*ARGSUSED*/
6524 +#if (defined __STDC__ || defined __C99__FUNC__ \
6525 +     || defined __cplusplus || defined _MSC_VER)
6526 +static void
6527 +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
6528 +#else
6529 +static void
6530 +yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
6531 +    FILE *yyoutput;
6532 +    int yytype;
6533 +    YYSTYPE const * const yyvaluep;
6534 +    YYLTYPE const * const yylocationp;
6535 +#endif
6536 +{
6537 +  if (!yyvaluep)
6538 +    return;
6539 +  YYUSE (yylocationp);
6540 +# ifdef YYPRINT
6541 +  if (yytype < YYNTOKENS)
6542 +    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
6543 +# else
6544 +  YYUSE (yyoutput);
6545 +# endif
6546 +  switch (yytype)
6547 +    {
6548 +      default:
6549 +       break;
6550 +    }
6551 +}
6552 +
6553 +
6554 +/*--------------------------------.
6555 +| Print this symbol on YYOUTPUT.  |
6556 +`--------------------------------*/
6557 +
6558 +#if (defined __STDC__ || defined __C99__FUNC__ \
6559 +     || defined __cplusplus || defined _MSC_VER)
6560 +static void
6561 +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
6562 +#else
6563 +static void
6564 +yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
6565 +    FILE *yyoutput;
6566 +    int yytype;
6567 +    YYSTYPE const * const yyvaluep;
6568 +    YYLTYPE const * const yylocationp;
6569 +#endif
6570 +{
6571 +  if (yytype < YYNTOKENS)
6572 +    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
6573 +  else
6574 +    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
6575 +
6576 +  YY_LOCATION_PRINT (yyoutput, *yylocationp);
6577 +  YYFPRINTF (yyoutput, ": ");
6578 +  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
6579 +  YYFPRINTF (yyoutput, ")");
6580 +}
6581 +
6582 +/*------------------------------------------------------------------.
6583 +| yy_stack_print -- Print the state stack from its BOTTOM up to its |
6584 +| TOP (included).                                                   |
6585 +`------------------------------------------------------------------*/
6586 +
6587 +#if (defined __STDC__ || defined __C99__FUNC__ \
6588 +     || defined __cplusplus || defined _MSC_VER)
6589 +static void
6590 +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
6591 +#else
6592 +static void
6593 +yy_stack_print (bottom, top)
6594 +    yytype_int16 *bottom;
6595 +    yytype_int16 *top;
6596 +#endif
6597 +{
6598 +  YYFPRINTF (stderr, "Stack now");
6599 +  for (; bottom <= top; ++bottom)
6600 +    YYFPRINTF (stderr, " %d", *bottom);
6601 +  YYFPRINTF (stderr, "\n");
6602 +}
6603 +
6604 +# define YY_STACK_PRINT(Bottom, Top)                           \
6605 +do {                                                           \
6606 +  if (yydebug)                                                 \
6607 +    yy_stack_print ((Bottom), (Top));                          \
6608 +} while (YYID (0))
6609 +
6610 +
6611 +/*------------------------------------------------.
6612 +| Report that the YYRULE is going to be reduced.  |
6613 +`------------------------------------------------*/
6614 +
6615 +#if (defined __STDC__ || defined __C99__FUNC__ \
6616 +     || defined __cplusplus || defined _MSC_VER)
6617 +static void
6618 +yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
6619 +#else
6620 +static void
6621 +yy_reduce_print (yyvsp, yylsp, yyrule)
6622 +    YYSTYPE *yyvsp;
6623 +    YYLTYPE *yylsp;
6624 +    int yyrule;
6625 +#endif
6626 +{
6627 +  int yynrhs = yyr2[yyrule];
6628 +  int yyi;
6629 +  unsigned long int yylno = yyrline[yyrule];
6630 +  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
6631 +            yyrule - 1, yylno);
6632 +  /* The symbols being reduced.  */
6633 +  for (yyi = 0; yyi < yynrhs; yyi++)
6634 +    {
6635 +      fprintf (stderr, "   $%d = ", yyi + 1);
6636 +      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
6637 +                      &(yyvsp[(yyi + 1) - (yynrhs)])
6638 +                      , &(yylsp[(yyi + 1) - (yynrhs)])                );
6639 +      fprintf (stderr, "\n");
6640 +    }
6641 +}
6642 +
6643 +# define YY_REDUCE_PRINT(Rule)         \
6644 +do {                                   \
6645 +  if (yydebug)                         \
6646 +    yy_reduce_print (yyvsp, yylsp, Rule); \
6647 +} while (YYID (0))
6648 +
6649 +/* Nonzero means print parse trace.  It is left uninitialized so that
6650 +   multiple parsers can coexist.  */
6651 +int yydebug;
6652 +#else /* !YYDEBUG */
6653 +# define YYDPRINTF(Args)
6654 +# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
6655 +# define YY_STACK_PRINT(Bottom, Top)
6656 +# define YY_REDUCE_PRINT(Rule)
6657 +#endif /* !YYDEBUG */
6658 +
6659 +
6660 +/* YYINITDEPTH -- initial size of the parser's stacks.  */
6661 +#ifndef        YYINITDEPTH
6662 +# define YYINITDEPTH 200
6663 +#endif
6664 +
6665 +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
6666 +   if the built-in stack extension method is used).
6667 +
6668 +   Do not make this value too large; the results are undefined if
6669 +   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
6670 +   evaluated with infinite-precision integer arithmetic.  */
6671 +
6672 +#ifndef YYMAXDEPTH
6673 +# define YYMAXDEPTH 10000
6674 +#endif
6675 +
6676 +\f
6677 +
6678 +#if YYERROR_VERBOSE
6679 +
6680 +# ifndef yystrlen
6681 +#  if defined __GLIBC__ && defined _STRING_H
6682 +#   define yystrlen strlen
6683 +#  else
6684 +/* Return the length of YYSTR.  */
6685 +#if (defined __STDC__ || defined __C99__FUNC__ \
6686 +     || defined __cplusplus || defined _MSC_VER)
6687 +static YYSIZE_T
6688 +yystrlen (const char *yystr)
6689 +#else
6690 +static YYSIZE_T
6691 +yystrlen (yystr)
6692 +    const char *yystr;
6693 +#endif
6694 +{
6695 +  YYSIZE_T yylen;
6696 +  for (yylen = 0; yystr[yylen]; yylen++)
6697 +    continue;
6698 +  return yylen;
6699 +}
6700 +#  endif
6701 +# endif
6702 +
6703 +# ifndef yystpcpy
6704 +#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
6705 +#   define yystpcpy stpcpy
6706 +#  else
6707 +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
6708 +   YYDEST.  */
6709 +#if (defined __STDC__ || defined __C99__FUNC__ \
6710 +     || defined __cplusplus || defined _MSC_VER)
6711 +static char *
6712 +yystpcpy (char *yydest, const char *yysrc)
6713 +#else
6714 +static char *
6715 +yystpcpy (yydest, yysrc)
6716 +    char *yydest;
6717 +    const char *yysrc;
6718 +#endif
6719 +{
6720 +  char *yyd = yydest;
6721 +  const char *yys = yysrc;
6722 +
6723 +  while ((*yyd++ = *yys++) != '\0')
6724 +    continue;
6725 +
6726 +  return yyd - 1;
6727 +}
6728 +#  endif
6729 +# endif
6730 +
6731 +# ifndef yytnamerr
6732 +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
6733 +   quotes and backslashes, so that it's suitable for yyerror.  The
6734 +   heuristic is that double-quoting is unnecessary unless the string
6735 +   contains an apostrophe, a comma, or backslash (other than
6736 +   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
6737 +   null, do not copy; instead, return the length of what the result
6738 +   would have been.  */
6739 +static YYSIZE_T
6740 +yytnamerr (char *yyres, const char *yystr)
6741 +{
6742 +  if (*yystr == '"')
6743 +    {
6744 +      YYSIZE_T yyn = 0;
6745 +      char const *yyp = yystr;
6746 +
6747 +      for (;;)
6748 +       switch (*++yyp)
6749 +         {
6750 +         case '\'':
6751 +         case ',':
6752 +           goto do_not_strip_quotes;
6753 +
6754 +         case '\\':
6755 +           if (*++yyp != '\\')
6756 +             goto do_not_strip_quotes;
6757 +           /* Fall through.  */
6758 +         default:
6759 +           if (yyres)
6760 +             yyres[yyn] = *yyp;
6761 +           yyn++;
6762 +           break;
6763 +
6764 +         case '"':
6765 +           if (yyres)
6766 +             yyres[yyn] = '\0';
6767 +           return yyn;
6768 +         }
6769 +    do_not_strip_quotes: ;
6770 +    }
6771 +
6772 +  if (! yyres)
6773 +    return yystrlen (yystr);
6774 +
6775 +  return yystpcpy (yyres, yystr) - yyres;
6776 +}
6777 +# endif
6778 +
6779 +/* Copy into YYRESULT an error message about the unexpected token
6780 +   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
6781 +   including the terminating null byte.  If YYRESULT is null, do not
6782 +   copy anything; just return the number of bytes that would be
6783 +   copied.  As a special case, return 0 if an ordinary "syntax error"
6784 +   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
6785 +   size calculation.  */
6786 +static YYSIZE_T
6787 +yysyntax_error (char *yyresult, int yystate, int yychar)
6788 +{
6789 +  int yyn = yypact[yystate];
6790 +
6791 +  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
6792 +    return 0;
6793 +  else
6794 +    {
6795 +      int yytype = YYTRANSLATE (yychar);
6796 +      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
6797 +      YYSIZE_T yysize = yysize0;
6798 +      YYSIZE_T yysize1;
6799 +      int yysize_overflow = 0;
6800 +      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
6801 +      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
6802 +      int yyx;
6803 +
6804 +# if 0
6805 +      /* This is so xgettext sees the translatable formats that are
6806 +        constructed on the fly.  */
6807 +      YY_("syntax error, unexpected %s");
6808 +      YY_("syntax error, unexpected %s, expecting %s");
6809 +      YY_("syntax error, unexpected %s, expecting %s or %s");
6810 +      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
6811 +      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
6812 +# endif
6813 +      char *yyfmt;
6814 +      char const *yyf;
6815 +      static char const yyunexpected[] = "syntax error, unexpected %s";
6816 +      static char const yyexpecting[] = ", expecting %s";
6817 +      static char const yyor[] = " or %s";
6818 +      char yyformat[sizeof yyunexpected
6819 +                   + sizeof yyexpecting - 1
6820 +                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
6821 +                      * (sizeof yyor - 1))];
6822 +      char const *yyprefix = yyexpecting;
6823 +
6824 +      /* Start YYX at -YYN if negative to avoid negative indexes in
6825 +        YYCHECK.  */
6826 +      int yyxbegin = yyn < 0 ? -yyn : 0;
6827 +
6828 +      /* Stay within bounds of both yycheck and yytname.  */
6829 +      int yychecklim = YYLAST - yyn + 1;
6830 +      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
6831 +      int yycount = 1;
6832 +
6833 +      yyarg[0] = yytname[yytype];
6834 +      yyfmt = yystpcpy (yyformat, yyunexpected);
6835 +
6836 +      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
6837 +       if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
6838 +         {
6839 +           if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
6840 +             {
6841 +               yycount = 1;
6842 +               yysize = yysize0;
6843 +               yyformat[sizeof yyunexpected - 1] = '\0';
6844 +               break;
6845 +             }
6846 +           yyarg[yycount++] = yytname[yyx];
6847 +           yysize1 = yysize + yytnamerr (0, yytname[yyx]);
6848 +           yysize_overflow |= (yysize1 < yysize);
6849 +           yysize = yysize1;
6850 +           yyfmt = yystpcpy (yyfmt, yyprefix);
6851 +           yyprefix = yyor;
6852 +         }
6853 +
6854 +      yyf = YY_(yyformat);
6855 +      yysize1 = yysize + yystrlen (yyf);
6856 +      yysize_overflow |= (yysize1 < yysize);
6857 +      yysize = yysize1;
6858 +
6859 +      if (yysize_overflow)
6860 +       return YYSIZE_MAXIMUM;
6861 +
6862 +      if (yyresult)
6863 +       {
6864 +         /* Avoid sprintf, as that infringes on the user's name space.
6865 +            Don't have undefined behavior even if the translation
6866 +            produced a string with the wrong number of "%s"s.  */
6867 +         char *yyp = yyresult;
6868 +         int yyi = 0;
6869 +         while ((*yyp = *yyf) != '\0')
6870 +           {
6871 +             if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
6872 +               {
6873 +                 yyp += yytnamerr (yyp, yyarg[yyi++]);
6874 +                 yyf += 2;
6875 +               }
6876 +             else
6877 +               {
6878 +                 yyp++;
6879 +                 yyf++;
6880 +               }
6881 +           }
6882 +       }
6883 +      return yysize;
6884 +    }
6885 +}
6886 +#endif /* YYERROR_VERBOSE */
6887 +\f
6888 +
6889 +/*-----------------------------------------------.
6890 +| Release the memory associated to this symbol.  |
6891 +`-----------------------------------------------*/
6892 +
6893 +/*ARGSUSED*/
6894 +#if (defined __STDC__ || defined __C99__FUNC__ \
6895 +     || defined __cplusplus || defined _MSC_VER)
6896 +static void
6897 +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
6898 +#else
6899 +static void
6900 +yydestruct (yymsg, yytype, yyvaluep, yylocationp)
6901 +    const char *yymsg;
6902 +    int yytype;
6903 +    YYSTYPE *yyvaluep;
6904 +    YYLTYPE *yylocationp;
6905 +#endif
6906 +{
6907 +  YYUSE (yyvaluep);
6908 +  YYUSE (yylocationp);
6909 +
6910 +  if (!yymsg)
6911 +    yymsg = "Deleting";
6912 +  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
6913 +
6914 +  switch (yytype)
6915 +    {
6916 +
6917 +      default:
6918 +       break;
6919 +    }
6920 +}
6921 +\f
6922 +
6923 +/* Prevent warnings from -Wmissing-prototypes.  */
6924 +
6925 +#ifdef YYPARSE_PARAM
6926 +#if defined __STDC__ || defined __cplusplus
6927 +int yyparse (void *YYPARSE_PARAM);
6928 +#else
6929 +int yyparse ();
6930 +#endif
6931 +#else /* ! YYPARSE_PARAM */
6932 +#if defined __STDC__ || defined __cplusplus
6933 +int yyparse (void);
6934 +#else
6935 +int yyparse ();
6936 +#endif
6937 +#endif /* ! YYPARSE_PARAM */
6938 +
6939 +
6940 +
6941 +/* The look-ahead symbol.  */
6942 +int yychar;
6943 +
6944 +/* The semantic value of the look-ahead symbol.  */
6945 +YYSTYPE yylval;
6946 +
6947 +/* Number of syntax errors so far.  */
6948 +int yynerrs;
6949 +/* Location data for the look-ahead symbol.  */
6950 +YYLTYPE yylloc;
6951 +
6952 +
6953 +
6954 +/*----------.
6955 +| yyparse.  |
6956 +`----------*/
6957 +
6958 +#ifdef YYPARSE_PARAM
6959 +#if (defined __STDC__ || defined __C99__FUNC__ \
6960 +     || defined __cplusplus || defined _MSC_VER)
6961 +int
6962 +yyparse (void *YYPARSE_PARAM)
6963 +#else
6964 +int
6965 +yyparse (YYPARSE_PARAM)
6966 +    void *YYPARSE_PARAM;
6967 +#endif
6968 +#else /* ! YYPARSE_PARAM */
6969 +#if (defined __STDC__ || defined __C99__FUNC__ \
6970 +     || defined __cplusplus || defined _MSC_VER)
6971 +int
6972 +yyparse (void)
6973 +#else
6974 +int
6975 +yyparse ()
6976 +
6977 +#endif
6978 +#endif
6979 +{
6980 +  
6981 +  int yystate;
6982 +  int yyn;
6983 +  int yyresult;
6984 +  /* Number of tokens to shift before error messages enabled.  */
6985 +  int yyerrstatus;
6986 +  /* Look-ahead token as an internal (translated) token number.  */
6987 +  int yytoken = 0;
6988 +#if YYERROR_VERBOSE
6989 +  /* Buffer for error messages, and its allocated size.  */
6990 +  char yymsgbuf[128];
6991 +  char *yymsg = yymsgbuf;
6992 +  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
6993 +#endif
6994 +
6995 +  /* Three stacks and their tools:
6996 +     `yyss': related to states,
6997 +     `yyvs': related to semantic values,
6998 +     `yyls': related to locations.
6999 +
7000 +     Refer to the stacks thru separate pointers, to allow yyoverflow
7001 +     to reallocate them elsewhere.  */
7002 +
7003 +  /* The state stack.  */
7004 +  yytype_int16 yyssa[YYINITDEPTH];
7005 +  yytype_int16 *yyss = yyssa;
7006 +  yytype_int16 *yyssp;
7007 +
7008 +  /* The semantic value stack.  */
7009 +  YYSTYPE yyvsa[YYINITDEPTH];
7010 +  YYSTYPE *yyvs = yyvsa;
7011 +  YYSTYPE *yyvsp;
7012 +
7013 +  /* The location stack.  */
7014 +  YYLTYPE yylsa[YYINITDEPTH];
7015 +  YYLTYPE *yyls = yylsa;
7016 +  YYLTYPE *yylsp;
7017 +  /* The locations where the error started and ended.  */
7018 +  YYLTYPE yyerror_range[2];
7019 +
7020 +#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
7021 +
7022 +  YYSIZE_T yystacksize = YYINITDEPTH;
7023 +
7024 +  /* The variables used to return semantic value and location from the
7025 +     action routines.  */
7026 +  YYSTYPE yyval;
7027 +  YYLTYPE yyloc;
7028 +
7029 +  /* The number of symbols on the RHS of the reduced rule.
7030 +     Keep to zero when no symbol should be popped.  */
7031 +  int yylen = 0;
7032 +
7033 +  YYDPRINTF ((stderr, "Starting parse\n"));
7034 +
7035 +  yystate = 0;
7036 +  yyerrstatus = 0;
7037 +  yynerrs = 0;
7038 +  yychar = YYEMPTY;            /* Cause a token to be read.  */
7039 +
7040 +  /* Initialize stack pointers.
7041 +     Waste one element of value and location stack
7042 +     so that they stay on the same level as the state stack.
7043 +     The wasted elements are never initialized.  */
7044 +
7045 +  yyssp = yyss;
7046 +  yyvsp = yyvs;
7047 +  yylsp = yyls;
7048 +#if YYLTYPE_IS_TRIVIAL
7049 +  /* Initialize the default location before parsing starts.  */
7050 +  yylloc.first_line   = yylloc.last_line   = 1;
7051 +  yylloc.first_column = yylloc.last_column = 0;
7052 +#endif
7053 +
7054 +  goto yysetstate;
7055 +
7056 +/*------------------------------------------------------------.
7057 +| yynewstate -- Push a new state, which is found in yystate.  |
7058 +`------------------------------------------------------------*/
7059 + yynewstate:
7060 +  /* In all cases, when you get here, the value and location stacks
7061 +     have just been pushed.  So pushing a state here evens the stacks.  */
7062 +  yyssp++;
7063 +
7064 + yysetstate:
7065 +  *yyssp = yystate;
7066 +
7067 +  if (yyss + yystacksize - 1 <= yyssp)
7068 +    {
7069 +      /* Get the current used size of the three stacks, in elements.  */
7070 +      YYSIZE_T yysize = yyssp - yyss + 1;
7071 +
7072 +#ifdef yyoverflow
7073 +      {
7074 +       /* Give user a chance to reallocate the stack.  Use copies of
7075 +          these so that the &'s don't force the real ones into
7076 +          memory.  */
7077 +       YYSTYPE *yyvs1 = yyvs;
7078 +       yytype_int16 *yyss1 = yyss;
7079 +       YYLTYPE *yyls1 = yyls;
7080 +
7081 +       /* Each stack pointer address is followed by the size of the
7082 +          data in use in that stack, in bytes.  This used to be a
7083 +          conditional around just the two extra args, but that might
7084 +          be undefined if yyoverflow is a macro.  */
7085 +       yyoverflow (YY_("memory exhausted"),
7086 +                   &yyss1, yysize * sizeof (*yyssp),
7087 +                   &yyvs1, yysize * sizeof (*yyvsp),
7088 +                   &yyls1, yysize * sizeof (*yylsp),
7089 +                   &yystacksize);
7090 +       yyls = yyls1;
7091 +       yyss = yyss1;
7092 +       yyvs = yyvs1;
7093 +      }
7094 +#else /* no yyoverflow */
7095 +# ifndef YYSTACK_RELOCATE
7096 +      goto yyexhaustedlab;
7097 +# else
7098 +      /* Extend the stack our own way.  */
7099 +      if (YYMAXDEPTH <= yystacksize)
7100 +       goto yyexhaustedlab;
7101 +      yystacksize *= 2;
7102 +      if (YYMAXDEPTH < yystacksize)
7103 +       yystacksize = YYMAXDEPTH;
7104 +
7105 +      {
7106 +       yytype_int16 *yyss1 = yyss;
7107 +       union yyalloc *yyptr =
7108 +         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
7109 +       if (! yyptr)
7110 +         goto yyexhaustedlab;
7111 +       YYSTACK_RELOCATE (yyss);
7112 +       YYSTACK_RELOCATE (yyvs);
7113 +       YYSTACK_RELOCATE (yyls);
7114 +#  undef YYSTACK_RELOCATE
7115 +       if (yyss1 != yyssa)
7116 +         YYSTACK_FREE (yyss1);
7117 +      }
7118 +# endif
7119 +#endif /* no yyoverflow */
7120 +
7121 +      yyssp = yyss + yysize - 1;
7122 +      yyvsp = yyvs + yysize - 1;
7123 +      yylsp = yyls + yysize - 1;
7124 +
7125 +      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
7126 +                 (unsigned long int) yystacksize));
7127 +
7128 +      if (yyss + yystacksize - 1 <= yyssp)
7129 +       YYABORT;
7130 +    }
7131 +
7132 +  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
7133 +
7134 +  goto yybackup;
7135 +
7136 +/*-----------.
7137 +| yybackup.  |
7138 +`-----------*/
7139 +yybackup:
7140 +
7141 +  /* Do appropriate processing given the current state.  Read a
7142 +     look-ahead token if we need one and don't already have one.  */
7143 +
7144 +  /* First try to decide what to do without reference to look-ahead token.  */
7145 +  yyn = yypact[yystate];
7146 +  if (yyn == YYPACT_NINF)
7147 +    goto yydefault;
7148 +
7149 +  /* Not known => get a look-ahead token if don't already have one.  */
7150 +
7151 +  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
7152 +  if (yychar == YYEMPTY)
7153 +    {
7154 +      YYDPRINTF ((stderr, "Reading a token: "));
7155 +      yychar = YYLEX;
7156 +    }
7157 +
7158 +  if (yychar <= YYEOF)
7159 +    {
7160 +      yychar = yytoken = YYEOF;
7161 +      YYDPRINTF ((stderr, "Now at end of input.\n"));
7162 +    }
7163 +  else
7164 +    {
7165 +      yytoken = YYTRANSLATE (yychar);
7166 +      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
7167 +    }
7168 +
7169 +  /* If the proper action on seeing token YYTOKEN is to reduce or to
7170 +     detect an error, take that action.  */
7171 +  yyn += yytoken;
7172 +  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
7173 +    goto yydefault;
7174 +  yyn = yytable[yyn];
7175 +  if (yyn <= 0)
7176 +    {
7177 +      if (yyn == 0 || yyn == YYTABLE_NINF)
7178 +       goto yyerrlab;
7179 +      yyn = -yyn;
7180 +      goto yyreduce;
7181 +    }
7182 +
7183 +  if (yyn == YYFINAL)
7184 +    YYACCEPT;
7185 +
7186 +  /* Count tokens shifted since error; after three, turn off error
7187 +     status.  */
7188 +  if (yyerrstatus)
7189 +    yyerrstatus--;
7190 +
7191 +  /* Shift the look-ahead token.  */
7192 +  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
7193 +
7194 +  /* Discard the shifted token unless it is eof.  */
7195 +  if (yychar != YYEOF)
7196 +    yychar = YYEMPTY;
7197 +
7198 +  yystate = yyn;
7199 +  *++yyvsp = yylval;
7200 +  *++yylsp = yylloc;
7201 +  goto yynewstate;
7202 +
7203 +
7204 +/*-----------------------------------------------------------.
7205 +| yydefault -- do the default action for the current state.  |
7206 +`-----------------------------------------------------------*/
7207 +yydefault:
7208 +  yyn = yydefact[yystate];
7209 +  if (yyn == 0)
7210 +    goto yyerrlab;
7211 +  goto yyreduce;
7212 +
7213 +
7214 +/*-----------------------------.
7215 +| yyreduce -- Do a reduction.  |
7216 +`-----------------------------*/
7217 +yyreduce:
7218 +  /* yyn is the number of a rule to reduce with.  */
7219 +  yylen = yyr2[yyn];
7220 +
7221 +  /* If YYLEN is nonzero, implement the default value of the action:
7222 +     `$$ = $1'.
7223 +
7224 +     Otherwise, the following line sets YYVAL to garbage.
7225 +     This behavior is undocumented and Bison
7226 +     users should not rely upon it.  Assigning to YYVAL
7227 +     unconditionally makes the parser a bit smaller, and it avoids a
7228 +     GCC warning that YYVAL may be used uninitialized.  */
7229 +  yyval = yyvsp[1-yylen];
7230 +
7231 +  /* Default location.  */
7232 +  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
7233 +  YY_REDUCE_PRINT (yyn);
7234 +  switch (yyn)
7235 +    {
7236 +        case 2:
7237 +#line 86 "dtc-parser.y"
7238 +    {
7239 +                       the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node));
7240 +               ;}
7241 +    break;
7242 +
7243 +  case 3:
7244 +#line 90 "dtc-parser.y"
7245 +    {
7246 +                       the_boot_info = build_boot_info((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].node));
7247 +               ;}
7248 +    break;
7249 +
7250 +  case 4:
7251 +#line 97 "dtc-parser.y"
7252 +    {
7253 +                       (yyval.re) = NULL;
7254 +               ;}
7255 +    break;
7256 +
7257 +  case 5:
7258 +#line 101 "dtc-parser.y"
7259 +    {
7260 +                       (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
7261 +               ;}
7262 +    break;
7263 +
7264 +  case 6:
7265 +#line 108 "dtc-parser.y"
7266 +    {
7267 +                       (yyval.re) = build_reserve_entry((yyvsp[(3) - (5)].addr), (yyvsp[(4) - (5)].addr), (yyvsp[(1) - (5)].labelref));
7268 +               ;}
7269 +    break;
7270 +
7271 +  case 7:
7272 +#line 115 "dtc-parser.y"
7273 +    {
7274 +                       (yyval.re) = NULL;
7275 +               ;}
7276 +    break;
7277 +
7278 +  case 8:
7279 +#line 119 "dtc-parser.y"
7280 +    {
7281 +                       (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
7282 +               ;}
7283 +    break;
7284 +
7285 +  case 9:
7286 +#line 126 "dtc-parser.y"
7287 +    {
7288 +                       (yyval.re) = (yyvsp[(1) - (1)].re);
7289 +               ;}
7290 +    break;
7291 +
7292 +  case 10:
7293 +#line 130 "dtc-parser.y"
7294 +    {
7295 +                       (yyval.re) = build_reserve_entry((yyvsp[(3) - (6)].addr), (yyvsp[(5) - (6)].addr) - (yyvsp[(3) - (6)].addr) + 1, (yyvsp[(1) - (6)].labelref));
7296 +               ;}
7297 +    break;
7298 +
7299 +  case 11:
7300 +#line 137 "dtc-parser.y"
7301 +    {
7302 +                       (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
7303 +               ;}
7304 +    break;
7305 +
7306 +  case 12:
7307 +#line 141 "dtc-parser.y"
7308 +    {
7309 +                       (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 16, 64);
7310 +               ;}
7311 +    break;
7312 +
7313 +  case 13:
7314 +#line 148 "dtc-parser.y"
7315 +    {
7316 +                       (yyval.node) = name_node((yyvsp[(2) - (2)].node), "", NULL);
7317 +               ;}
7318 +    break;
7319 +
7320 +  case 14:
7321 +#line 155 "dtc-parser.y"
7322 +    {
7323 +                       (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
7324 +               ;}
7325 +    break;
7326 +
7327 +  case 15:
7328 +#line 162 "dtc-parser.y"
7329 +    {
7330 +                       (yyval.proplist) = NULL;
7331 +               ;}
7332 +    break;
7333 +
7334 +  case 16:
7335 +#line 166 "dtc-parser.y"
7336 +    {
7337 +                       (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
7338 +               ;}
7339 +    break;
7340 +
7341 +  case 17:
7342 +#line 173 "dtc-parser.y"
7343 +    {
7344 +                       (yyval.prop) = build_property((yyvsp[(2) - (5)].propnodename), (yyvsp[(4) - (5)].data), (yyvsp[(1) - (5)].labelref));
7345 +               ;}
7346 +    break;
7347 +
7348 +  case 18:
7349 +#line 177 "dtc-parser.y"
7350 +    {
7351 +                       (yyval.prop) = build_property((yyvsp[(2) - (3)].propnodename), empty_data, (yyvsp[(1) - (3)].labelref));
7352 +               ;}
7353 +    break;
7354 +
7355 +  case 19:
7356 +#line 184 "dtc-parser.y"
7357 +    {
7358 +                       (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
7359 +               ;}
7360 +    break;
7361 +
7362 +  case 20:
7363 +#line 188 "dtc-parser.y"
7364 +    {
7365 +                       (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
7366 +               ;}
7367 +    break;
7368 +
7369 +  case 21:
7370 +#line 192 "dtc-parser.y"
7371 +    {
7372 +                       (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
7373 +               ;}
7374 +    break;
7375 +
7376 +  case 22:
7377 +#line 196 "dtc-parser.y"
7378 +    {
7379 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
7380 +               ;}
7381 +    break;
7382 +
7383 +  case 23:
7384 +#line 200 "dtc-parser.y"
7385 +    {
7386 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7387 +               ;}
7388 +    break;
7389 +
7390 +  case 24:
7391 +#line 207 "dtc-parser.y"
7392 +    {
7393 +                       (yyval.data) = empty_data;
7394 +               ;}
7395 +    break;
7396 +
7397 +  case 25:
7398 +#line 211 "dtc-parser.y"
7399 +    {
7400 +                       (yyval.data) = (yyvsp[(1) - (2)].data);
7401 +               ;}
7402 +    break;
7403 +
7404 +  case 26:
7405 +#line 215 "dtc-parser.y"
7406 +    {
7407 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7408 +               ;}
7409 +    break;
7410 +
7411 +  case 27:
7412 +#line 222 "dtc-parser.y"
7413 +    {
7414 +                       (yyval.data) = empty_data;
7415 +               ;}
7416 +    break;
7417 +
7418 +  case 28:
7419 +#line 226 "dtc-parser.y"
7420 +    {
7421 +                       (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
7422 +               ;}
7423 +    break;
7424 +
7425 +  case 29:
7426 +#line 230 "dtc-parser.y"
7427 +    {
7428 +                       (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
7429 +                                                             (yyvsp[(2) - (2)].labelref)), -1);
7430 +               ;}
7431 +    break;
7432 +
7433 +  case 30:
7434 +#line 235 "dtc-parser.y"
7435 +    {
7436 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7437 +               ;}
7438 +    break;
7439 +
7440 +  case 31:
7441 +#line 242 "dtc-parser.y"
7442 +    {
7443 +                       (yyval.cbase) = 16;
7444 +               ;}
7445 +    break;
7446 +
7447 +  case 33:
7448 +#line 250 "dtc-parser.y"
7449 +    {
7450 +                       (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
7451 +               ;}
7452 +    break;
7453 +
7454 +  case 34:
7455 +#line 254 "dtc-parser.y"
7456 +    {
7457 +                       (yyval.cell) = eval_literal((yyvsp[(2) - (2)].literal), (yyvsp[(1) - (2)].cbase), 32);
7458 +               ;}
7459 +    break;
7460 +
7461 +  case 35:
7462 +#line 261 "dtc-parser.y"
7463 +    {
7464 +                       (yyval.data) = empty_data;
7465 +               ;}
7466 +    break;
7467 +
7468 +  case 36:
7469 +#line 265 "dtc-parser.y"
7470 +    {
7471 +                       (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
7472 +               ;}
7473 +    break;
7474 +
7475 +  case 37:
7476 +#line 269 "dtc-parser.y"
7477 +    {
7478 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7479 +               ;}
7480 +    break;
7481 +
7482 +  case 38:
7483 +#line 276 "dtc-parser.y"
7484 +    {
7485 +                       (yyval.nodelist) = NULL;
7486 +               ;}
7487 +    break;
7488 +
7489 +  case 39:
7490 +#line 280 "dtc-parser.y"
7491 +    {
7492 +                       (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
7493 +               ;}
7494 +    break;
7495 +
7496 +  case 40:
7497 +#line 284 "dtc-parser.y"
7498 +    {
7499 +                       yyerror("syntax error: properties must precede subnodes\n");
7500 +                       YYERROR;
7501 +               ;}
7502 +    break;
7503 +
7504 +  case 41:
7505 +#line 292 "dtc-parser.y"
7506 +    {
7507 +                       (yyval.node) = name_node((yyvsp[(3) - (3)].node), (yyvsp[(2) - (3)].propnodename), (yyvsp[(1) - (3)].labelref));
7508 +               ;}
7509 +    break;
7510 +
7511 +  case 42:
7512 +#line 299 "dtc-parser.y"
7513 +    {
7514 +                       (yyval.labelref) = NULL;
7515 +               ;}
7516 +    break;
7517 +
7518 +  case 43:
7519 +#line 303 "dtc-parser.y"
7520 +    {
7521 +                       (yyval.labelref) = (yyvsp[(1) - (1)].labelref);
7522 +               ;}
7523 +    break;
7524 +
7525 +
7526 +/* Line 1267 of yacc.c.  */
7527 +#line 1734 "dtc-parser.tab.c"
7528 +      default: break;
7529 +    }
7530 +  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7531 +
7532 +  YYPOPSTACK (yylen);
7533 +  yylen = 0;
7534 +  YY_STACK_PRINT (yyss, yyssp);
7535 +
7536 +  *++yyvsp = yyval;
7537 +  *++yylsp = yyloc;
7538 +
7539 +  /* Now `shift' the result of the reduction.  Determine what state
7540 +     that goes to, based on the state we popped back to and the rule
7541 +     number reduced by.  */
7542 +
7543 +  yyn = yyr1[yyn];
7544 +
7545 +  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7546 +  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7547 +    yystate = yytable[yystate];
7548 +  else
7549 +    yystate = yydefgoto[yyn - YYNTOKENS];
7550 +
7551 +  goto yynewstate;
7552 +
7553 +
7554 +/*------------------------------------.
7555 +| yyerrlab -- here on detecting error |
7556 +`------------------------------------*/
7557 +yyerrlab:
7558 +  /* If not already recovering from an error, report this error.  */
7559 +  if (!yyerrstatus)
7560 +    {
7561 +      ++yynerrs;
7562 +#if ! YYERROR_VERBOSE
7563 +      yyerror (YY_("syntax error"));
7564 +#else
7565 +      {
7566 +       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7567 +       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7568 +         {
7569 +           YYSIZE_T yyalloc = 2 * yysize;
7570 +           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7571 +             yyalloc = YYSTACK_ALLOC_MAXIMUM;
7572 +           if (yymsg != yymsgbuf)
7573 +             YYSTACK_FREE (yymsg);
7574 +           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7575 +           if (yymsg)
7576 +             yymsg_alloc = yyalloc;
7577 +           else
7578 +             {
7579 +               yymsg = yymsgbuf;
7580 +               yymsg_alloc = sizeof yymsgbuf;
7581 +             }
7582 +         }
7583 +
7584 +       if (0 < yysize && yysize <= yymsg_alloc)
7585 +         {
7586 +           (void) yysyntax_error (yymsg, yystate, yychar);
7587 +           yyerror (yymsg);
7588 +         }
7589 +       else
7590 +         {
7591 +           yyerror (YY_("syntax error"));
7592 +           if (yysize != 0)
7593 +             goto yyexhaustedlab;
7594 +         }
7595 +      }
7596 +#endif
7597 +    }
7598 +
7599 +  yyerror_range[0] = yylloc;
7600 +
7601 +  if (yyerrstatus == 3)
7602 +    {
7603 +      /* If just tried and failed to reuse look-ahead token after an
7604 +        error, discard it.  */
7605 +
7606 +      if (yychar <= YYEOF)
7607 +       {
7608 +         /* Return failure if at end of input.  */
7609 +         if (yychar == YYEOF)
7610 +           YYABORT;
7611 +       }
7612 +      else
7613 +       {
7614 +         yydestruct ("Error: discarding",
7615 +                     yytoken, &yylval, &yylloc);
7616 +         yychar = YYEMPTY;
7617 +       }
7618 +    }
7619 +
7620 +  /* Else will try to reuse look-ahead token after shifting the error
7621 +     token.  */
7622 +  goto yyerrlab1;
7623 +
7624 +
7625 +/*---------------------------------------------------.
7626 +| yyerrorlab -- error raised explicitly by YYERROR.  |
7627 +`---------------------------------------------------*/
7628 +yyerrorlab:
7629 +
7630 +  /* Pacify compilers like GCC when the user code never invokes
7631 +     YYERROR and the label yyerrorlab therefore never appears in user
7632 +     code.  */
7633 +  if (/*CONSTCOND*/ 0)
7634 +     goto yyerrorlab;
7635 +
7636 +  yyerror_range[0] = yylsp[1-yylen];
7637 +  /* Do not reclaim the symbols of the rule which action triggered
7638 +     this YYERROR.  */
7639 +  YYPOPSTACK (yylen);
7640 +  yylen = 0;
7641 +  YY_STACK_PRINT (yyss, yyssp);
7642 +  yystate = *yyssp;
7643 +  goto yyerrlab1;
7644 +
7645 +
7646 +/*-------------------------------------------------------------.
7647 +| yyerrlab1 -- common code for both syntax error and YYERROR.  |
7648 +`-------------------------------------------------------------*/
7649 +yyerrlab1:
7650 +  yyerrstatus = 3;     /* Each real token shifted decrements this.  */
7651 +
7652 +  for (;;)
7653 +    {
7654 +      yyn = yypact[yystate];
7655 +      if (yyn != YYPACT_NINF)
7656 +       {
7657 +         yyn += YYTERROR;
7658 +         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7659 +           {
7660 +             yyn = yytable[yyn];
7661 +             if (0 < yyn)
7662 +               break;
7663 +           }
7664 +       }
7665 +
7666 +      /* Pop the current state because it cannot handle the error token.  */
7667 +      if (yyssp == yyss)
7668 +       YYABORT;
7669 +
7670 +      yyerror_range[0] = *yylsp;
7671 +      yydestruct ("Error: popping",
7672 +                 yystos[yystate], yyvsp, yylsp);
7673 +      YYPOPSTACK (1);
7674 +      yystate = *yyssp;
7675 +      YY_STACK_PRINT (yyss, yyssp);
7676 +    }
7677 +
7678 +  if (yyn == YYFINAL)
7679 +    YYACCEPT;
7680 +
7681 +  *++yyvsp = yylval;
7682 +
7683 +  yyerror_range[1] = yylloc;
7684 +  /* Using YYLLOC is tempting, but would change the location of
7685 +     the look-ahead.  YYLOC is available though.  */
7686 +  YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
7687 +  *++yylsp = yyloc;
7688 +
7689 +  /* Shift the error token.  */
7690 +  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7691 +
7692 +  yystate = yyn;
7693 +  goto yynewstate;
7694 +
7695 +
7696 +/*-------------------------------------.
7697 +| yyacceptlab -- YYACCEPT comes here.  |
7698 +`-------------------------------------*/
7699 +yyacceptlab:
7700 +  yyresult = 0;
7701 +  goto yyreturn;
7702 +
7703 +/*-----------------------------------.
7704 +| yyabortlab -- YYABORT comes here.  |
7705 +`-----------------------------------*/
7706 +yyabortlab:
7707 +  yyresult = 1;
7708 +  goto yyreturn;
7709 +
7710 +#ifndef yyoverflow
7711 +/*-------------------------------------------------.
7712 +| yyexhaustedlab -- memory exhaustion comes here.  |
7713 +`-------------------------------------------------*/
7714 +yyexhaustedlab:
7715 +  yyerror (YY_("memory exhausted"));
7716 +  yyresult = 2;
7717 +  /* Fall through.  */
7718 +#endif
7719 +
7720 +yyreturn:
7721 +  if (yychar != YYEOF && yychar != YYEMPTY)
7722 +     yydestruct ("Cleanup: discarding lookahead",
7723 +                yytoken, &yylval, &yylloc);
7724 +  /* Do not reclaim the symbols of the rule which action triggered
7725 +     this YYABORT or YYACCEPT.  */
7726 +  YYPOPSTACK (yylen);
7727 +  YY_STACK_PRINT (yyss, yyssp);
7728 +  while (yyssp != yyss)
7729 +    {
7730 +      yydestruct ("Cleanup: popping",
7731 +                 yystos[*yyssp], yyvsp, yylsp);
7732 +      YYPOPSTACK (1);
7733 +    }
7734 +#ifndef yyoverflow
7735 +  if (yyss != yyssa)
7736 +    YYSTACK_FREE (yyss);
7737 +#endif
7738 +#if YYERROR_VERBOSE
7739 +  if (yymsg != yymsgbuf)
7740 +    YYSTACK_FREE (yymsg);
7741 +#endif
7742 +  /* Make sure YYID is used.  */
7743 +  return YYID (yyresult);
7744 +}
7745 +
7746 +
7747 +#line 308 "dtc-parser.y"
7748 +
7749 +
7750 +void yyerror (char const *s)
7751 +{
7752 +       const char *fname = srcpos_filename_for_num(yylloc.filenum);
7753 +
7754 +       if (strcmp(fname, "-") == 0)
7755 +               fname = "stdin";
7756 +
7757 +       fprintf(stderr, "%s:%d %s\n",
7758 +               fname, yylloc.first_line, s);
7759 +}
7760 +
7761 +unsigned long long eval_literal(const char *s, int base, int bits)
7762 +{
7763 +       unsigned long long val;
7764 +       char *e;
7765 +
7766 +       errno = 0;
7767 +       val = strtoull(s, &e, base);
7768 +       if (*e)
7769 +               yyerror("bad characters in literal");
7770 +       else if ((errno == ERANGE)
7771 +                || ((bits < 64) && (val >= (1ULL << bits))))
7772 +               yyerror("literal out of range");
7773 +       else if (errno != 0)
7774 +               yyerror("bad literal");
7775 +       return val;
7776 +}
7777 +
7778 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped
7779 ===================================================================
7780 --- /dev/null
7781 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped
7782 @@ -0,0 +1,111 @@
7783 +/* A Bison parser, made by GNU Bison 2.3.  */
7784 +
7785 +/* Skeleton interface for Bison's Yacc-like parsers in C
7786 +
7787 +   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7788 +   Free Software Foundation, Inc.
7789 +
7790 +   This program is free software; you can redistribute it and/or modify
7791 +   it under the terms of the GNU General Public License as published by
7792 +   the Free Software Foundation; either version 2, or (at your option)
7793 +   any later version.
7794 +
7795 +   This program is distributed in the hope that it will be useful,
7796 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
7797 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7798 +   GNU General Public License for more details.
7799 +
7800 +   You should have received a copy of the GNU General Public License
7801 +   along with this program; if not, write to the Free Software
7802 +   Foundation, Inc., 51 Franklin Street, Fifth Floor,
7803 +   Boston, MA 02110-1301, USA.  */
7804 +
7805 +/* As a special exception, you may create a larger work that contains
7806 +   part or all of the Bison parser skeleton and distribute that work
7807 +   under terms of your choice, so long as that work isn't itself a
7808 +   parser generator using the skeleton or a modified version thereof
7809 +   as a parser skeleton.  Alternatively, if you modify or redistribute
7810 +   the parser skeleton itself, you may (at your option) remove this
7811 +   special exception, which will cause the skeleton and the resulting
7812 +   Bison output files to be licensed under the GNU General Public
7813 +   License without this special exception.
7814 +
7815 +   This special exception was added by the Free Software Foundation in
7816 +   version 2.2 of Bison.  */
7817 +
7818 +/* Tokens.  */
7819 +#ifndef YYTOKENTYPE
7820 +# define YYTOKENTYPE
7821 +   /* Put the tokens into the symbol table, so that GDB and other debuggers
7822 +      know about them.  */
7823 +   enum yytokentype {
7824 +     DT_V1 = 258,
7825 +     DT_MEMRESERVE = 259,
7826 +     DT_PROPNODENAME = 260,
7827 +     DT_LITERAL = 261,
7828 +     DT_LEGACYLITERAL = 262,
7829 +     DT_BASE = 263,
7830 +     DT_BYTE = 264,
7831 +     DT_STRING = 265,
7832 +     DT_LABEL = 266,
7833 +     DT_REF = 267
7834 +   };
7835 +#endif
7836 +/* Tokens.  */
7837 +#define DT_V1 258
7838 +#define DT_MEMRESERVE 259
7839 +#define DT_PROPNODENAME 260
7840 +#define DT_LITERAL 261
7841 +#define DT_LEGACYLITERAL 262
7842 +#define DT_BASE 263
7843 +#define DT_BYTE 264
7844 +#define DT_STRING 265
7845 +#define DT_LABEL 266
7846 +#define DT_REF 267
7847 +
7848 +
7849 +
7850 +
7851 +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
7852 +typedef union YYSTYPE
7853 +#line 34 "dtc-parser.y"
7854 +{
7855 +       char *propnodename;
7856 +       char *literal;
7857 +       char *labelref;
7858 +       unsigned int cbase;
7859 +       u8 byte;
7860 +       struct data data;
7861 +
7862 +       u64 addr;
7863 +       cell_t cell;
7864 +       struct property *prop;
7865 +       struct property *proplist;
7866 +       struct node *node;
7867 +       struct node *nodelist;
7868 +       struct reserve_info *re;
7869 +}
7870 +/* Line 1489 of yacc.c.  */
7871 +#line 90 "dtc-parser.tab.h"
7872 +       YYSTYPE;
7873 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */
7874 +# define YYSTYPE_IS_DECLARED 1
7875 +# define YYSTYPE_IS_TRIVIAL 1
7876 +#endif
7877 +
7878 +extern YYSTYPE yylval;
7879 +
7880 +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
7881 +typedef struct YYLTYPE
7882 +{
7883 +  int first_line;
7884 +  int first_column;
7885 +  int last_line;
7886 +  int last_column;
7887 +} YYLTYPE;
7888 +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
7889 +# define YYLTYPE_IS_DECLARED 1
7890 +# define YYLTYPE_IS_TRIVIAL 1
7891 +#endif
7892 +
7893 +extern YYLTYPE yylloc;
7894 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc-parser.y
7895 ===================================================================
7896 --- /dev/null
7897 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc-parser.y
7898 @@ -0,0 +1,336 @@
7899 +/*
7900 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
7901 + *
7902 + *
7903 + * This program is free software; you can redistribute it and/or
7904 + * modify it under the terms of the GNU General Public License as
7905 + * published by the Free Software Foundation; either version 2 of the
7906 + * License, or (at your option) any later version.
7907 + *
7908 + *  This program is distributed in the hope that it will be useful,
7909 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
7910 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7911 + *  General Public License for more details.
7912 + *
7913 + *  You should have received a copy of the GNU General Public License
7914 + *  along with this program; if not, write to the Free Software
7915 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
7916 + *                                                                   USA
7917 + */
7918 +
7919 +%locations
7920 +
7921 +%{
7922 +#include "dtc.h"
7923 +#include "srcpos.h"
7924 +
7925 +int yylex(void);
7926 +unsigned long long eval_literal(const char *s, int base, int bits);
7927 +
7928 +extern struct boot_info *the_boot_info;
7929 +
7930 +%}
7931 +
7932 +%union {
7933 +       char *propnodename;
7934 +       char *literal;
7935 +       char *labelref;
7936 +       unsigned int cbase;
7937 +       u8 byte;
7938 +       struct data data;
7939 +
7940 +       u64 addr;
7941 +       cell_t cell;
7942 +       struct property *prop;
7943 +       struct property *proplist;
7944 +       struct node *node;
7945 +       struct node *nodelist;
7946 +       struct reserve_info *re;
7947 +}
7948 +
7949 +%token DT_V1
7950 +%token DT_MEMRESERVE
7951 +%token <propnodename> DT_PROPNODENAME
7952 +%token <literal> DT_LITERAL
7953 +%token <literal> DT_LEGACYLITERAL
7954 +%token <cbase> DT_BASE
7955 +%token <byte> DT_BYTE
7956 +%token <data> DT_STRING
7957 +%token <labelref> DT_LABEL
7958 +%token <labelref> DT_REF
7959 +
7960 +%type <data> propdata
7961 +%type <data> propdataprefix
7962 +%type <re> memreserve
7963 +%type <re> memreserves
7964 +%type <re> v0_memreserve
7965 +%type <re> v0_memreserves
7966 +%type <addr> addr
7967 +%type <data> celllist
7968 +%type <cbase> cellbase
7969 +%type <cell> cellval
7970 +%type <data> bytestring
7971 +%type <prop> propdef
7972 +%type <proplist> proplist
7973 +
7974 +%type <node> devicetree
7975 +%type <node> nodedef
7976 +%type <node> subnode
7977 +%type <nodelist> subnodes
7978 +%type <labelref> label
7979 +
7980 +%%
7981 +
7982 +sourcefile:
7983 +         DT_V1 ';' memreserves devicetree
7984 +               {
7985 +                       the_boot_info = build_boot_info($3, $4);
7986 +               }
7987 +       | v0_memreserves devicetree
7988 +               {
7989 +                       the_boot_info = build_boot_info($1, $2);
7990 +               }
7991 +       ;
7992 +
7993 +memreserves:
7994 +         /* empty */
7995 +               {
7996 +                       $$ = NULL;
7997 +               }
7998 +       | memreserve memreserves
7999 +               {
8000 +                       $$ = chain_reserve_entry($1, $2);
8001 +               }
8002 +       ;
8003 +
8004 +memreserve:
8005 +         label DT_MEMRESERVE addr addr ';'
8006 +               {
8007 +                       $$ = build_reserve_entry($3, $4, $1);
8008 +               }
8009 +       ;
8010 +
8011 +v0_memreserves:
8012 +         /* empty */
8013 +               {
8014 +                       $$ = NULL;
8015 +               }
8016 +       | v0_memreserve v0_memreserves
8017 +               {
8018 +                       $$ = chain_reserve_entry($1, $2);
8019 +               };
8020 +       ;
8021 +
8022 +v0_memreserve:
8023 +         memreserve
8024 +               {
8025 +                       $$ = $1;
8026 +               }
8027 +       | label DT_MEMRESERVE addr '-' addr ';'
8028 +               {
8029 +                       $$ = build_reserve_entry($3, $5 - $3 + 1, $1);
8030 +               }
8031 +       ;
8032 +
8033 +addr:
8034 +         DT_LITERAL
8035 +               {
8036 +                       $$ = eval_literal($1, 0, 64);
8037 +               }
8038 +       | DT_LEGACYLITERAL
8039 +               {
8040 +                       $$ = eval_literal($1, 16, 64);
8041 +               }
8042 +         ;
8043 +
8044 +devicetree:
8045 +         '/' nodedef
8046 +               {
8047 +                       $$ = name_node($2, "", NULL);
8048 +               }
8049 +       ;
8050 +
8051 +nodedef:
8052 +         '{' proplist subnodes '}' ';'
8053 +               {
8054 +                       $$ = build_node($2, $3);
8055 +               }
8056 +       ;
8057 +
8058 +proplist:
8059 +         /* empty */
8060 +               {
8061 +                       $$ = NULL;
8062 +               }
8063 +       | proplist propdef
8064 +               {
8065 +                       $$ = chain_property($2, $1);
8066 +               }
8067 +       ;
8068 +
8069 +propdef:
8070 +         label DT_PROPNODENAME '=' propdata ';'
8071 +               {
8072 +                       $$ = build_property($2, $4, $1);
8073 +               }
8074 +       | label DT_PROPNODENAME ';'
8075 +               {
8076 +                       $$ = build_property($2, empty_data, $1);
8077 +               }
8078 +       ;
8079 +
8080 +propdata:
8081 +         propdataprefix DT_STRING
8082 +               {
8083 +                       $$ = data_merge($1, $2);
8084 +               }
8085 +       | propdataprefix '<' celllist '>'
8086 +               {
8087 +                       $$ = data_merge($1, $3);
8088 +               }
8089 +       | propdataprefix '[' bytestring ']'
8090 +               {
8091 +                       $$ = data_merge($1, $3);
8092 +               }
8093 +       | propdataprefix DT_REF
8094 +               {
8095 +                       $$ = data_add_marker($1, REF_PATH, $2);
8096 +               }
8097 +       | propdata DT_LABEL
8098 +               {
8099 +                       $$ = data_add_marker($1, LABEL, $2);
8100 +               }
8101 +       ;
8102 +
8103 +propdataprefix:
8104 +         /* empty */
8105 +               {
8106 +                       $$ = empty_data;
8107 +               }
8108 +       | propdata ','
8109 +               {
8110 +                       $$ = $1;
8111 +               }
8112 +       | propdataprefix DT_LABEL
8113 +               {
8114 +                       $$ = data_add_marker($1, LABEL, $2);
8115 +               }
8116 +       ;
8117 +
8118 +celllist:
8119 +         /* empty */
8120 +               {
8121 +                       $$ = empty_data;
8122 +               }
8123 +       | celllist cellval
8124 +               {
8125 +                       $$ = data_append_cell($1, $2);
8126 +               }
8127 +       | celllist DT_REF
8128 +               {
8129 +                       $$ = data_append_cell(data_add_marker($1, REF_PHANDLE,
8130 +                                                             $2), -1);
8131 +               }
8132 +       | celllist DT_LABEL
8133 +               {
8134 +                       $$ = data_add_marker($1, LABEL, $2);
8135 +               }
8136 +       ;
8137 +
8138 +cellbase:
8139 +         /* empty */
8140 +               {
8141 +                       $$ = 16;
8142 +               }
8143 +       | DT_BASE
8144 +       ;
8145 +
8146 +cellval:
8147 +         DT_LITERAL
8148 +               {
8149 +                       $$ = eval_literal($1, 0, 32);
8150 +               }
8151 +       | cellbase DT_LEGACYLITERAL
8152 +               {
8153 +                       $$ = eval_literal($2, $1, 32);
8154 +               }
8155 +       ;
8156 +
8157 +bytestring:
8158 +         /* empty */
8159 +               {
8160 +                       $$ = empty_data;
8161 +               }
8162 +       | bytestring DT_BYTE
8163 +               {
8164 +                       $$ = data_append_byte($1, $2);
8165 +               }
8166 +       | bytestring DT_LABEL
8167 +               {
8168 +                       $$ = data_add_marker($1, LABEL, $2);
8169 +               }
8170 +       ;
8171 +
8172 +subnodes:
8173 +         /* empty */
8174 +               {
8175 +                       $$ = NULL;
8176 +               }
8177 +       |  subnode subnodes
8178 +               {
8179 +                       $$ = chain_node($1, $2);
8180 +               }
8181 +       | subnode propdef
8182 +               {
8183 +                       yyerror("syntax error: properties must precede subnodes\n");
8184 +                       YYERROR;
8185 +               }
8186 +       ;
8187 +
8188 +subnode:
8189 +         label DT_PROPNODENAME nodedef
8190 +               {
8191 +                       $$ = name_node($3, $2, $1);
8192 +               }
8193 +       ;
8194 +
8195 +label:
8196 +         /* empty */
8197 +               {
8198 +                       $$ = NULL;
8199 +               }
8200 +       | DT_LABEL
8201 +               {
8202 +                       $$ = $1;
8203 +               }
8204 +       ;
8205 +
8206 +%%
8207 +
8208 +void yyerror (char const *s)
8209 +{
8210 +       const char *fname = srcpos_filename_for_num(yylloc.filenum);
8211 +
8212 +       if (strcmp(fname, "-") == 0)
8213 +               fname = "stdin";
8214 +
8215 +       fprintf(stderr, "%s:%d %s\n",
8216 +               fname, yylloc.first_line, s);
8217 +}
8218 +
8219 +unsigned long long eval_literal(const char *s, int base, int bits)
8220 +{
8221 +       unsigned long long val;
8222 +       char *e;
8223 +
8224 +       errno = 0;
8225 +       val = strtoull(s, &e, base);
8226 +       if (*e)
8227 +               yyerror("bad characters in literal");
8228 +       else if ((errno == ERANGE)
8229 +                || ((bits < 64) && (val >= (1ULL << bits))))
8230 +               yyerror("literal out of range");
8231 +       else if (errno != 0)
8232 +               yyerror("bad literal");
8233 +       return val;
8234 +}
8235 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc.c
8236 ===================================================================
8237 --- /dev/null
8238 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc.c
8239 @@ -0,0 +1,231 @@
8240 +/*
8241 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
8242 + *
8243 + *
8244 + * This program is free software; you can redistribute it and/or
8245 + * modify it under the terms of the GNU General Public License as
8246 + * published by the Free Software Foundation; either version 2 of the
8247 + * License, or (at your option) any later version.
8248 + *
8249 + *  This program is distributed in the hope that it will be useful,
8250 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8251 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8252 + *  General Public License for more details.
8253 + *
8254 + *  You should have received a copy of the GNU General Public License
8255 + *  along with this program; if not, write to the Free Software
8256 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
8257 + *                                                                   USA
8258 + */
8259 +
8260 +#include "dtc.h"
8261 +#include "srcpos.h"
8262 +
8263 +#include "version_gen.h"
8264 +
8265 +/*
8266 + * Command line options
8267 + */
8268 +int quiet;             /* Level of quietness */
8269 +int reservenum;                /* Number of memory reservation slots */
8270 +int minsize;           /* Minimum blob size */
8271 +int padsize;           /* Additional padding to blob */
8272 +
8273 +char *join_path(const char *path, const char *name)
8274 +{
8275 +       int lenp = strlen(path);
8276 +       int lenn = strlen(name);
8277 +       int len;
8278 +       int needslash = 1;
8279 +       char *str;
8280 +
8281 +       len = lenp + lenn + 2;
8282 +       if ((lenp > 0) && (path[lenp-1] == '/')) {
8283 +               needslash = 0;
8284 +               len--;
8285 +       }
8286 +
8287 +       str = xmalloc(len);
8288 +       memcpy(str, path, lenp);
8289 +       if (needslash) {
8290 +               str[lenp] = '/';
8291 +               lenp++;
8292 +       }
8293 +       memcpy(str+lenp, name, lenn+1);
8294 +       return str;
8295 +}
8296 +
8297 +void fill_fullpaths(struct node *tree, const char *prefix)
8298 +{
8299 +       struct node *child;
8300 +       const char *unit;
8301 +
8302 +       tree->fullpath = join_path(prefix, tree->name);
8303 +
8304 +       unit = strchr(tree->name, '@');
8305 +       if (unit)
8306 +               tree->basenamelen = unit - tree->name;
8307 +       else
8308 +               tree->basenamelen = strlen(tree->name);
8309 +
8310 +       for_each_child(tree, child)
8311 +               fill_fullpaths(child, tree->fullpath);
8312 +}
8313 +
8314 +static void  __attribute__ ((noreturn)) usage(void)
8315 +{
8316 +       fprintf(stderr, "Usage:\n");
8317 +       fprintf(stderr, "\tdtc [options] <input file>\n");
8318 +       fprintf(stderr, "\nOptions:\n");
8319 +       fprintf(stderr, "\t-h\n");
8320 +       fprintf(stderr, "\t\tThis help text\n");
8321 +       fprintf(stderr, "\t-q\n");
8322 +       fprintf(stderr, "\t\tQuiet: -q suppress warnings, -qq errors, -qqq all\n");
8323 +       fprintf(stderr, "\t-I <input format>\n");
8324 +       fprintf(stderr, "\t\tInput formats are:\n");
8325 +       fprintf(stderr, "\t\t\tdts - device tree source text\n");
8326 +       fprintf(stderr, "\t\t\tdtb - device tree blob\n");
8327 +       fprintf(stderr, "\t\t\tfs - /proc/device-tree style directory\n");
8328 +       fprintf(stderr, "\t-o <output file>\n");
8329 +       fprintf(stderr, "\t-O <output format>\n");
8330 +       fprintf(stderr, "\t\tOutput formats are:\n");
8331 +       fprintf(stderr, "\t\t\tdts - device tree source text\n");
8332 +       fprintf(stderr, "\t\t\tdtb - device tree blob\n");
8333 +       fprintf(stderr, "\t\t\tasm - assembler source\n");
8334 +       fprintf(stderr, "\t-V <output version>\n");
8335 +       fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", DEFAULT_FDT_VERSION);
8336 +       fprintf(stderr, "\t-R <number>\n");
8337 +       fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n");
8338 +       fprintf(stderr, "\t-S <bytes>\n");
8339 +       fprintf(stderr, "\t\tMake the blob at least <bytes> long (extra space)\n");
8340 +       fprintf(stderr, "\t-p <bytes>\n");
8341 +       fprintf(stderr, "\t\tAdd padding to the blob of <bytes> long (extra space)\n");
8342 +       fprintf(stderr, "\t-b <number>\n");
8343 +       fprintf(stderr, "\t\tSet the physical boot cpu\n");
8344 +       fprintf(stderr, "\t-f\n");
8345 +       fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n");
8346 +       fprintf(stderr, "\t-v\n");
8347 +       fprintf(stderr, "\t\tPrint DTC version and exit\n");
8348 +       exit(2);
8349 +}
8350 +
8351 +int main(int argc, char *argv[])
8352 +{
8353 +       struct boot_info *bi;
8354 +       const char *inform = "dts";
8355 +       const char *outform = "dts";
8356 +       const char *outname = "-";
8357 +       int force = 0, check = 0;
8358 +       const char *arg;
8359 +       int opt;
8360 +       FILE *inf = NULL;
8361 +       FILE *outf = NULL;
8362 +       int outversion = DEFAULT_FDT_VERSION;
8363 +       int boot_cpuid_phys = 0xfeedbeef;
8364 +
8365 +       quiet      = 0;
8366 +       reservenum = 0;
8367 +       minsize    = 0;
8368 +       padsize    = 0;
8369 +
8370 +       while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:v")) != EOF) {
8371 +               switch (opt) {
8372 +               case 'I':
8373 +                       inform = optarg;
8374 +                       break;
8375 +               case 'O':
8376 +                       outform = optarg;
8377 +                       break;
8378 +               case 'o':
8379 +                       outname = optarg;
8380 +                       break;
8381 +               case 'V':
8382 +                       outversion = strtol(optarg, NULL, 0);
8383 +                       break;
8384 +               case 'R':
8385 +                       reservenum = strtol(optarg, NULL, 0);
8386 +                       break;
8387 +               case 'S':
8388 +                       minsize = strtol(optarg, NULL, 0);
8389 +                       break;
8390 +               case 'p':
8391 +                       padsize = strtol(optarg, NULL, 0);
8392 +                       break;
8393 +               case 'f':
8394 +                       force = 1;
8395 +                       break;
8396 +               case 'c':
8397 +                       check = 1;
8398 +                       break;
8399 +               case 'q':
8400 +                       quiet++;
8401 +                       break;
8402 +               case 'b':
8403 +                       boot_cpuid_phys = strtol(optarg, NULL, 0);
8404 +                       break;
8405 +               case 'v':
8406 +                   printf("Version: %s\n", DTC_VERSION);
8407 +                   exit(0);
8408 +               case 'h':
8409 +               default:
8410 +                       usage();
8411 +               }
8412 +       }
8413 +
8414 +       if (argc > (optind+1))
8415 +               usage();
8416 +       else if (argc < (optind+1))
8417 +               arg = "-";
8418 +       else
8419 +               arg = argv[optind];
8420 +
8421 +       /* minsize and padsize are mutually exclusive */
8422 +       if ((minsize) && (padsize)) {
8423 +               die("Can't set both -p and -S\n");
8424 +       }
8425 +
8426 +       fprintf(stderr, "DTC: %s->%s  on file \"%s\"\n",
8427 +               inform, outform, arg);
8428 +
8429 +       if (streq(inform, "dts")) {
8430 +               bi = dt_from_source(arg);
8431 +       } else if (streq(inform, "fs")) {
8432 +               bi = dt_from_fs(arg);
8433 +       } else if(streq(inform, "dtb")) {
8434 +               inf = dtc_open_file(arg);
8435 +               bi = dt_from_blob(inf);
8436 +       } else {
8437 +               die("Unknown input format \"%s\"\n", inform);
8438 +       }
8439 +
8440 +       if (inf && (inf != stdin))
8441 +               fclose(inf);
8442 +
8443 +       if (! bi || ! bi->dt)
8444 +               die("Couldn't read input tree\n");
8445 +
8446 +       process_checks(force, bi, check, outversion, boot_cpuid_phys);
8447 +
8448 +       if (streq(outname, "-")) {
8449 +               outf = stdout;
8450 +       } else {
8451 +               outf = fopen(outname, "w");
8452 +               if (! outf)
8453 +                       die("Couldn't open output file %s: %s\n",
8454 +                           outname, strerror(errno));
8455 +       }
8456 +
8457 +       if (streq(outform, "dts")) {
8458 +               dt_to_source(outf, bi);
8459 +       } else if (streq(outform, "dtb")) {
8460 +               dt_to_blob(outf, bi, outversion, boot_cpuid_phys);
8461 +       } else if (streq(outform, "asm")) {
8462 +               dt_to_asm(outf, bi, outversion, boot_cpuid_phys);
8463 +       } else if (streq(outform, "null")) {
8464 +               /* do nothing */
8465 +       } else {
8466 +               die("Unknown output format \"%s\"\n", outform);
8467 +       }
8468 +
8469 +       exit(0);
8470 +}
8471 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc.h
8472 ===================================================================
8473 --- /dev/null
8474 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/dtc.h
8475 @@ -0,0 +1,269 @@
8476 +#ifndef _DTC_H
8477 +#define _DTC_H
8478 +
8479 +/*
8480 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
8481 + *
8482 + *
8483 + * This program is free software; you can redistribute it and/or
8484 + * modify it under the terms of the GNU General Public License as
8485 + * published by the Free Software Foundation; either version 2 of the
8486 + * License, or (at your option) any later version.
8487 + *
8488 + *  This program is distributed in the hope that it will be useful,
8489 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8490 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8491 + *  General Public License for more details.
8492 + *
8493 + *  You should have received a copy of the GNU General Public License
8494 + *  along with this program; if not, write to the Free Software
8495 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
8496 + *                                                                   USA
8497 + */
8498 +
8499 +#include <stdio.h>
8500 +#include <string.h>
8501 +#include <stdlib.h>
8502 +#include <stdint.h>
8503 +#include <stdarg.h>
8504 +#include <assert.h>
8505 +#include <ctype.h>
8506 +#include <errno.h>
8507 +#include <unistd.h>
8508 +#include <netinet/in.h>
8509 +#include <endian.h>
8510 +#include <byteswap.h>
8511 +
8512 +#include <fdt.h>
8513 +
8514 +#define DEFAULT_FDT_VERSION    17
8515 +/*
8516 + * Command line options
8517 + */
8518 +extern int quiet;              /* Level of quietness */
8519 +extern int reservenum;         /* Number of memory reservation slots */
8520 +extern int minsize;            /* Minimum blob size */
8521 +extern int padsize;            /* Additional padding to blob */
8522 +
8523 +static inline void __attribute__((noreturn)) die(char * str, ...)
8524 +{
8525 +       va_list ap;
8526 +
8527 +       va_start(ap, str);
8528 +       fprintf(stderr, "FATAL ERROR: ");
8529 +       vfprintf(stderr, str, ap);
8530 +       exit(1);
8531 +}
8532 +
8533 +static inline void *xmalloc(size_t len)
8534 +{
8535 +       void *new = malloc(len);
8536 +
8537 +       if (! new)
8538 +               die("malloc() failed\n");
8539 +
8540 +       return new;
8541 +}
8542 +
8543 +static inline void *xrealloc(void *p, size_t len)
8544 +{
8545 +       void *new = realloc(p, len);
8546 +
8547 +       if (! new)
8548 +               die("realloc() failed (len=%d)\n", len);
8549 +
8550 +       return new;
8551 +}
8552 +
8553 +typedef uint8_t u8;
8554 +typedef uint16_t u16;
8555 +typedef uint32_t u32;
8556 +typedef uint64_t u64;
8557 +typedef u32 cell_t;
8558 +
8559 +#define cpu_to_be16(x) htons(x)
8560 +#define be16_to_cpu(x) ntohs(x)
8561 +
8562 +#define cpu_to_be32(x) htonl(x)
8563 +#define be32_to_cpu(x) ntohl(x)
8564 +
8565 +#if __BYTE_ORDER == __BIG_ENDIAN
8566 +#define cpu_to_be64(x) (x)
8567 +#define be64_to_cpu(x) (x)
8568 +#else
8569 +#define cpu_to_be64(x) bswap_64(x)
8570 +#define be64_to_cpu(x) bswap_64(x)
8571 +#endif
8572 +
8573 +#define streq(a, b)    (strcmp((a), (b)) == 0)
8574 +#define strneq(a, b, n)        (strncmp((a), (b), (n)) == 0)
8575 +
8576 +#define ALIGN(x, a)    (((x) + (a) - 1) & ~((a) - 1))
8577 +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
8578 +
8579 +/* Data blobs */
8580 +enum markertype {
8581 +       REF_PHANDLE,
8582 +       REF_PATH,
8583 +       LABEL,
8584 +};
8585 +
8586 +struct  marker {
8587 +       enum markertype type;
8588 +       int offset;
8589 +       char *ref;
8590 +       struct marker *next;
8591 +};
8592 +
8593 +struct data {
8594 +       int len;
8595 +       char *val;
8596 +       int asize;
8597 +       struct marker *markers;
8598 +};
8599 +
8600 +
8601 +#define empty_data ((struct data){ /* all .members = 0 or NULL */ })
8602 +
8603 +#define for_each_marker(m) \
8604 +       for (; (m); (m) = (m)->next)
8605 +#define for_each_marker_of_type(m, t) \
8606 +       for_each_marker(m) \
8607 +               if ((m)->type == (t))
8608 +
8609 +void data_free(struct data d);
8610 +
8611 +struct data data_grow_for(struct data d, int xlen);
8612 +
8613 +struct data data_copy_mem(const char *mem, int len);
8614 +struct data data_copy_escape_string(const char *s, int len);
8615 +struct data data_copy_file(FILE *f, size_t len);
8616 +
8617 +struct data data_append_data(struct data d, const void *p, int len);
8618 +struct data data_insert_at_marker(struct data d, struct marker *m,
8619 +                                 const void *p, int len);
8620 +struct data data_merge(struct data d1, struct data d2);
8621 +struct data data_append_cell(struct data d, cell_t word);
8622 +struct data data_append_re(struct data d, const struct fdt_reserve_entry *re);
8623 +struct data data_append_addr(struct data d, u64 addr);
8624 +struct data data_append_byte(struct data d, uint8_t byte);
8625 +struct data data_append_zeroes(struct data d, int len);
8626 +struct data data_append_align(struct data d, int align);
8627 +
8628 +struct data data_add_marker(struct data d, enum markertype type, char *ref);
8629 +
8630 +int data_is_one_string(struct data d);
8631 +
8632 +/* DT constraints */
8633 +
8634 +#define MAX_PROPNAME_LEN       31
8635 +#define MAX_NODENAME_LEN       31
8636 +
8637 +/* Live trees */
8638 +struct property {
8639 +       char *name;
8640 +       struct data val;
8641 +
8642 +       struct property *next;
8643 +
8644 +       char *label;
8645 +};
8646 +
8647 +struct node {
8648 +       char *name;
8649 +       struct property *proplist;
8650 +       struct node *children;
8651 +
8652 +       struct node *parent;
8653 +       struct node *next_sibling;
8654 +
8655 +       char *fullpath;
8656 +       int basenamelen;
8657 +
8658 +       cell_t phandle;
8659 +       int addr_cells, size_cells;
8660 +
8661 +       char *label;
8662 +};
8663 +
8664 +#define for_each_property(n, p) \
8665 +       for ((p) = (n)->proplist; (p); (p) = (p)->next)
8666 +
8667 +#define for_each_child(n, c)   \
8668 +       for ((c) = (n)->children; (c); (c) = (c)->next_sibling)
8669 +
8670 +struct property *build_property(char *name, struct data val, char *label);
8671 +struct property *chain_property(struct property *first, struct property *list);
8672 +struct property *reverse_properties(struct property *first);
8673 +
8674 +struct node *build_node(struct property *proplist, struct node *children);
8675 +struct node *name_node(struct node *node, char *name, char *label);
8676 +struct node *chain_node(struct node *first, struct node *list);
8677 +
8678 +void add_property(struct node *node, struct property *prop);
8679 +void add_child(struct node *parent, struct node *child);
8680 +
8681 +const char *get_unitname(struct node *node);
8682 +struct property *get_property(struct node *node, const char *propname);
8683 +cell_t propval_cell(struct property *prop);
8684 +struct node *get_subnode(struct node *node, const char *nodename);
8685 +struct node *get_node_by_path(struct node *tree, const char *path);
8686 +struct node *get_node_by_label(struct node *tree, const char *label);
8687 +struct node *get_node_by_phandle(struct node *tree, cell_t phandle);
8688 +struct node *get_node_by_ref(struct node *tree, const char *ref);
8689 +cell_t get_node_phandle(struct node *root, struct node *node);
8690 +
8691 +/* Boot info (tree plus memreserve information */
8692 +
8693 +struct reserve_info {
8694 +       struct fdt_reserve_entry re;
8695 +
8696 +       struct reserve_info *next;
8697 +
8698 +       char *label;
8699 +};
8700 +
8701 +struct reserve_info *build_reserve_entry(u64 start, u64 len, char *label);
8702 +struct reserve_info *chain_reserve_entry(struct reserve_info *first,
8703 +                                        struct reserve_info *list);
8704 +struct reserve_info *add_reserve_entry(struct reserve_info *list,
8705 +                                      struct reserve_info *new);
8706 +
8707 +
8708 +struct boot_info {
8709 +       struct reserve_info *reservelist;
8710 +       struct node *dt;                /* the device tree */
8711 +};
8712 +
8713 +struct boot_info *build_boot_info(struct reserve_info *reservelist,
8714 +                                 struct node *tree);
8715 +
8716 +/* Checks */
8717 +
8718 +void process_checks(int force, struct boot_info *bi,
8719 +                   int checkflag, int outversion, int boot_cpuid_phys);
8720 +
8721 +/* Flattened trees */
8722 +
8723 +void dt_to_blob(FILE *f, struct boot_info *bi, int version,
8724 +               int boot_cpuid_phys);
8725 +void dt_to_asm(FILE *f, struct boot_info *bi, int version,
8726 +              int boot_cpuid_phys);
8727 +
8728 +struct boot_info *dt_from_blob(FILE *f);
8729 +
8730 +/* Tree source */
8731 +
8732 +void dt_to_source(FILE *f, struct boot_info *bi);
8733 +struct boot_info *dt_from_source(const char *f);
8734 +
8735 +/* FS trees */
8736 +
8737 +struct boot_info *dt_from_fs(const char *dirname);
8738 +
8739 +/* misc */
8740 +
8741 +char *join_path(const char *path, const char *name);
8742 +void fill_fullpaths(struct node *tree, const char *prefix);
8743 +
8744 +#endif /* _DTC_H */
8745 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/flattree.c
8746 ===================================================================
8747 --- /dev/null
8748 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/flattree.c
8749 @@ -0,0 +1,968 @@
8750 +/*
8751 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
8752 + *
8753 + *
8754 + * This program is free software; you can redistribute it and/or
8755 + * modify it under the terms of the GNU General Public License as
8756 + * published by the Free Software Foundation; either version 2 of the
8757 + * License, or (at your option) any later version.
8758 + *
8759 + *  This program is distributed in the hope that it will be useful,
8760 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8761 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8762 + *  General Public License for more details.
8763 + *
8764 + *  You should have received a copy of the GNU General Public License
8765 + *  along with this program; if not, write to the Free Software
8766 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
8767 + *                                                                   USA
8768 + */
8769 +
8770 +#include "dtc.h"
8771 +
8772 +#define FTF_FULLPATH   0x1
8773 +#define FTF_VARALIGN   0x2
8774 +#define FTF_NAMEPROPS  0x4
8775 +#define FTF_BOOTCPUID  0x8
8776 +#define FTF_STRTABSIZE 0x10
8777 +#define FTF_STRUCTSIZE 0x20
8778 +#define FTF_NOPS       0x40
8779 +
8780 +static struct version_info {
8781 +       int version;
8782 +       int last_comp_version;
8783 +       int hdr_size;
8784 +       int flags;
8785 +} version_table[] = {
8786 +       {1, 1, FDT_V1_SIZE,
8787 +        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS},
8788 +       {2, 1, FDT_V2_SIZE,
8789 +        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID},
8790 +       {3, 1, FDT_V3_SIZE,
8791 +        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID|FTF_STRTABSIZE},
8792 +       {16, 16, FDT_V3_SIZE,
8793 +        FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_NOPS},
8794 +       {17, 16, FDT_V17_SIZE,
8795 +        FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_STRUCTSIZE|FTF_NOPS},
8796 +};
8797 +
8798 +struct emitter {
8799 +       void (*cell)(void *, cell_t);
8800 +       void (*string)(void *, char *, int);
8801 +       void (*align)(void *, int);
8802 +       void (*data)(void *, struct data);
8803 +       void (*beginnode)(void *, const char *);
8804 +       void (*endnode)(void *, const char *);
8805 +       void (*property)(void *, const char *);
8806 +};
8807 +
8808 +static void bin_emit_cell(void *e, cell_t val)
8809 +{
8810 +       struct data *dtbuf = e;
8811 +
8812 +       *dtbuf = data_append_cell(*dtbuf, val);
8813 +}
8814 +
8815 +static void bin_emit_string(void *e, char *str, int len)
8816 +{
8817 +       struct data *dtbuf = e;
8818 +
8819 +       if (len == 0)
8820 +               len = strlen(str);
8821 +
8822 +       *dtbuf = data_append_data(*dtbuf, str, len);
8823 +       *dtbuf = data_append_byte(*dtbuf, '\0');
8824 +}
8825 +
8826 +static void bin_emit_align(void *e, int a)
8827 +{
8828 +       struct data *dtbuf = e;
8829 +
8830 +       *dtbuf = data_append_align(*dtbuf, a);
8831 +}
8832 +
8833 +static void bin_emit_data(void *e, struct data d)
8834 +{
8835 +       struct data *dtbuf = e;
8836 +
8837 +       *dtbuf = data_append_data(*dtbuf, d.val, d.len);
8838 +}
8839 +
8840 +static void bin_emit_beginnode(void *e, const char *label)
8841 +{
8842 +       bin_emit_cell(e, FDT_BEGIN_NODE);
8843 +}
8844 +
8845 +static void bin_emit_endnode(void *e, const char *label)
8846 +{
8847 +       bin_emit_cell(e, FDT_END_NODE);
8848 +}
8849 +
8850 +static void bin_emit_property(void *e, const char *label)
8851 +{
8852 +       bin_emit_cell(e, FDT_PROP);
8853 +}
8854 +
8855 +static struct emitter bin_emitter = {
8856 +       .cell = bin_emit_cell,
8857 +       .string = bin_emit_string,
8858 +       .align = bin_emit_align,
8859 +       .data = bin_emit_data,
8860 +       .beginnode = bin_emit_beginnode,
8861 +       .endnode = bin_emit_endnode,
8862 +       .property = bin_emit_property,
8863 +};
8864 +
8865 +static void emit_label(FILE *f, const char *prefix, const char *label)
8866 +{
8867 +       fprintf(f, "\t.globl\t%s_%s\n", prefix, label);
8868 +       fprintf(f, "%s_%s:\n", prefix, label);
8869 +       fprintf(f, "_%s_%s:\n", prefix, label);
8870 +}
8871 +
8872 +static void emit_offset_label(FILE *f, const char *label, int offset)
8873 +{
8874 +       fprintf(f, "\t.globl\t%s\n", label);
8875 +       fprintf(f, "%s\t= . + %d\n", label, offset);
8876 +}
8877 +
8878 +static void asm_emit_cell(void *e, cell_t val)
8879 +{
8880 +       FILE *f = e;
8881 +
8882 +       fprintf(f, "\t.long\t0x%x\n", val);
8883 +}
8884 +
8885 +static void asm_emit_string(void *e, char *str, int len)
8886 +{
8887 +       FILE *f = e;
8888 +       char c = 0;
8889 +
8890 +       if (len != 0) {
8891 +               /* XXX: ewww */
8892 +               c = str[len];
8893 +               str[len] = '\0';
8894 +       }
8895 +
8896 +       fprintf(f, "\t.string\t\"%s\"\n", str);
8897 +
8898 +       if (len != 0) {
8899 +               str[len] = c;
8900 +       }
8901 +}
8902 +
8903 +static void asm_emit_align(void *e, int a)
8904 +{
8905 +       FILE *f = e;
8906 +
8907 +       fprintf(f, "\t.balign\t%d\n", a);
8908 +}
8909 +
8910 +static void asm_emit_data(void *e, struct data d)
8911 +{
8912 +       FILE *f = e;
8913 +       int off = 0;
8914 +       struct marker *m;
8915 +
8916 +       m = d.markers;
8917 +       while (m) {
8918 +               if (m->type == LABEL)
8919 +                       emit_offset_label(f, m->ref, m->offset);
8920 +               m = m->next;
8921 +       }
8922 +
8923 +       while ((d.len - off) >= sizeof(u32)) {
8924 +               fprintf(f, "\t.long\t0x%x\n",
8925 +                       be32_to_cpu(*((u32 *)(d.val+off))));
8926 +               off += sizeof(u32);
8927 +       }
8928 +
8929 +       if ((d.len - off) >= sizeof(u16)) {
8930 +               fprintf(f, "\t.short\t0x%hx\n",
8931 +                       be16_to_cpu(*((u16 *)(d.val+off))));
8932 +               off += sizeof(u16);
8933 +       }
8934 +
8935 +       if ((d.len - off) >= 1) {
8936 +               fprintf(f, "\t.byte\t0x%hhx\n", d.val[off]);
8937 +               off += 1;
8938 +       }
8939 +
8940 +       assert(off == d.len);
8941 +}
8942 +
8943 +static void asm_emit_beginnode(void *e, const char *label)
8944 +{
8945 +       FILE *f = e;
8946 +
8947 +       if (label) {
8948 +               fprintf(f, "\t.globl\t%s\n", label);
8949 +               fprintf(f, "%s:\n", label);
8950 +       }
8951 +       fprintf(f, "\t.long\tFDT_BEGIN_NODE\n");
8952 +}
8953 +
8954 +static void asm_emit_endnode(void *e, const char *label)
8955 +{
8956 +       FILE *f = e;
8957 +
8958 +       fprintf(f, "\t.long\tFDT_END_NODE\n");
8959 +       if (label) {
8960 +               fprintf(f, "\t.globl\t%s_end\n", label);
8961 +               fprintf(f, "%s_end:\n", label);
8962 +       }
8963 +}
8964 +
8965 +static void asm_emit_property(void *e, const char *label)
8966 +{
8967 +       FILE *f = e;
8968 +
8969 +       if (label) {
8970 +               fprintf(f, "\t.globl\t%s\n", label);
8971 +               fprintf(f, "%s:\n", label);
8972 +       }
8973 +       fprintf(f, "\t.long\tFDT_PROP\n");
8974 +}
8975 +
8976 +static struct emitter asm_emitter = {
8977 +       .cell = asm_emit_cell,
8978 +       .string = asm_emit_string,
8979 +       .align = asm_emit_align,
8980 +       .data = asm_emit_data,
8981 +       .beginnode = asm_emit_beginnode,
8982 +       .endnode = asm_emit_endnode,
8983 +       .property = asm_emit_property,
8984 +};
8985 +
8986 +static int stringtable_insert(struct data *d, const char *str)
8987 +{
8988 +       int i;
8989 +
8990 +       /* FIXME: do this more efficiently? */
8991 +
8992 +       for (i = 0; i < d->len; i++) {
8993 +               if (streq(str, d->val + i))
8994 +                       return i;
8995 +       }
8996 +
8997 +       *d = data_append_data(*d, str, strlen(str)+1);
8998 +       return i;
8999 +}
9000 +
9001 +static void flatten_tree(struct node *tree, struct emitter *emit,
9002 +                        void *etarget, struct data *strbuf,
9003 +                        struct version_info *vi)
9004 +{
9005 +       struct property *prop;
9006 +       struct node *child;
9007 +       int seen_name_prop = 0;
9008 +
9009 +       emit->beginnode(etarget, tree->label);
9010 +
9011 +       if (vi->flags & FTF_FULLPATH)
9012 +               emit->string(etarget, tree->fullpath, 0);
9013 +       else
9014 +               emit->string(etarget, tree->name, 0);
9015 +
9016 +       emit->align(etarget, sizeof(cell_t));
9017 +
9018 +       for_each_property(tree, prop) {
9019 +               int nameoff;
9020 +
9021 +               if (streq(prop->name, "name"))
9022 +                       seen_name_prop = 1;
9023 +
9024 +               nameoff = stringtable_insert(strbuf, prop->name);
9025 +
9026 +               emit->property(etarget, prop->label);
9027 +               emit->cell(etarget, prop->val.len);
9028 +               emit->cell(etarget, nameoff);
9029 +
9030 +               if ((vi->flags & FTF_VARALIGN) && (prop->val.len >= 8))
9031 +                       emit->align(etarget, 8);
9032 +
9033 +               emit->data(etarget, prop->val);
9034 +               emit->align(etarget, sizeof(cell_t));
9035 +       }
9036 +
9037 +       if ((vi->flags & FTF_NAMEPROPS) && !seen_name_prop) {
9038 +               emit->property(etarget, NULL);
9039 +               emit->cell(etarget, tree->basenamelen+1);
9040 +               emit->cell(etarget, stringtable_insert(strbuf, "name"));
9041 +
9042 +               if ((vi->flags & FTF_VARALIGN) && ((tree->basenamelen+1) >= 8))
9043 +                       emit->align(etarget, 8);
9044 +
9045 +               emit->string(etarget, tree->name, tree->basenamelen);
9046 +               emit->align(etarget, sizeof(cell_t));
9047 +       }
9048 +
9049 +       for_each_child(tree, child) {
9050 +               flatten_tree(child, emit, etarget, strbuf, vi);
9051 +       }
9052 +
9053 +       emit->endnode(etarget, tree->label);
9054 +}
9055 +
9056 +static struct data flatten_reserve_list(struct reserve_info *reservelist,
9057 +                                struct version_info *vi)
9058 +{
9059 +       struct reserve_info *re;
9060 +       struct data d = empty_data;
9061 +       static struct fdt_reserve_entry null_re = {0,0};
9062 +       int    j;
9063 +
9064 +       for (re = reservelist; re; re = re->next) {
9065 +               d = data_append_re(d, &re->re);
9066 +       }
9067 +       /*
9068 +        * Add additional reserved slots if the user asked for them.
9069 +        */
9070 +       for (j = 0; j < reservenum; j++) {
9071 +               d = data_append_re(d, &null_re);
9072 +       }
9073 +
9074 +       return d;
9075 +}
9076 +
9077 +static void make_fdt_header(struct fdt_header *fdt,
9078 +                           struct version_info *vi,
9079 +                           int reservesize, int dtsize, int strsize,
9080 +                           int boot_cpuid_phys)
9081 +{
9082 +       int reserve_off;
9083 +
9084 +       reservesize += sizeof(struct fdt_reserve_entry);
9085 +
9086 +       memset(fdt, 0xff, sizeof(*fdt));
9087 +
9088 +       fdt->magic = cpu_to_be32(FDT_MAGIC);
9089 +       fdt->version = cpu_to_be32(vi->version);
9090 +       fdt->last_comp_version = cpu_to_be32(vi->last_comp_version);
9091 +
9092 +       /* Reserve map should be doubleword aligned */
9093 +       reserve_off = ALIGN(vi->hdr_size, 8);
9094 +
9095 +       fdt->off_mem_rsvmap = cpu_to_be32(reserve_off);
9096 +       fdt->off_dt_struct = cpu_to_be32(reserve_off + reservesize);
9097 +       fdt->off_dt_strings = cpu_to_be32(reserve_off + reservesize
9098 +                                         + dtsize);
9099 +       fdt->totalsize = cpu_to_be32(reserve_off + reservesize + dtsize + strsize);
9100 +
9101 +       if (vi->flags & FTF_BOOTCPUID)
9102 +               fdt->boot_cpuid_phys = cpu_to_be32(boot_cpuid_phys);
9103 +       if (vi->flags & FTF_STRTABSIZE)
9104 +               fdt->size_dt_strings = cpu_to_be32(strsize);
9105 +       if (vi->flags & FTF_STRUCTSIZE)
9106 +               fdt->size_dt_struct = cpu_to_be32(dtsize);
9107 +}
9108 +
9109 +void dt_to_blob(FILE *f, struct boot_info *bi, int version,
9110 +               int boot_cpuid_phys)
9111 +{
9112 +       struct version_info *vi = NULL;
9113 +       int i;
9114 +       struct data blob       = empty_data;
9115 +       struct data reservebuf = empty_data;
9116 +       struct data dtbuf      = empty_data;
9117 +       struct data strbuf     = empty_data;
9118 +       struct fdt_header fdt;
9119 +       int padlen = 0;
9120 +
9121 +       for (i = 0; i < ARRAY_SIZE(version_table); i++) {
9122 +               if (version_table[i].version == version)
9123 +                       vi = &version_table[i];
9124 +       }
9125 +       if (!vi)
9126 +               die("Unknown device tree blob version %d\n", version);
9127 +
9128 +       flatten_tree(bi->dt, &bin_emitter, &dtbuf, &strbuf, vi);
9129 +       bin_emit_cell(&dtbuf, FDT_END);
9130 +
9131 +       reservebuf = flatten_reserve_list(bi->reservelist, vi);
9132 +
9133 +       /* Make header */
9134 +       make_fdt_header(&fdt, vi, reservebuf.len, dtbuf.len, strbuf.len,
9135 +                       boot_cpuid_phys);
9136 +
9137 +       /*
9138 +        * If the user asked for more space than is used, adjust the totalsize.
9139 +        */
9140 +       if (minsize > 0) {
9141 +               padlen = minsize - be32_to_cpu(fdt.totalsize);
9142 +               if ((padlen < 0) && (quiet < 1))
9143 +                       fprintf(stderr,
9144 +                               "Warning: blob size %d >= minimum size %d\n",
9145 +                               be32_to_cpu(fdt.totalsize), minsize);
9146 +       }
9147 +
9148 +       if (padsize > 0)
9149 +               padlen = padsize;
9150 +
9151 +       if (padlen > 0) {
9152 +               int tsize = be32_to_cpu(fdt.totalsize);
9153 +               tsize += padlen;
9154 +               fdt.totalsize = cpu_to_be32(tsize);
9155 +       }
9156 +
9157 +       /*
9158 +        * Assemble the blob: start with the header, add with alignment
9159 +        * the reserve buffer, add the reserve map terminating zeroes,
9160 +        * the device tree itself, and finally the strings.
9161 +        */
9162 +       blob = data_append_data(blob, &fdt, sizeof(fdt));
9163 +       blob = data_append_align(blob, 8);
9164 +       blob = data_merge(blob, reservebuf);
9165 +       blob = data_append_zeroes(blob, sizeof(struct fdt_reserve_entry));
9166 +       blob = data_merge(blob, dtbuf);
9167 +       blob = data_merge(blob, strbuf);
9168 +
9169 +       /*
9170 +        * If the user asked for more space than is used, pad out the blob.
9171 +        */
9172 +       if (padlen > 0)
9173 +               blob = data_append_zeroes(blob, padlen);
9174 +
9175 +       fwrite(blob.val, blob.len, 1, f);
9176 +
9177 +       if (ferror(f))
9178 +               die("Error writing device tree blob: %s\n", strerror(errno));
9179 +
9180 +       /*
9181 +        * data_merge() frees the right-hand element so only the blob
9182 +        * remains to be freed.
9183 +        */
9184 +       data_free(blob);
9185 +}
9186 +
9187 +static void dump_stringtable_asm(FILE *f, struct data strbuf)
9188 +{
9189 +       const char *p;
9190 +       int len;
9191 +
9192 +       p = strbuf.val;
9193 +
9194 +       while (p < (strbuf.val + strbuf.len)) {
9195 +               len = strlen(p);
9196 +               fprintf(f, "\t.string \"%s\"\n", p);
9197 +               p += len+1;
9198 +       }
9199 +}
9200 +
9201 +void dt_to_asm(FILE *f, struct boot_info *bi, int version, int boot_cpuid_phys)
9202 +{
9203 +       struct version_info *vi = NULL;
9204 +       int i;
9205 +       struct data strbuf = empty_data;
9206 +       struct reserve_info *re;
9207 +       const char *symprefix = "dt";
9208 +
9209 +       for (i = 0; i < ARRAY_SIZE(version_table); i++) {
9210 +               if (version_table[i].version == version)
9211 +                       vi = &version_table[i];
9212 +       }
9213 +       if (!vi)
9214 +               die("Unknown device tree blob version %d\n", version);
9215 +
9216 +       fprintf(f, "/* autogenerated by dtc, do not edit */\n\n");
9217 +       fprintf(f, "#define FDT_MAGIC 0x%x\n", FDT_MAGIC);
9218 +       fprintf(f, "#define FDT_BEGIN_NODE 0x%x\n", FDT_BEGIN_NODE);
9219 +       fprintf(f, "#define FDT_END_NODE 0x%x\n", FDT_END_NODE);
9220 +       fprintf(f, "#define FDT_PROP 0x%x\n", FDT_PROP);
9221 +       fprintf(f, "#define FDT_END 0x%x\n", FDT_END);
9222 +       fprintf(f, "\n");
9223 +
9224 +       emit_label(f, symprefix, "blob_start");
9225 +       emit_label(f, symprefix, "header");
9226 +       fprintf(f, "\t.long\tFDT_MAGIC\t\t\t\t/* magic */\n");
9227 +       fprintf(f, "\t.long\t_%s_blob_abs_end - _%s_blob_start\t/* totalsize */\n",
9228 +               symprefix, symprefix);
9229 +       fprintf(f, "\t.long\t_%s_struct_start - _%s_blob_start\t/* off_dt_struct */\n",
9230 +               symprefix, symprefix);
9231 +       fprintf(f, "\t.long\t_%s_strings_start - _%s_blob_start\t/* off_dt_strings */\n",
9232 +               symprefix, symprefix);
9233 +       fprintf(f, "\t.long\t_%s_reserve_map - _%s_blob_start\t/* off_dt_strings */\n",
9234 +               symprefix, symprefix);
9235 +       fprintf(f, "\t.long\t%d\t\t\t\t\t/* version */\n", vi->version);
9236 +       fprintf(f, "\t.long\t%d\t\t\t\t\t/* last_comp_version */\n",
9237 +               vi->last_comp_version);
9238 +
9239 +       if (vi->flags & FTF_BOOTCPUID)
9240 +               fprintf(f, "\t.long\t%i\t\t\t\t\t/* boot_cpuid_phys */\n",
9241 +                       boot_cpuid_phys);
9242 +
9243 +       if (vi->flags & FTF_STRTABSIZE)
9244 +               fprintf(f, "\t.long\t_%s_strings_end - _%s_strings_start\t/* size_dt_strings */\n",
9245 +                       symprefix, symprefix);
9246 +
9247 +       if (vi->flags & FTF_STRUCTSIZE)
9248 +               fprintf(f, "\t.long\t_%s_struct_end - _%s_struct_start\t/* size_dt_struct */\n",
9249 +                       symprefix, symprefix);
9250 +
9251 +       /*
9252 +        * Reserve map entries.
9253 +        * Align the reserve map to a doubleword boundary.
9254 +        * Each entry is an (address, size) pair of u64 values.
9255 +        * Always supply a zero-sized temination entry.
9256 +        */
9257 +       asm_emit_align(f, 8);
9258 +       emit_label(f, symprefix, "reserve_map");
9259 +
9260 +       fprintf(f, "/* Memory reserve map from source file */\n");
9261 +
9262 +       /*
9263 +        * Use .long on high and low halfs of u64s to avoid .quad
9264 +        * as it appears .quad isn't available in some assemblers.
9265 +        */
9266 +       for (re = bi->reservelist; re; re = re->next) {
9267 +               if (re->label) {
9268 +                       fprintf(f, "\t.globl\t%s\n", re->label);
9269 +                       fprintf(f, "%s:\n", re->label);
9270 +               }
9271 +               fprintf(f, "\t.long\t0x%08x, 0x%08x\n",
9272 +                       (unsigned int)(re->re.address >> 32),
9273 +                       (unsigned int)(re->re.address & 0xffffffff));
9274 +               fprintf(f, "\t.long\t0x%08x, 0x%08x\n",
9275 +                       (unsigned int)(re->re.size >> 32),
9276 +                       (unsigned int)(re->re.size & 0xffffffff));
9277 +       }
9278 +       for (i = 0; i < reservenum; i++) {
9279 +               fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
9280 +       }
9281 +
9282 +       fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
9283 +
9284 +       emit_label(f, symprefix, "struct_start");
9285 +       flatten_tree(bi->dt, &asm_emitter, f, &strbuf, vi);
9286 +       fprintf(f, "\t.long\tFDT_END\n");
9287 +       emit_label(f, symprefix, "struct_end");
9288 +
9289 +       emit_label(f, symprefix, "strings_start");
9290 +       dump_stringtable_asm(f, strbuf);
9291 +       emit_label(f, symprefix, "strings_end");
9292 +
9293 +       emit_label(f, symprefix, "blob_end");
9294 +
9295 +       /*
9296 +        * If the user asked for more space than is used, pad it out.
9297 +        */
9298 +       if (minsize > 0) {
9299 +               fprintf(f, "\t.space\t%d - (_%s_blob_end - _%s_blob_start), 0\n",
9300 +                       minsize, symprefix, symprefix);
9301 +       }
9302 +       if (padsize > 0) {
9303 +               fprintf(f, "\t.space\t%d, 0\n", padsize);
9304 +       }
9305 +       emit_label(f, symprefix, "blob_abs_end");
9306 +
9307 +       data_free(strbuf);
9308 +}
9309 +
9310 +struct inbuf {
9311 +       char *base, *limit, *ptr;
9312 +};
9313 +
9314 +static void inbuf_init(struct inbuf *inb, void *base, void *limit)
9315 +{
9316 +       inb->base = base;
9317 +       inb->limit = limit;
9318 +       inb->ptr = inb->base;
9319 +}
9320 +
9321 +static void flat_read_chunk(struct inbuf *inb, void *p, int len)
9322 +{
9323 +       if ((inb->ptr + len) > inb->limit)
9324 +               die("Premature end of data parsing flat device tree\n");
9325 +
9326 +       memcpy(p, inb->ptr, len);
9327 +
9328 +       inb->ptr += len;
9329 +}
9330 +
9331 +static u32 flat_read_word(struct inbuf *inb)
9332 +{
9333 +       u32 val;
9334 +
9335 +       assert(((inb->ptr - inb->base) % sizeof(val)) == 0);
9336 +
9337 +       flat_read_chunk(inb, &val, sizeof(val));
9338 +
9339 +       return be32_to_cpu(val);
9340 +}
9341 +
9342 +static void flat_realign(struct inbuf *inb, int align)
9343 +{
9344 +       int off = inb->ptr - inb->base;
9345 +
9346 +       inb->ptr = inb->base + ALIGN(off, align);
9347 +       if (inb->ptr > inb->limit)
9348 +               die("Premature end of data parsing flat device tree\n");
9349 +}
9350 +
9351 +static char *flat_read_string(struct inbuf *inb)
9352 +{
9353 +       int len = 0;
9354 +       const char *p = inb->ptr;
9355 +       char *str;
9356 +
9357 +       do {
9358 +               if (p >= inb->limit)
9359 +                       die("Premature end of data parsing flat device tree\n");
9360 +               len++;
9361 +       } while ((*p++) != '\0');
9362 +
9363 +       str = strdup(inb->ptr);
9364 +
9365 +       inb->ptr += len;
9366 +
9367 +       flat_realign(inb, sizeof(u32));
9368 +
9369 +       return str;
9370 +}
9371 +
9372 +static struct data flat_read_data(struct inbuf *inb, int len)
9373 +{
9374 +       struct data d = empty_data;
9375 +
9376 +       if (len == 0)
9377 +               return empty_data;
9378 +
9379 +       d = data_grow_for(d, len);
9380 +       d.len = len;
9381 +
9382 +       flat_read_chunk(inb, d.val, len);
9383 +
9384 +       flat_realign(inb, sizeof(u32));
9385 +
9386 +       return d;
9387 +}
9388 +
9389 +static char *flat_read_stringtable(struct inbuf *inb, int offset)
9390 +{
9391 +       const char *p;
9392 +
9393 +       p = inb->base + offset;
9394 +       while (1) {
9395 +               if (p >= inb->limit || p < inb->base)
9396 +                       die("String offset %d overruns string table\n",
9397 +                           offset);
9398 +
9399 +               if (*p == '\0')
9400 +                       break;
9401 +
9402 +               p++;
9403 +       }
9404 +
9405 +       return strdup(inb->base + offset);
9406 +}
9407 +
9408 +static struct property *flat_read_property(struct inbuf *dtbuf,
9409 +                                          struct inbuf *strbuf, int flags)
9410 +{
9411 +       u32 proplen, stroff;
9412 +       char *name;
9413 +       struct data val;
9414 +
9415 +       proplen = flat_read_word(dtbuf);
9416 +       stroff = flat_read_word(dtbuf);
9417 +
9418 +       name = flat_read_stringtable(strbuf, stroff);
9419 +
9420 +       if ((flags & FTF_VARALIGN) && (proplen >= 8))
9421 +               flat_realign(dtbuf, 8);
9422 +
9423 +       val = flat_read_data(dtbuf, proplen);
9424 +
9425 +       return build_property(name, val, NULL);
9426 +}
9427 +
9428 +
9429 +static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb)
9430 +{
9431 +       struct reserve_info *reservelist = NULL;
9432 +       struct reserve_info *new;
9433 +       const char *p;
9434 +       struct fdt_reserve_entry re;
9435 +
9436 +       /*
9437 +        * Each entry is a pair of u64 (addr, size) values for 4 cell_t's.
9438 +        * List terminates at an entry with size equal to zero.
9439 +        *
9440 +        * First pass, count entries.
9441 +        */
9442 +       p = inb->ptr;
9443 +       while (1) {
9444 +               flat_read_chunk(inb, &re, sizeof(re));
9445 +               re.address  = be64_to_cpu(re.address);
9446 +               re.size = be64_to_cpu(re.size);
9447 +               if (re.size == 0)
9448 +                       break;
9449 +
9450 +               new = build_reserve_entry(re.address, re.size, NULL);
9451 +               reservelist = add_reserve_entry(reservelist, new);
9452 +       }
9453 +
9454 +       return reservelist;
9455 +}
9456 +
9457 +
9458 +static char *nodename_from_path(const char *ppath, const char *cpath)
9459 +{
9460 +       const char *lslash;
9461 +       int plen;
9462 +
9463 +       lslash = strrchr(cpath, '/');
9464 +       if (! lslash)
9465 +               return NULL;
9466 +
9467 +       plen = lslash - cpath;
9468 +
9469 +       if (streq(cpath, "/") && streq(ppath, ""))
9470 +               return "";
9471 +
9472 +       if ((plen == 0) && streq(ppath, "/"))
9473 +               return strdup(lslash+1);
9474 +
9475 +       if (! strneq(ppath, cpath, plen))
9476 +               return NULL;
9477 +
9478 +       return strdup(lslash+1);
9479 +}
9480 +
9481 +static const char PROPCHAR[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,._+*#?-";
9482 +static const char UNITCHAR[] = "0123456789abcdef,";
9483 +
9484 +static int check_node_name(const char *name)
9485 +{
9486 +       const char *atpos;
9487 +       int basenamelen;
9488 +
9489 +       atpos = strrchr(name, '@');
9490 +
9491 +       if (atpos)
9492 +               basenamelen = atpos - name;
9493 +       else
9494 +               basenamelen = strlen(name);
9495 +
9496 +       if (strspn(name, PROPCHAR) < basenamelen)
9497 +               return -1;
9498 +
9499 +       if (atpos
9500 +           && ((basenamelen + 1 + strspn(atpos+1, UNITCHAR)) < strlen(name)))
9501 +               return -1;
9502 +
9503 +       return basenamelen;
9504 +}
9505 +
9506 +static struct node *unflatten_tree(struct inbuf *dtbuf,
9507 +                                  struct inbuf *strbuf,
9508 +                                  const char *parent_path, int flags)
9509 +{
9510 +       struct node *node;
9511 +       u32 val;
9512 +
9513 +       node = build_node(NULL, NULL);
9514 +
9515 +       if (flags & FTF_FULLPATH) {
9516 +               node->fullpath = flat_read_string(dtbuf);
9517 +               node->name = nodename_from_path(parent_path, node->fullpath);
9518 +
9519 +               if (! node->name)
9520 +                       die("Path \"%s\" is not valid as a child of \"%s\"\n",
9521 +                           node->fullpath, parent_path);
9522 +       } else {
9523 +               node->name = flat_read_string(dtbuf);
9524 +               node->fullpath = join_path(parent_path, node->name);
9525 +       }
9526 +
9527 +       node->basenamelen = check_node_name(node->name);
9528 +       if (node->basenamelen < 0) {
9529 +               fprintf(stderr, "Warning \"%s\" has incorrect format\n", node->name);
9530 +       }
9531 +
9532 +       do {
9533 +               struct property *prop;
9534 +               struct node *child;
9535 +
9536 +               val = flat_read_word(dtbuf);
9537 +               switch (val) {
9538 +               case FDT_PROP:
9539 +                       if (node->children)
9540 +                               fprintf(stderr, "Warning: Flat tree input has "
9541 +                                       "subnodes preceding a property.\n");
9542 +                       prop = flat_read_property(dtbuf, strbuf, flags);
9543 +                       add_property(node, prop);
9544 +                       break;
9545 +
9546 +               case FDT_BEGIN_NODE:
9547 +                       child = unflatten_tree(dtbuf,strbuf, node->fullpath,
9548 +                                              flags);
9549 +                       add_child(node, child);
9550 +                       break;
9551 +
9552 +               case FDT_END_NODE:
9553 +                       break;
9554 +
9555 +               case FDT_END:
9556 +                       die("Premature FDT_END in device tree blob\n");
9557 +                       break;
9558 +
9559 +               case FDT_NOP:
9560 +                       if (!(flags & FTF_NOPS))
9561 +                               fprintf(stderr, "Warning: NOP tag found in flat tree"
9562 +                                       " version <16\n");
9563 +
9564 +                       /* Ignore */
9565 +                       break;
9566 +
9567 +               default:
9568 +                       die("Invalid opcode word %08x in device tree blob\n",
9569 +                           val);
9570 +               }
9571 +       } while (val != FDT_END_NODE);
9572 +
9573 +       return node;
9574 +}
9575 +
9576 +
9577 +struct boot_info *dt_from_blob(FILE *f)
9578 +{
9579 +       u32 magic, totalsize, version, size_str, size_dt;
9580 +       u32 off_dt, off_str, off_mem_rsvmap;
9581 +       int rc;
9582 +       char *blob;
9583 +       struct fdt_header *fdt;
9584 +       char *p;
9585 +       struct inbuf dtbuf, strbuf;
9586 +       struct inbuf memresvbuf;
9587 +       int sizeleft;
9588 +       struct reserve_info *reservelist;
9589 +       struct node *tree;
9590 +       u32 val;
9591 +       int flags = 0;
9592 +
9593 +       rc = fread(&magic, sizeof(magic), 1, f);
9594 +       if (ferror(f))
9595 +               die("Error reading DT blob magic number: %s\n",
9596 +                   strerror(errno));
9597 +       if (rc < 1) {
9598 +               if (feof(f))
9599 +                       die("EOF reading DT blob magic number\n");
9600 +               else
9601 +                       die("Mysterious short read reading magic number\n");
9602 +       }
9603 +
9604 +       magic = be32_to_cpu(magic);
9605 +       if (magic != FDT_MAGIC)
9606 +               die("Blob has incorrect magic number\n");
9607 +
9608 +       rc = fread(&totalsize, sizeof(totalsize), 1, f);
9609 +       if (ferror(f))
9610 +               die("Error reading DT blob size: %s\n", strerror(errno));
9611 +       if (rc < 1) {
9612 +               if (feof(f))
9613 +                       die("EOF reading DT blob size\n");
9614 +               else
9615 +                       die("Mysterious short read reading blob size\n");
9616 +       }
9617 +
9618 +       totalsize = be32_to_cpu(totalsize);
9619 +       if (totalsize < FDT_V1_SIZE)
9620 +               die("DT blob size (%d) is too small\n", totalsize);
9621 +
9622 +       blob = xmalloc(totalsize);
9623 +
9624 +       fdt = (struct fdt_header *)blob;
9625 +       fdt->magic = cpu_to_be32(magic);
9626 +       fdt->totalsize = cpu_to_be32(totalsize);
9627 +
9628 +       sizeleft = totalsize - sizeof(magic) - sizeof(totalsize);
9629 +       p = blob + sizeof(magic)  + sizeof(totalsize);
9630 +
9631 +       while (sizeleft) {
9632 +               if (feof(f))
9633 +                       die("EOF before reading %d bytes of DT blob\n",
9634 +                           totalsize);
9635 +
9636 +               rc = fread(p, 1, sizeleft, f);
9637 +               if (ferror(f))
9638 +                       die("Error reading DT blob: %s\n",
9639 +                           strerror(errno));
9640 +
9641 +               sizeleft -= rc;
9642 +               p += rc;
9643 +       }
9644 +
9645 +       off_dt = be32_to_cpu(fdt->off_dt_struct);
9646 +       off_str = be32_to_cpu(fdt->off_dt_strings);
9647 +       off_mem_rsvmap = be32_to_cpu(fdt->off_mem_rsvmap);
9648 +       version = be32_to_cpu(fdt->version);
9649 +
9650 +       fprintf(stderr, "\tmagic:\t\t\t0x%x\n", magic);
9651 +       fprintf(stderr, "\ttotalsize:\t\t%d\n", totalsize);
9652 +       fprintf(stderr, "\toff_dt_struct:\t\t0x%x\n", off_dt);
9653 +       fprintf(stderr, "\toff_dt_strings:\t\t0x%x\n", off_str);
9654 +       fprintf(stderr, "\toff_mem_rsvmap:\t\t0x%x\n", off_mem_rsvmap);
9655 +       fprintf(stderr, "\tversion:\t\t0x%x\n", version );
9656 +       fprintf(stderr, "\tlast_comp_version:\t0x%x\n",
9657 +               be32_to_cpu(fdt->last_comp_version));
9658 +
9659 +       if (off_mem_rsvmap >= totalsize)
9660 +               die("Mem Reserve structure offset exceeds total size\n");
9661 +
9662 +       if (off_dt >= totalsize)
9663 +               die("DT structure offset exceeds total size\n");
9664 +
9665 +       if (off_str > totalsize)
9666 +               die("String table offset exceeds total size\n");
9667 +
9668 +       if (version >= 2)
9669 +               fprintf(stderr, "\tboot_cpuid_phys:\t0x%x\n",
9670 +                       be32_to_cpu(fdt->boot_cpuid_phys));
9671 +
9672 +       size_str = -1;
9673 +       if (version >= 3) {
9674 +               size_str = be32_to_cpu(fdt->size_dt_strings);
9675 +               fprintf(stderr, "\tsize_dt_strings:\t%d\n", size_str);
9676 +               if (off_str+size_str > totalsize)
9677 +                       die("String table extends past total size\n");
9678 +       }
9679 +
9680 +       if (version >= 17) {
9681 +               size_dt = be32_to_cpu(fdt->size_dt_struct);
9682 +               fprintf(stderr, "\tsize_dt_struct:\t\t%d\n", size_dt);
9683 +               if (off_dt+size_dt > totalsize)
9684 +                       die("Structure block extends past total size\n");
9685 +       }
9686 +
9687 +       if (version < 16) {
9688 +               flags |= FTF_FULLPATH | FTF_NAMEPROPS | FTF_VARALIGN;
9689 +       } else {
9690 +               flags |= FTF_NOPS;
9691 +       }
9692 +
9693 +       inbuf_init(&memresvbuf,
9694 +                  blob + off_mem_rsvmap, blob + totalsize);
9695 +       inbuf_init(&dtbuf, blob + off_dt, blob + totalsize);
9696 +       if (size_str >= 0)
9697 +               inbuf_init(&strbuf, blob + off_str, blob + off_str + size_str);
9698 +       else
9699 +               inbuf_init(&strbuf, blob + off_str, blob + totalsize);
9700 +
9701 +       reservelist = flat_read_mem_reserve(&memresvbuf);
9702 +
9703 +       val = flat_read_word(&dtbuf);
9704 +
9705 +       if (val != FDT_BEGIN_NODE)
9706 +               die("Device tree blob doesn't begin with FDT_BEGIN_NODE (begins with 0x%08x)\n", val);
9707 +
9708 +       tree = unflatten_tree(&dtbuf, &strbuf, "", flags);
9709 +
9710 +       val = flat_read_word(&dtbuf);
9711 +       if (val != FDT_END)
9712 +               die("Device tree blob doesn't end with FDT_END\n");
9713 +
9714 +       free(blob);
9715 +
9716 +       return build_boot_info(reservelist, tree);
9717 +}
9718 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/fstree.c
9719 ===================================================================
9720 --- /dev/null
9721 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/fstree.c
9722 @@ -0,0 +1,94 @@
9723 +/*
9724 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
9725 + *
9726 + *
9727 + * This program is free software; you can redistribute it and/or
9728 + * modify it under the terms of the GNU General Public License as
9729 + * published by the Free Software Foundation; either version 2 of the
9730 + * License, or (at your option) any later version.
9731 + *
9732 + *  This program is distributed in the hope that it will be useful,
9733 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
9734 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9735 + *  General Public License for more details.
9736 + *
9737 + *  You should have received a copy of the GNU General Public License
9738 + *  along with this program; if not, write to the Free Software
9739 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
9740 + *                                                                   USA
9741 + */
9742 +
9743 +#include "dtc.h"
9744 +
9745 +#include <dirent.h>
9746 +#include <sys/stat.h>
9747 +
9748 +static struct node *read_fstree(const char *dirname)
9749 +{
9750 +       DIR *d;
9751 +       struct dirent *de;
9752 +       struct stat st;
9753 +       struct node *tree;
9754 +
9755 +       d = opendir(dirname);
9756 +       if (! d)
9757 +               die("opendir(): %s\n", strerror(errno));
9758 +
9759 +       tree = build_node(NULL, NULL);
9760 +
9761 +       while ((de = readdir(d)) != NULL) {
9762 +               char *tmpnam;
9763 +
9764 +               if (streq(de->d_name, ".")
9765 +                   || streq(de->d_name, ".."))
9766 +                       continue;
9767 +
9768 +               tmpnam = join_path(dirname, de->d_name);
9769 +
9770 +               if (lstat(tmpnam, &st) < 0)
9771 +                       die("stat(%s): %s\n", tmpnam, strerror(errno));
9772 +
9773 +               if (S_ISREG(st.st_mode)) {
9774 +                       struct property *prop;
9775 +                       FILE *pfile;
9776 +
9777 +                       pfile = fopen(tmpnam, "r");
9778 +                       if (! pfile) {
9779 +                               fprintf(stderr,
9780 +                                       "WARNING: Cannot open %s: %s\n",
9781 +                                       tmpnam, strerror(errno));
9782 +                       } else {
9783 +                               prop = build_property(strdup(de->d_name),
9784 +                                                     data_copy_file(pfile,
9785 +                                                                    st.st_size),
9786 +                                                     NULL);
9787 +                               add_property(tree, prop);
9788 +                               fclose(pfile);
9789 +                       }
9790 +               } else if (S_ISDIR(st.st_mode)) {
9791 +                       struct node *newchild;
9792 +
9793 +                       newchild = read_fstree(tmpnam);
9794 +                       newchild = name_node(newchild, strdup(de->d_name),
9795 +                                            NULL);
9796 +                       add_child(tree, newchild);
9797 +               }
9798 +
9799 +               free(tmpnam);
9800 +       }
9801 +
9802 +       return tree;
9803 +}
9804 +
9805 +struct boot_info *dt_from_fs(const char *dirname)
9806 +{
9807 +       struct node *tree;
9808 +
9809 +       tree = read_fstree(dirname);
9810 +       tree = name_node(tree, "", NULL);
9811 +
9812 +       fill_fullpaths(tree, "");
9813 +
9814 +       return build_boot_info(NULL, tree);
9815 +}
9816 +
9817 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/livetree.c
9818 ===================================================================
9819 --- /dev/null
9820 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/livetree.c
9821 @@ -0,0 +1,305 @@
9822 +/*
9823 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
9824 + *
9825 + *
9826 + * This program is free software; you can redistribute it and/or
9827 + * modify it under the terms of the GNU General Public License as
9828 + * published by the Free Software Foundation; either version 2 of the
9829 + * License, or (at your option) any later version.
9830 + *
9831 + *  This program is distributed in the hope that it will be useful,
9832 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
9833 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9834 + *  General Public License for more details.
9835 + *
9836 + *  You should have received a copy of the GNU General Public License
9837 + *  along with this program; if not, write to the Free Software
9838 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
9839 + *                                                                   USA
9840 + */
9841 +
9842 +#include "dtc.h"
9843 +
9844 +/*
9845 + * Tree building functions
9846 + */
9847 +
9848 +struct property *build_property(char *name, struct data val, char *label)
9849 +{
9850 +       struct property *new = xmalloc(sizeof(*new));
9851 +
9852 +       new->name = name;
9853 +       new->val = val;
9854 +
9855 +       new->next = NULL;
9856 +
9857 +       new->label = label;
9858 +
9859 +       return new;
9860 +}
9861 +
9862 +struct property *chain_property(struct property *first, struct property *list)
9863 +{
9864 +       assert(first->next == NULL);
9865 +
9866 +       first->next = list;
9867 +       return first;
9868 +}
9869 +
9870 +struct property *reverse_properties(struct property *first)
9871 +{
9872 +       struct property *p = first;
9873 +       struct property *head = NULL;
9874 +       struct property *next;
9875 +
9876 +       while (p) {
9877 +               next = p->next;
9878 +               p->next = head;
9879 +               head = p;
9880 +               p = next;
9881 +       }
9882 +       return head;
9883 +}
9884 +
9885 +struct node *build_node(struct property *proplist, struct node *children)
9886 +{
9887 +       struct node *new = xmalloc(sizeof(*new));
9888 +       struct node *child;
9889 +
9890 +       memset(new, 0, sizeof(*new));
9891 +
9892 +       new->proplist = reverse_properties(proplist);
9893 +       new->children = children;
9894 +
9895 +       for_each_child(new, child) {
9896 +               child->parent = new;
9897 +       }
9898 +
9899 +       return new;
9900 +}
9901 +
9902 +struct node *name_node(struct node *node, char *name, char * label)
9903 +{
9904 +       assert(node->name == NULL);
9905 +
9906 +       node->name = name;
9907 +
9908 +       node->label = label;
9909 +
9910 +       return node;
9911 +}
9912 +
9913 +struct node *chain_node(struct node *first, struct node *list)
9914 +{
9915 +       assert(first->next_sibling == NULL);
9916 +
9917 +       first->next_sibling = list;
9918 +       return first;
9919 +}
9920 +
9921 +void add_property(struct node *node, struct property *prop)
9922 +{
9923 +       struct property **p;
9924 +
9925 +       prop->next = NULL;
9926 +
9927 +       p = &node->proplist;
9928 +       while (*p)
9929 +               p = &((*p)->next);
9930 +
9931 +       *p = prop;
9932 +}
9933 +
9934 +void add_child(struct node *parent, struct node *child)
9935 +{
9936 +       struct node **p;
9937 +
9938 +       child->next_sibling = NULL;
9939 +
9940 +       p = &parent->children;
9941 +       while (*p)
9942 +               p = &((*p)->next_sibling);
9943 +
9944 +       *p = child;
9945 +}
9946 +
9947 +struct reserve_info *build_reserve_entry(u64 address, u64 size, char *label)
9948 +{
9949 +       struct reserve_info *new = xmalloc(sizeof(*new));
9950 +
9951 +       new->re.address = address;
9952 +       new->re.size = size;
9953 +
9954 +       new->next = NULL;
9955 +
9956 +       new->label = label;
9957 +
9958 +       return new;
9959 +}
9960 +
9961 +struct reserve_info *chain_reserve_entry(struct reserve_info *first,
9962 +                                       struct reserve_info *list)
9963 +{
9964 +       assert(first->next == NULL);
9965 +
9966 +       first->next = list;
9967 +       return first;
9968 +}
9969 +
9970 +struct reserve_info *add_reserve_entry(struct reserve_info *list,
9971 +                                     struct reserve_info *new)
9972 +{
9973 +       struct reserve_info *last;
9974 +
9975 +       new->next = NULL;
9976 +
9977 +       if (! list)
9978 +               return new;
9979 +
9980 +       for (last = list; last->next; last = last->next)
9981 +               ;
9982 +
9983 +       last->next = new;
9984 +
9985 +       return list;
9986 +}
9987 +
9988 +struct boot_info *build_boot_info(struct reserve_info *reservelist,
9989 +                                 struct node *tree)
9990 +{
9991 +       struct boot_info *bi;
9992 +
9993 +       bi = xmalloc(sizeof(*bi));
9994 +       bi->reservelist = reservelist;
9995 +       bi->dt = tree;
9996 +
9997 +       return bi;
9998 +}
9999 +
10000 +/*
10001 + * Tree accessor functions
10002 + */
10003 +
10004 +const char *get_unitname(struct node *node)
10005 +{
10006 +       if (node->name[node->basenamelen] == '\0')
10007 +               return "";
10008 +       else
10009 +               return node->name + node->basenamelen + 1;
10010 +}
10011 +
10012 +struct property *get_property(struct node *node, const char *propname)
10013 +{
10014 +       struct property *prop;
10015 +
10016 +       for_each_property(node, prop)
10017 +               if (streq(prop->name, propname))
10018 +                       return prop;
10019 +
10020 +       return NULL;
10021 +}
10022 +
10023 +cell_t propval_cell(struct property *prop)
10024 +{
10025 +       assert(prop->val.len == sizeof(cell_t));
10026 +       return be32_to_cpu(*((cell_t *)prop->val.val));
10027 +}
10028 +
10029 +struct node *get_subnode(struct node *node, const char *nodename)
10030 +{
10031 +       struct node *child;
10032 +
10033 +       for_each_child(node, child)
10034 +               if (streq(child->name, nodename))
10035 +                       return child;
10036 +
10037 +       return NULL;
10038 +}
10039 +
10040 +struct node *get_node_by_path(struct node *tree, const char *path)
10041 +{
10042 +       const char *p;
10043 +       struct node *child;
10044 +
10045 +       if (!path || ! (*path))
10046 +               return tree;
10047 +
10048 +       while (path[0] == '/')
10049 +               path++;
10050 +
10051 +       p = strchr(path, '/');
10052 +
10053 +       for_each_child(tree, child) {
10054 +               if (p && strneq(path, child->name, p-path))
10055 +                       return get_node_by_path(child, p+1);
10056 +               else if (!p && streq(path, child->name))
10057 +                       return child;
10058 +       }
10059 +
10060 +       return NULL;
10061 +}
10062 +
10063 +struct node *get_node_by_label(struct node *tree, const char *label)
10064 +{
10065 +       struct node *child, *node;
10066 +
10067 +       assert(label && (strlen(label) > 0));
10068 +
10069 +       if (tree->label && streq(tree->label, label))
10070 +               return tree;
10071 +
10072 +       for_each_child(tree, child) {
10073 +               node = get_node_by_label(child, label);
10074 +               if (node)
10075 +                       return node;
10076 +       }
10077 +
10078 +       return NULL;
10079 +}
10080 +
10081 +struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
10082 +{
10083 +       struct node *child, *node;
10084 +
10085 +       assert((phandle != 0) && (phandle != -1));
10086 +
10087 +       if (tree->phandle == phandle)
10088 +               return tree;
10089 +
10090 +       for_each_child(tree, child) {
10091 +               node = get_node_by_phandle(child, phandle);
10092 +               if (node)
10093 +                       return node;
10094 +       }
10095 +
10096 +       return NULL;
10097 +}
10098 +
10099 +struct node *get_node_by_ref(struct node *tree, const char *ref)
10100 +{
10101 +       if (ref[0] == '/')
10102 +               return get_node_by_path(tree, ref);
10103 +       else
10104 +               return get_node_by_label(tree, ref);
10105 +}
10106 +
10107 +cell_t get_node_phandle(struct node *root, struct node *node)
10108 +{
10109 +       static cell_t phandle = 1; /* FIXME: ick, static local */
10110 +
10111 +       if ((node->phandle != 0) && (node->phandle != -1))
10112 +               return node->phandle;
10113 +
10114 +       assert(! get_property(node, "linux,phandle"));
10115 +
10116 +       while (get_node_by_phandle(root, phandle))
10117 +               phandle++;
10118 +
10119 +       node->phandle = phandle;
10120 +       add_property(node,
10121 +                    build_property("linux,phandle",
10122 +                                   data_append_cell(empty_data, phandle),
10123 +                                   NULL));
10124 +
10125 +       return node->phandle;
10126 +}
10127 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/srcpos.c
10128 ===================================================================
10129 --- /dev/null
10130 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/srcpos.c
10131 @@ -0,0 +1,105 @@
10132 +/*
10133 + * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
10134 + *
10135 + * This program is free software; you can redistribute it and/or
10136 + * modify it under the terms of the GNU General Public License as
10137 + * published by the Free Software Foundation; either version 2 of the
10138 + * License, or (at your option) any later version.
10139 + *
10140 + *  This program is distributed in the hope that it will be useful,
10141 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10142 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10143 + *  General Public License for more details.
10144 + *
10145 + *  You should have received a copy of the GNU General Public License
10146 + *  along with this program; if not, write to the Free Software
10147 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
10148 + *                                                                   USA
10149 + */
10150 +
10151 +#include "dtc.h"
10152 +#include "srcpos.h"
10153 +
10154 +
10155 +/*
10156 + * Record the complete unique set of opened file names.
10157 + * Primarily used to cache source position file names.
10158 + */
10159 +#define MAX_N_FILE_NAMES       (100)
10160 +
10161 +const char *file_names[MAX_N_FILE_NAMES];
10162 +static int n_file_names = 0;
10163 +
10164 +/*
10165 + * Like yylineno, this is the current open file pos.
10166 + */
10167 +
10168 +int srcpos_filenum = -1;
10169 +
10170 +
10171 +
10172 +FILE *dtc_open_file(const char *fname)
10173 +{
10174 +       FILE *f;
10175 +
10176 +       if (lookup_file_name(fname, 1) < 0)
10177 +               die("Too many files opened\n");
10178 +
10179 +       if (streq(fname, "-"))
10180 +               f = stdin;
10181 +       else
10182 +               f = fopen(fname, "r");
10183 +
10184 +       if (! f)
10185 +               die("Couldn't open \"%s\": %s\n", fname, strerror(errno));
10186 +
10187 +       return f;
10188 +}
10189 +
10190 +
10191 +
10192 +/*
10193 + * Locate and optionally add filename fname in the file_names[] array.
10194 + *
10195 + * If the filename is currently not in the array and the boolean
10196 + * add_it is non-zero, an attempt to add the filename will be made.
10197 + *
10198 + * Returns;
10199 + *    Index [0..MAX_N_FILE_NAMES) where the filename is kept
10200 + *    -1 if the name can not be recorded
10201 + */
10202 +
10203 +int lookup_file_name(const char *fname, int add_it)
10204 +{
10205 +       int i;
10206 +
10207 +       for (i = 0; i < n_file_names; i++) {
10208 +               if (strcmp(file_names[i], fname) == 0)
10209 +                       return i;
10210 +       }
10211 +
10212 +       if (add_it) {
10213 +               if (n_file_names < MAX_N_FILE_NAMES) {
10214 +                       file_names[n_file_names] = strdup(fname);
10215 +                       return n_file_names++;
10216 +               }
10217 +       }
10218 +
10219 +       return -1;
10220 +}
10221 +
10222 +
10223 +const char *srcpos_filename_for_num(int filenum)
10224 +{
10225 +       if (0 <= filenum && filenum < n_file_names) {
10226 +               return file_names[filenum];
10227 +       }
10228 +
10229 +       return 0;
10230 +}
10231 +
10232 +
10233 +const char *srcpos_get_filename(void)
10234 +{
10235 +       return srcpos_filename_for_num(srcpos_filenum);
10236 +}
10237 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/srcpos.h
10238 ===================================================================
10239 --- /dev/null
10240 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/srcpos.h
10241 @@ -0,0 +1,75 @@
10242 +/*
10243 + * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
10244 + *
10245 + * This program is free software; you can redistribute it and/or
10246 + * modify it under the terms of the GNU General Public License as
10247 + * published by the Free Software Foundation; either version 2 of the
10248 + * License, or (at your option) any later version.
10249 + *
10250 + *  This program is distributed in the hope that it will be useful,
10251 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10252 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10253 + *  General Public License for more details.
10254 + *
10255 + *  You should have received a copy of the GNU General Public License
10256 + *  along with this program; if not, write to the Free Software
10257 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
10258 + *                                                                   USA
10259 + */
10260 +
10261 +/*
10262 + * Augment the standard YYLTYPE with a filenum index into an
10263 + * array of all opened filenames.
10264 + */
10265 +
10266 +#if ! defined(YYLTYPE) && ! defined(YYLTYPE_IS_DECLARED)
10267 +typedef struct YYLTYPE {
10268 +    int first_line;
10269 +    int first_column;
10270 +    int last_line;
10271 +    int last_column;
10272 +    int filenum;
10273 +} YYLTYPE;
10274 +
10275 +#define YYLTYPE_IS_DECLARED    1
10276 +#define YYLTYPE_IS_TRIVIAL     1
10277 +#endif
10278 +
10279 +/* Cater to old parser templates. */
10280 +#ifndef YYID
10281 +#define YYID(n)        (n)
10282 +#endif
10283 +
10284 +#define YYLLOC_DEFAULT(Current, Rhs, N)                                        \
10285 +    do                                                                 \
10286 +      if (YYID (N))                                                    \
10287 +       {                                                               \
10288 +         (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
10289 +         (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
10290 +         (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
10291 +         (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
10292 +         (Current).filenum      = YYRHSLOC (Rhs, N).filenum;           \
10293 +       }                                                               \
10294 +      else                                                             \
10295 +       {                                                               \
10296 +         (Current).first_line   = (Current).last_line   =              \
10297 +           YYRHSLOC (Rhs, 0).last_line;                                \
10298 +         (Current).first_column = (Current).last_column =              \
10299 +           YYRHSLOC (Rhs, 0).last_column;                              \
10300 +         (Current).filenum      = YYRHSLOC (Rhs, 0).filenum;           \
10301 +       }                                                               \
10302 +    while (YYID (0))
10303 +
10304 +
10305 +
10306 +extern void yyerror(char const *);
10307 +
10308 +extern int srcpos_filenum;
10309 +
10310 +extern int push_input_file(const char *filename);
10311 +extern int pop_input_file(void);
10312 +
10313 +extern FILE *dtc_open_file(const char *fname);
10314 +extern int lookup_file_name(const char *fname, int add_it);
10315 +extern const char *srcpos_filename_for_num(int filenum);
10316 +const char *srcpos_get_filename(void);
10317 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/treesource.c
10318 ===================================================================
10319 --- /dev/null
10320 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/treesource.c
10321 @@ -0,0 +1,275 @@
10322 +/*
10323 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
10324 + *
10325 + *
10326 + * This program is free software; you can redistribute it and/or
10327 + * modify it under the terms of the GNU General Public License as
10328 + * published by the Free Software Foundation; either version 2 of the
10329 + * License, or (at your option) any later version.
10330 + *
10331 + *  This program is distributed in the hope that it will be useful,
10332 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10333 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10334 + *  General Public License for more details.
10335 + *
10336 + *  You should have received a copy of the GNU General Public License
10337 + *  along with this program; if not, write to the Free Software
10338 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
10339 + *                                                                   USA
10340 + */
10341 +
10342 +#include "dtc.h"
10343 +#include "srcpos.h"
10344 +
10345 +extern FILE *yyin;
10346 +extern int yyparse(void);
10347 +extern void yyerror(char const *);
10348 +
10349 +struct boot_info *the_boot_info;
10350 +
10351 +struct boot_info *dt_from_source(const char *fname)
10352 +{
10353 +       the_boot_info = NULL;
10354 +
10355 +       push_input_file(fname);
10356 +
10357 +       if (yyparse() != 0)
10358 +               return NULL;
10359 +
10360 +       fill_fullpaths(the_boot_info->dt, "");
10361 +
10362 +       return the_boot_info;
10363 +}
10364 +
10365 +static void write_prefix(FILE *f, int level)
10366 +{
10367 +       int i;
10368 +
10369 +       for (i = 0; i < level; i++)
10370 +               fputc('\t', f);
10371 +}
10372 +
10373 +int isstring(char c)
10374 +{
10375 +       return (isprint(c)
10376 +               || (c == '\0')
10377 +               || strchr("\a\b\t\n\v\f\r", c));
10378 +}
10379 +
10380 +static void write_propval_string(FILE *f, struct data val)
10381 +{
10382 +       const char *str = val.val;
10383 +       int i;
10384 +       int newchunk = 1;
10385 +       struct marker *m = val.markers;
10386 +
10387 +       assert(str[val.len-1] == '\0');
10388 +
10389 +       for (i = 0; i < (val.len-1); i++) {
10390 +               char c = str[i];
10391 +
10392 +               if (newchunk) {
10393 +                       while (m && (m->offset <= i)) {
10394 +                               if (m->type == LABEL) {
10395 +                                       assert(m->offset == i);
10396 +                                       fprintf(f, "%s: ", m->ref);
10397 +                               }
10398 +                               m = m->next;
10399 +                       }
10400 +                       fprintf(f, "\"");
10401 +                       newchunk = 0;
10402 +               }
10403 +
10404 +               switch (c) {
10405 +               case '\a':
10406 +                       fprintf(f, "\\a");
10407 +                       break;
10408 +               case '\b':
10409 +                       fprintf(f, "\\b");
10410 +                       break;
10411 +               case '\t':
10412 +                       fprintf(f, "\\t");
10413 +                       break;
10414 +               case '\n':
10415 +                       fprintf(f, "\\n");
10416 +                       break;
10417 +               case '\v':
10418 +                       fprintf(f, "\\v");
10419 +                       break;
10420 +               case '\f':
10421 +                       fprintf(f, "\\f");
10422 +                       break;
10423 +               case '\r':
10424 +                       fprintf(f, "\\r");
10425 +                       break;
10426 +               case '\\':
10427 +                       fprintf(f, "\\\\");
10428 +                       break;
10429 +               case '\"':
10430 +                       fprintf(f, "\\\"");
10431 +                       break;
10432 +               case '\0':
10433 +                       fprintf(f, "\", ");
10434 +                       newchunk = 1;
10435 +                       break;
10436 +               default:
10437 +                       if (isprint(c))
10438 +                               fprintf(f, "%c", c);
10439 +                       else
10440 +                               fprintf(f, "\\x%02hhx", c);
10441 +               }
10442 +       }
10443 +       fprintf(f, "\"");
10444 +
10445 +       /* Wrap up any labels at the end of the value */
10446 +       for_each_marker_of_type(m, LABEL) {
10447 +               assert (m->offset == val.len);
10448 +               fprintf(f, " %s:", m->ref);
10449 +       }
10450 +}
10451 +
10452 +static void write_propval_cells(FILE *f, struct data val)
10453 +{
10454 +       void *propend = val.val + val.len;
10455 +       cell_t *cp = (cell_t *)val.val;
10456 +       struct marker *m = val.markers;
10457 +
10458 +       fprintf(f, "<");
10459 +       for (;;) {
10460 +               while (m && (m->offset <= ((char *)cp - val.val))) {
10461 +                       if (m->type == LABEL) {
10462 +                               assert(m->offset == ((char *)cp - val.val));
10463 +                               fprintf(f, "%s: ", m->ref);
10464 +                       }
10465 +                       m = m->next;
10466 +               }
10467 +
10468 +               fprintf(f, "0x%x", be32_to_cpu(*cp++));
10469 +               if ((void *)cp >= propend)
10470 +                       break;
10471 +               fprintf(f, " ");
10472 +       }
10473 +
10474 +       /* Wrap up any labels at the end of the value */
10475 +       for_each_marker_of_type(m, LABEL) {
10476 +               assert (m->offset == val.len);
10477 +               fprintf(f, " %s:", m->ref);
10478 +       }
10479 +       fprintf(f, ">");
10480 +}
10481 +
10482 +static void write_propval_bytes(FILE *f, struct data val)
10483 +{
10484 +       void *propend = val.val + val.len;
10485 +       const char *bp = val.val;
10486 +       struct marker *m = val.markers;
10487 +
10488 +       fprintf(f, "[");
10489 +       for (;;) {
10490 +               while (m && (m->offset == (bp-val.val))) {
10491 +                       if (m->type == LABEL)
10492 +                               fprintf(f, "%s: ", m->ref);
10493 +                       m = m->next;
10494 +               }
10495 +
10496 +               fprintf(f, "%02hhx", *bp++);
10497 +               if ((void *)bp >= propend)
10498 +                       break;
10499 +               fprintf(f, " ");
10500 +       }
10501 +
10502 +       /* Wrap up any labels at the end of the value */
10503 +       for_each_marker_of_type(m, LABEL) {
10504 +               assert (m->offset == val.len);
10505 +               fprintf(f, " %s:", m->ref);
10506 +       }
10507 +       fprintf(f, "]");
10508 +}
10509 +
10510 +static void write_propval(FILE *f, struct property *prop)
10511 +{
10512 +       int len = prop->val.len;
10513 +       const char *p = prop->val.val;
10514 +       struct marker *m = prop->val.markers;
10515 +       int nnotstring = 0, nnul = 0;
10516 +       int nnotstringlbl = 0, nnotcelllbl = 0;
10517 +       int i;
10518 +
10519 +       if (len == 0) {
10520 +               fprintf(f, ";\n");
10521 +               return;
10522 +       }
10523 +
10524 +       for (i = 0; i < len; i++) {
10525 +               if (! isstring(p[i]))
10526 +                       nnotstring++;
10527 +               if (p[i] == '\0')
10528 +                       nnul++;
10529 +       }
10530 +
10531 +       for_each_marker_of_type(m, LABEL) {
10532 +               if ((m->offset > 0) && (prop->val.val[m->offset - 1] != '\0'))
10533 +                       nnotstringlbl++;
10534 +               if ((m->offset % sizeof(cell_t)) != 0)
10535 +                       nnotcelllbl++;
10536 +       }
10537 +
10538 +       fprintf(f, " = ");
10539 +       if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul < (len-nnul))
10540 +           && (nnotstringlbl == 0)) {
10541 +               write_propval_string(f, prop->val);
10542 +       } else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) {
10543 +               write_propval_cells(f, prop->val);
10544 +       } else {
10545 +               write_propval_bytes(f, prop->val);
10546 +       }
10547 +
10548 +       fprintf(f, ";\n");
10549 +}
10550 +
10551 +static void write_tree_source_node(FILE *f, struct node *tree, int level)
10552 +{
10553 +       struct property *prop;
10554 +       struct node *child;
10555 +
10556 +       write_prefix(f, level);
10557 +       if (tree->label)
10558 +               fprintf(f, "%s: ", tree->label);
10559 +       if (tree->name && (*tree->name))
10560 +               fprintf(f, "%s {\n", tree->name);
10561 +       else
10562 +               fprintf(f, "/ {\n");
10563 +
10564 +       for_each_property(tree, prop) {
10565 +               write_prefix(f, level+1);
10566 +               if (prop->label)
10567 +                       fprintf(f, "%s: ", prop->label);
10568 +               fprintf(f, "%s", prop->name);
10569 +               write_propval(f, prop);
10570 +       }
10571 +       for_each_child(tree, child) {
10572 +               fprintf(f, "\n");
10573 +               write_tree_source_node(f, child, level+1);
10574 +       }
10575 +       write_prefix(f, level);
10576 +       fprintf(f, "};\n");
10577 +}
10578 +
10579 +
10580 +void dt_to_source(FILE *f, struct boot_info *bi)
10581 +{
10582 +       struct reserve_info *re;
10583 +
10584 +       fprintf(f, "/dts-v1/;\n\n");
10585 +
10586 +       for (re = bi->reservelist; re; re = re->next) {
10587 +               if (re->label)
10588 +                       fprintf(f, "%s: ", re->label);
10589 +               fprintf(f, "/memreserve/\t0x%016llx 0x%016llx;\n",
10590 +                       (unsigned long long)re->re.address,
10591 +                       (unsigned long long)re->re.size);
10592 +       }
10593 +
10594 +       write_tree_source_node(f, bi->dt, 0);
10595 +}
10596 +
10597 Index: linux-2.6.24.7/arch/powerpc/boot/dtc-src/version_gen.h
10598 ===================================================================
10599 --- /dev/null
10600 +++ linux-2.6.24.7/arch/powerpc/boot/dtc-src/version_gen.h
10601 @@ -0,0 +1 @@
10602 +#define DTC_VERSION "DTC 1.0.0-gd6f9b62f"
10603 Index: linux-2.6.24.7/arch/powerpc/boot/dts/adder875-redboot.dts
10604 ===================================================================
10605 --- /dev/null
10606 +++ linux-2.6.24.7/arch/powerpc/boot/dts/adder875-redboot.dts
10607 @@ -0,0 +1,184 @@
10608 +/*
10609 + * Device Tree Source for MPC885 ADS running RedBoot
10610 + *
10611 + * Copyright 2006 MontaVista Software, Inc.
10612 + * Copyright 2007 Freescale Semiconductor, Inc.
10613 + *
10614 + * This program is free software; you can redistribute  it and/or modify it
10615 + * under  the terms of  the GNU General  Public License as published by the
10616 + * Free Software Foundation;  either version 2 of the  License, or (at your
10617 + * option) any later version.
10618 + */
10619 +
10620 +/dts-v1/;
10621 +/ {
10622 +       model = "Analogue & Micro Adder MPC875";
10623 +       compatible = "analogue-and-micro,adder875";
10624 +       #address-cells = <1>;
10625 +       #size-cells = <1>;
10626 +
10627 +       aliases {
10628 +               console = &console;
10629 +               ethernet0 = &eth0;
10630 +               ethernet1 = &eth1;
10631 +       };
10632 +
10633 +       cpus {
10634 +               #address-cells = <1>;
10635 +               #size-cells = <0>;
10636 +
10637 +               PowerPC,875@0 {
10638 +                       device_type = "cpu";
10639 +                       reg = <0>;
10640 +                       d-cache-line-size = <16>;
10641 +                       i-cache-line-size = <16>;
10642 +                       d-cache-size = <8192>;
10643 +                       i-cache-size = <8192>;
10644 +                       timebase-frequency = <0>;
10645 +                       bus-frequency = <0>;
10646 +                       clock-frequency = <0>;
10647 +                       interrupts = <15 2>;    // decrementer interrupt
10648 +                       interrupt-parent = <&PIC>;
10649 +               };
10650 +       };
10651 +
10652 +       memory {
10653 +               device_type = "memory";
10654 +               reg = <0 0x01000000>;
10655 +       };
10656 +
10657 +       localbus@fa200100 {
10658 +               compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus",
10659 +                            "simple-bus";
10660 +               #address-cells = <2>;
10661 +               #size-cells = <1>;
10662 +               reg = <0xfa200100 0x40>;
10663 +
10664 +               ranges = <
10665 +                       0 0 0xfe000000 0x00800000
10666 +                       2 0 0xfa100000 0x00008000
10667 +               >;
10668 +
10669 +               flash@0,0 {
10670 +                       compatible = "cfi-flash";
10671 +                       reg = <0 0 0x800000>;
10672 +                       bank-width = <2>;
10673 +                       device-width = <2>;
10674 +               };
10675 +       };
10676 +
10677 +       soc@fa200000 {
10678 +               compatible = "fsl,mpc875-immr", "fsl,pq1-soc", "simple-bus";
10679 +               #address-cells = <1>;
10680 +               #size-cells = <1>;
10681 +               ranges = <0 0xfa200000 0x00004000>;
10682 +
10683 +               // Temporary until code stops depending on it.
10684 +               device_type = "soc";
10685 +
10686 +               // Temporary until get_immrbase() is fixed.
10687 +               reg = <0xfa200000 0x4000>;
10688 +
10689 +               mdio@e00 {
10690 +                       compatible = "fsl,mpc875-fec-mdio", "fsl,pq1-fec-mdio";
10691 +                       reg = <0xe00 0x188>;
10692 +                       #address-cells = <1>;
10693 +                       #size-cells = <0>;
10694 +
10695 +                       PHY0: ethernet-phy@0 {
10696 +                               reg = <0>;
10697 +                               device_type = "ethernet-phy";
10698 +                       };
10699 +
10700 +                       PHY1: ethernet-phy@1 {
10701 +                               reg = <1>;
10702 +                               device_type = "ethernet-phy";
10703 +                       };
10704 +               };
10705 +
10706 +               eth0: ethernet@e00 {
10707 +                       device_type = "network";
10708 +                       compatible = "fsl,mpc875-fec-enet",
10709 +                                    "fsl,pq1-fec-enet";
10710 +                       reg = <0xe00 0x188>;
10711 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10712 +                       interrupts = <3 1>;
10713 +                       interrupt-parent = <&PIC>;
10714 +                       phy-handle = <&PHY0>;
10715 +                       linux,network-index = <0>;
10716 +               };
10717 +
10718 +               eth1: ethernet@1e00 {
10719 +                       device_type = "network";
10720 +                       compatible = "fsl,mpc875-fec-enet",
10721 +                                    "fsl,pq1-fec-enet";
10722 +                       reg = <0x1e00 0x188>;
10723 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10724 +                       interrupts = <7 1>;
10725 +                       interrupt-parent = <&PIC>;
10726 +                       phy-handle = <&PHY1>;
10727 +                       linux,network-index = <1>;
10728 +               };
10729 +
10730 +               PIC: interrupt-controller@0 {
10731 +                       interrupt-controller;
10732 +                       #interrupt-cells = <2>;
10733 +                       reg = <0 0x24>;
10734 +                       compatible = "fsl,mpc875-pic", "fsl,pq1-pic";
10735 +               };
10736 +
10737 +               cpm@9c0 {
10738 +                       #address-cells = <1>;
10739 +                       #size-cells = <1>;
10740 +                       compatible = "fsl,mpc875-cpm", "fsl,cpm1", "simple-bus";
10741 +                       interrupts = <0>;       // cpm error interrupt
10742 +                       interrupt-parent = <&CPM_PIC>;
10743 +                       reg = <0x9c0 0x40>;
10744 +                       ranges;
10745 +
10746 +                       muram {
10747 +                               #address-cells = <1>;
10748 +                               #size-cells = <1>;
10749 +                               ranges = <0 0x2000 0x2000>;
10750 +
10751 +                               data@0 {
10752 +                                       compatible = "fsl,cpm-muram-data";
10753 +                                       reg = <0 0x1c00>;
10754 +                               };
10755 +                       };
10756 +
10757 +                       brg@9f0 {
10758 +                               compatible = "fsl,mpc875-brg",
10759 +                                            "fsl,cpm1-brg",
10760 +                                            "fsl,cpm-brg";
10761 +                               reg = <0x9f0 0x10>;
10762 +                       };
10763 +
10764 +                       CPM_PIC: interrupt-controller@930 {
10765 +                               interrupt-controller;
10766 +                               #interrupt-cells = <1>;
10767 +                               interrupts = <5 2 0 2>;
10768 +                               interrupt-parent = <&PIC>;
10769 +                               reg = <0x930 0x20>;
10770 +                               compatible = "fsl,mpc875-cpm-pic",
10771 +                                            "fsl,cpm1-pic";
10772 +                       };
10773 +
10774 +                       console: serial@a80 {
10775 +                               device_type = "serial";
10776 +                               compatible = "fsl,mpc875-smc-uart",
10777 +                                            "fsl,cpm1-smc-uart";
10778 +                               reg = <0xa80 0x10 0x3e80 0x40>;
10779 +                               interrupts = <4>;
10780 +                               interrupt-parent = <&CPM_PIC>;
10781 +                               fsl,cpm-brg = <1>;
10782 +                               fsl,cpm-command = <0x0090>;
10783 +                               current-speed = <115200>;
10784 +                       };
10785 +               };
10786 +       };
10787 +
10788 +       chosen {
10789 +               linux,stdout-path = &console;
10790 +       };
10791 +};
10792 Index: linux-2.6.24.7/arch/powerpc/boot/dts/adder875-uboot.dts
10793 ===================================================================
10794 --- /dev/null
10795 +++ linux-2.6.24.7/arch/powerpc/boot/dts/adder875-uboot.dts
10796 @@ -0,0 +1,183 @@
10797 +/*
10798 + * Device Tree Source for MPC885 ADS running U-Boot
10799 + *
10800 + * Copyright 2006 MontaVista Software, Inc.
10801 + * Copyright 2007 Freescale Semiconductor, Inc.
10802 + *
10803 + * This program is free software; you can redistribute  it and/or modify it
10804 + * under  the terms of  the GNU General  Public License as published by the
10805 + * Free Software Foundation;  either version 2 of the  License, or (at your
10806 + * option) any later version.
10807 + */
10808 +
10809 +/dts-v1/;
10810 +/ {
10811 +       model = "Analogue & Micro Adder MPC875";
10812 +       compatible = "analogue-and-micro,adder875";
10813 +       #address-cells = <1>;
10814 +       #size-cells = <1>;
10815 +
10816 +       aliases {
10817 +               console = &console;
10818 +               ethernet0 = &eth0;
10819 +               ethernet1 = &eth1;
10820 +       };
10821 +
10822 +       cpus {
10823 +               #address-cells = <1>;
10824 +               #size-cells = <0>;
10825 +
10826 +               PowerPC,875@0 {
10827 +                       device_type = "cpu";
10828 +                       reg = <0>;
10829 +                       d-cache-line-size = <16>;
10830 +                       i-cache-line-size = <16>;
10831 +                       d-cache-size = <8192>;
10832 +                       i-cache-size = <8192>;
10833 +                       timebase-frequency = <0>;
10834 +                       bus-frequency = <0>;
10835 +                       clock-frequency = <0>;
10836 +                       interrupts = <15 2>;    // decrementer interrupt
10837 +                       interrupt-parent = <&PIC>;
10838 +               };
10839 +       };
10840 +
10841 +       memory {
10842 +               device_type = "memory";
10843 +               reg = <0 0x01000000>;
10844 +       };
10845 +
10846 +       localbus@ff000100 {
10847 +               compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus",
10848 +                            "simple-bus";
10849 +               #address-cells = <2>;
10850 +               #size-cells = <1>;
10851 +               reg = <0xff000100 0x40>;
10852 +
10853 +               ranges = <
10854 +                       0 0 0xfe000000 0x01000000
10855 +               >;
10856 +
10857 +               flash@0,0 {
10858 +                       compatible = "cfi-flash";
10859 +                       reg = <0 0 0x800000>;
10860 +                       bank-width = <2>;
10861 +                       device-width = <2>;
10862 +               };
10863 +       };
10864 +
10865 +       soc@ff000000 {
10866 +               compatible = "fsl,mpc875-immr", "fsl,pq1-soc", "simple-bus";
10867 +               #address-cells = <1>;
10868 +               #size-cells = <1>;
10869 +               ranges = <0 0xff000000 0x00004000>;
10870 +
10871 +               // Temporary until code stops depending on it.
10872 +               device_type = "soc";
10873 +
10874 +               // Temporary until get_immrbase() is fixed.
10875 +               reg = <0xff000000 0x4000>;
10876 +
10877 +               mdio@e00 {
10878 +                       compatible = "fsl,mpc875-fec-mdio", "fsl,pq1-fec-mdio";
10879 +                       reg = <0xe00 0x188>;
10880 +                       #address-cells = <1>;
10881 +                       #size-cells = <0>;
10882 +
10883 +                       PHY0: ethernet-phy@0 {
10884 +                               reg = <0>;
10885 +                               device_type = "ethernet-phy";
10886 +                       };
10887 +
10888 +                       PHY1: ethernet-phy@1 {
10889 +                               reg = <1>;
10890 +                               device_type = "ethernet-phy";
10891 +                       };
10892 +               };
10893 +
10894 +               eth0: ethernet@e00 {
10895 +                       device_type = "network";
10896 +                       compatible = "fsl,mpc875-fec-enet",
10897 +                                    "fsl,pq1-fec-enet";
10898 +                       reg = <0xe00 0x188>;
10899 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10900 +                       interrupts = <3 1>;
10901 +                       interrupt-parent = <&PIC>;
10902 +                       phy-handle = <&PHY0>;
10903 +                       linux,network-index = <0>;
10904 +               };
10905 +
10906 +               eth1: ethernet@1e00 {
10907 +                       device_type = "network";
10908 +                       compatible = "fsl,mpc875-fec-enet",
10909 +                                    "fsl,pq1-fec-enet";
10910 +                       reg = <0x1e00 0x188>;
10911 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10912 +                       interrupts = <7 1>;
10913 +                       interrupt-parent = <&PIC>;
10914 +                       phy-handle = <&PHY1>;
10915 +                       linux,network-index = <1>;
10916 +               };
10917 +
10918 +               PIC: interrupt-controller@0 {
10919 +                       interrupt-controller;
10920 +                       #interrupt-cells = <2>;
10921 +                       reg = <0 0x24>;
10922 +                       compatible = "fsl,mpc875-pic", "fsl,pq1-pic";
10923 +               };
10924 +
10925 +               cpm@9c0 {
10926 +                       #address-cells = <1>;
10927 +                       #size-cells = <1>;
10928 +                       compatible = "fsl,mpc875-cpm", "fsl,cpm1", "simple-bus";
10929 +                       interrupts = <0>;       // cpm error interrupt
10930 +                       interrupt-parent = <&CPM_PIC>;
10931 +                       reg = <0x9c0 0x40>;
10932 +                       ranges;
10933 +
10934 +                       muram {
10935 +                               #address-cells = <1>;
10936 +                               #size-cells = <1>;
10937 +                               ranges = <0 0x2000 0x2000>;
10938 +
10939 +                               data@0 {
10940 +                                       compatible = "fsl,cpm-muram-data";
10941 +                                       reg = <0 0x1c00>;
10942 +                               };
10943 +                       };
10944 +
10945 +                       brg@9f0 {
10946 +                               compatible = "fsl,mpc875-brg",
10947 +                                            "fsl,cpm1-brg",
10948 +                                            "fsl,cpm-brg";
10949 +                               reg = <0x9f0 0x10>;
10950 +                       };
10951 +
10952 +                       CPM_PIC: interrupt-controller@930 {
10953 +                               interrupt-controller;
10954 +                               #interrupt-cells = <1>;
10955 +                               interrupts = <5 2 0 2>;
10956 +                               interrupt-parent = <&PIC>;
10957 +                               reg = <0x930 0x20>;
10958 +                               compatible = "fsl,mpc875-cpm-pic",
10959 +                                            "fsl,cpm1-pic";
10960 +                       };
10961 +
10962 +                       console: serial@a80 {
10963 +                               device_type = "serial";
10964 +                               compatible = "fsl,mpc875-smc-uart",
10965 +                                            "fsl,cpm1-smc-uart";
10966 +                               reg = <0xa80 0x10 0x3e80 0x40>;
10967 +                               interrupts = <4>;
10968 +                               interrupt-parent = <&CPM_PIC>;
10969 +                               fsl,cpm-brg = <1>;
10970 +                               fsl,cpm-command = <0x0090>;
10971 +                               current-speed = <115200>;
10972 +                       };
10973 +               };
10974 +       };
10975 +
10976 +       chosen {
10977 +               linux,stdout-path = &console;
10978 +       };
10979 +};
10980 Index: linux-2.6.24.7/arch/powerpc/boot/dts/bamboo.dts
10981 ===================================================================
10982 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/bamboo.dts
10983 +++ linux-2.6.24.7/arch/powerpc/boot/dts/bamboo.dts
10984 @@ -16,14 +16,24 @@
10985         #size-cells = <1>;
10986         model = "amcc,bamboo";
10987         compatible = "amcc,bamboo";
10988 -       dcr-parent = <&/cpus/PowerPC,440EP@0>;
10989 +       dcr-parent = <&/cpus/cpu@0>;
10990 +
10991 +       aliases {
10992 +               ethernet0 = &EMAC0;
10993 +               ethernet1 = &EMAC1;
10994 +               serial0 = &UART0;
10995 +               serial1 = &UART1;
10996 +               serial2 = &UART2;
10997 +               serial3 = &UART3;
10998 +       };
10999  
11000         cpus {
11001                 #address-cells = <1>;
11002                 #size-cells = <0>;
11003  
11004 -               PowerPC,440EP@0 {
11005 +               cpu@0 {
11006                         device_type = "cpu";
11007 +                       model = "PowerPC,440EP";
11008                         reg = <0>;
11009                         clock-frequency = <0>; /* Filled in by zImage */
11010                         timebase-frequency = <0>; /* Filled in by zImage */
11011 @@ -126,7 +136,6 @@
11012                                 #address-cells = <2>;
11013                                 #size-cells = <1>;
11014                                 clock-frequency = <0>; /* Filled in by zImage */
11015 -                               ranges;
11016                                 interrupts = <5 1>;
11017                                 interrupt-parent = <&UIC1>;
11018                         };
11019 @@ -238,11 +247,56 @@
11020                                 zmii-device = <&ZMII0>;
11021                                 zmii-channel = <1>;
11022                         };
11023 +
11024 +                       usb@ef601000 {
11025 +                               compatible = "ohci-be";
11026 +                               reg = <ef601000 80>;
11027 +                               interrupts = <8 1 9 1>;
11028 +                               interrupt-parent = < &UIC1 >;
11029 +                       };
11030 +               };
11031 +
11032 +               PCI0: pci@ec000000 {
11033 +                       device_type = "pci";
11034 +                       #interrupt-cells = <1>;
11035 +                       #size-cells = <2>;
11036 +                       #address-cells = <3>;
11037 +                       compatible = "ibm,plb440ep-pci", "ibm,plb-pci";
11038 +                       primary;
11039 +                       reg = <0 eec00000 8     /* Config space access */
11040 +                              0 eed00000 4     /* IACK */
11041 +                              0 eed00000 4     /* Special cycle */
11042 +                              0 ef400000 40>;  /* Internal registers */
11043 +
11044 +                       /* Outbound ranges, one memory and one IO,
11045 +                        * later cannot be changed. Chip supports a second
11046 +                        * IO range but we don't use it for now
11047 +                        */
11048 +                       ranges = <02000000 0 a0000000 0 a0000000 0 20000000
11049 +                                 01000000 0 00000000 0 e8000000 0 00010000>;
11050 +
11051 +                       /* Inbound 2GB range starting at 0 */
11052 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
11053 +
11054 +                       /* Bamboo has all 4 IRQ pins tied together per slot */
11055 +                       interrupt-map-mask = <f800 0 0 0>;
11056 +                       interrupt-map = <
11057 +                               /* IDSEL 1 */
11058 +                               0800 0 0 0 &UIC0 1c 8
11059 +
11060 +                               /* IDSEL 2 */
11061 +                               1000 0 0 0 &UIC0 1b 8
11062 +
11063 +                               /* IDSEL 3 */
11064 +                               1800 0 0 0 &UIC0 1a 8
11065 +
11066 +                               /* IDSEL 4 */
11067 +                               2000 0 0 0 &UIC0 19 8
11068 +                       >;
11069                 };
11070         };
11071  
11072         chosen {
11073                 linux,stdout-path = "/plb/opb/serial@ef600300";
11074 -               bootargs = "console=ttyS0,115200";
11075         };
11076  };
11077 Index: linux-2.6.24.7/arch/powerpc/boot/dts/cm5200.dts
11078 ===================================================================
11079 --- /dev/null
11080 +++ linux-2.6.24.7/arch/powerpc/boot/dts/cm5200.dts
11081 @@ -0,0 +1,236 @@
11082 +/*
11083 + * CM5200 board Device Tree Source
11084 + *
11085 + * Copyright (C) 2007 Semihalf
11086 + * Marian Balakowicz <m8@semihalf.com>
11087 + *
11088 + * This program is free software; you can redistribute  it and/or modify it
11089 + * under  the terms of  the GNU General  Public License as published by the
11090 + * Free Software Foundation;  either version 2 of the  License, or (at your
11091 + * option) any later version.
11092 + */
11093 +
11094 +/*
11095 + * WARNING: Do not depend on this tree layout remaining static just yet.
11096 + * The MPC5200 device tree conventions are still in flux
11097 + * Keep an eye on the linuxppc-dev mailing list for more details
11098 + */
11099 +
11100 +/ {
11101 +       model = "schindler,cm5200";
11102 +       compatible = "schindler,cm5200";
11103 +       #address-cells = <1>;
11104 +       #size-cells = <1>;
11105 +
11106 +       cpus {
11107 +               #address-cells = <1>;
11108 +               #size-cells = <0>;
11109 +
11110 +               PowerPC,5200@0 {
11111 +                       device_type = "cpu";
11112 +                       reg = <0>;
11113 +                       d-cache-line-size = <20>;
11114 +                       i-cache-line-size = <20>;
11115 +                       d-cache-size = <4000>;          // L1, 16K
11116 +                       i-cache-size = <4000>;          // L1, 16K
11117 +                       timebase-frequency = <0>;       // from bootloader
11118 +                       bus-frequency = <0>;            // from bootloader
11119 +                       clock-frequency = <0>;          // from bootloader
11120 +               };
11121 +       };
11122 +
11123 +       memory {
11124 +               device_type = "memory";
11125 +               reg = <00000000 04000000>;      // 64MB
11126 +       };
11127 +
11128 +       soc5200@f0000000 {
11129 +               model = "fsl,mpc5200b";
11130 +               compatible = "fsl,mpc5200b";
11131 +               revision = "";                  // from bootloader
11132 +               device_type = "soc";
11133 +               ranges = <0 f0000000 0000c000>;
11134 +               reg = <f0000000 00000100>;
11135 +               bus-frequency = <0>;            // from bootloader
11136 +               system-frequency = <0>;         // from bootloader
11137 +
11138 +               cdm@200 {
11139 +                       compatible = "mpc5200b-cdm","mpc5200-cdm";
11140 +                       reg = <200 38>;
11141 +               };
11142 +
11143 +               mpc5200_pic: pic@500 {
11144 +                       // 5200 interrupts are encoded into two levels;
11145 +                       interrupt-controller;
11146 +                       #interrupt-cells = <3>;
11147 +                       compatible = "mpc5200b-pic","mpc5200-pic";
11148 +                       reg = <500 80>;
11149 +               };
11150 +
11151 +               gpt@600 {       // General Purpose Timer
11152 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11153 +                       reg = <600 10>;
11154 +                       interrupts = <1 9 0>;
11155 +                       interrupt-parent = <&mpc5200_pic>;
11156 +                       fsl,has-wdt;
11157 +               };
11158 +
11159 +               gpt@610 {       // General Purpose Timer
11160 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11161 +                       reg = <610 10>;
11162 +                       interrupts = <1 a 0>;
11163 +                       interrupt-parent = <&mpc5200_pic>;
11164 +               };
11165 +
11166 +               gpt@620 {       // General Purpose Timer
11167 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11168 +                       reg = <620 10>;
11169 +                       interrupts = <1 b 0>;
11170 +                       interrupt-parent = <&mpc5200_pic>;
11171 +               };
11172 +
11173 +               gpt@630 {       // General Purpose Timer
11174 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11175 +                       reg = <630 10>;
11176 +                       interrupts = <1 c 0>;
11177 +                       interrupt-parent = <&mpc5200_pic>;
11178 +               };
11179 +
11180 +               gpt@640 {       // General Purpose Timer
11181 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11182 +                       reg = <640 10>;
11183 +                       interrupts = <1 d 0>;
11184 +                       interrupt-parent = <&mpc5200_pic>;
11185 +               };
11186 +
11187 +               gpt@650 {       // General Purpose Timer
11188 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11189 +                       reg = <650 10>;
11190 +                       interrupts = <1 e 0>;
11191 +                       interrupt-parent = <&mpc5200_pic>;
11192 +               };
11193 +
11194 +               gpt@660 {       // General Purpose Timer
11195 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11196 +                       reg = <660 10>;
11197 +                       interrupts = <1 f 0>;
11198 +                       interrupt-parent = <&mpc5200_pic>;
11199 +               };
11200 +
11201 +               gpt@670 {       // General Purpose Timer
11202 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11203 +                       reg = <670 10>;
11204 +                       interrupts = <1 10 0>;
11205 +                       interrupt-parent = <&mpc5200_pic>;
11206 +               };
11207 +
11208 +               rtc@800 {       // Real time clock
11209 +                       compatible = "mpc5200b-rtc","mpc5200-rtc";
11210 +                       reg = <800 100>;
11211 +                       interrupts = <1 5 0 1 6 0>;
11212 +                       interrupt-parent = <&mpc5200_pic>;
11213 +               };
11214 +
11215 +               gpio@b00 {
11216 +                       compatible = "mpc5200b-gpio","mpc5200-gpio";
11217 +                       reg = <b00 40>;
11218 +                       interrupts = <1 7 0>;
11219 +                       interrupt-parent = <&mpc5200_pic>;
11220 +               };
11221 +
11222 +               gpio-wkup@c00 {
11223 +                       compatible = "mpc5200b-gpio-wkup","mpc5200-gpio-wkup";
11224 +                       reg = <c00 40>;
11225 +                       interrupts = <1 8 0 0 3 0>;
11226 +                       interrupt-parent = <&mpc5200_pic>;
11227 +               };
11228 +
11229 +               spi@f00 {
11230 +                       compatible = "mpc5200b-spi","mpc5200-spi";
11231 +                       reg = <f00 20>;
11232 +                       interrupts = <2 d 0 2 e 0>;
11233 +                       interrupt-parent = <&mpc5200_pic>;
11234 +               };
11235 +
11236 +               usb@1000 {
11237 +                       device_type = "usb-ohci-be";
11238 +                       compatible = "mpc5200b-ohci","mpc5200-ohci","ohci-be";
11239 +                       reg = <1000 ff>;
11240 +                       interrupts = <2 6 0>;
11241 +                       interrupt-parent = <&mpc5200_pic>;
11242 +               };
11243 +
11244 +               dma-controller@1200 {
11245 +                       compatible = "mpc5200b-bestcomm","mpc5200-bestcomm";
11246 +                       reg = <1200 80>;
11247 +                       interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
11248 +                                     3 4 0  3 5 0  3 6 0  3 7 0
11249 +                                     3 8 0  3 9 0  3 a 0  3 b 0
11250 +                                     3 c 0  3 d 0  3 e 0  3 f 0>;
11251 +                       interrupt-parent = <&mpc5200_pic>;
11252 +               };
11253 +
11254 +               xlb@1f00 {
11255 +                       compatible = "mpc5200b-xlb","mpc5200-xlb";
11256 +                       reg = <1f00 100>;
11257 +               };
11258 +
11259 +               serial@2000 {           // PSC1
11260 +                       device_type = "serial";
11261 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
11262 +                       port-number = <0>;  // Logical port assignment
11263 +                       reg = <2000 100>;
11264 +                       interrupts = <2 1 0>;
11265 +                       interrupt-parent = <&mpc5200_pic>;
11266 +               };
11267 +
11268 +               serial@2200 {           // PSC2
11269 +                       device_type = "serial";
11270 +                       compatible = "mpc5200-psc-uart";
11271 +                       port-number = <1>;  // Logical port assignment
11272 +                       reg = <2200 100>;
11273 +                       interrupts = <2 2 0>;
11274 +                       interrupt-parent = <&mpc5200_pic>;
11275 +               };
11276 +
11277 +               serial@2400 {           // PSC3
11278 +                       device_type = "serial";
11279 +                       compatible = "mpc5200-psc-uart";
11280 +                       port-number = <2>;  // Logical port assignment
11281 +                       reg = <2400 100>;
11282 +                       interrupts = <2 3 0>;
11283 +                       interrupt-parent = <&mpc5200_pic>;
11284 +               };
11285 +
11286 +               serial@2c00 {           // PSC6
11287 +                       device_type = "serial";
11288 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
11289 +                       port-number = <5>;  // Logical port assignment
11290 +                       reg = <2c00 100>;
11291 +                       interrupts = <2 4 0>;
11292 +                       interrupt-parent = <&mpc5200_pic>;
11293 +               };
11294 +
11295 +               ethernet@3000 {
11296 +                       device_type = "network";
11297 +                       compatible = "mpc5200b-fec","mpc5200-fec";
11298 +                       reg = <3000 800>;
11299 +                       local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
11300 +                       interrupts = <2 5 0>;
11301 +                       interrupt-parent = <&mpc5200_pic>;
11302 +               };
11303 +
11304 +               i2c@3d40 {
11305 +                       compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
11306 +                       reg = <3d40 40>;
11307 +                       interrupts = <2 10 0>;
11308 +                       interrupt-parent = <&mpc5200_pic>;
11309 +                       fsl5200-clocking;
11310 +               };
11311 +
11312 +               sram@8000 {
11313 +                       compatible = "mpc5200b-sram","mpc5200-sram";
11314 +                       reg = <8000 4000>;
11315 +               };
11316 +       };
11317 +};
11318 Index: linux-2.6.24.7/arch/powerpc/boot/dts/ebony.dts
11319 ===================================================================
11320 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/ebony.dts
11321 +++ linux-2.6.24.7/arch/powerpc/boot/dts/ebony.dts
11322 @@ -16,14 +16,22 @@
11323         #size-cells = <1>;
11324         model = "ibm,ebony";
11325         compatible = "ibm,ebony";
11326 -       dcr-parent = <&/cpus/PowerPC,440GP@0>;
11327 +       dcr-parent = <&/cpus/cpu@0>;
11328 +
11329 +       aliases {
11330 +               ethernet0 = &EMAC0;
11331 +               ethernet1 = &EMAC1;
11332 +               serial0 = &UART0;
11333 +               serial1 = &UART1;
11334 +       };
11335  
11336         cpus {
11337                 #address-cells = <1>;
11338                 #size-cells = <0>;
11339  
11340 -               PowerPC,440GP@0 {
11341 +               cpu@0 {
11342                         device_type = "cpu";
11343 +                       model = "PowerPC,440GP";
11344                         reg = <0>;
11345                         clock-frequency = <0>; // Filled in by zImage
11346                         timebase-frequency = <0>; // Filled in by zImage
11347 @@ -150,9 +158,10 @@
11348                                         };
11349                                 };
11350  
11351 -                               ds1743@1,0 {
11352 +                               nvram@1,0 {
11353                                         /* NVRAM & RTC */
11354 -                                       compatible = "ds1743";
11355 +                                       compatible = "ds1743-nvram";
11356 +                                       #bytes = <2000>;
11357                                         reg = <1 0 2000>;
11358                                 };
11359  
11360 @@ -284,12 +293,43 @@
11361  
11362                 };
11363  
11364 -               PCIX0: pci@1234 {
11365 +               PCIX0: pci@20ec00000 {
11366                         device_type = "pci";
11367 -                       /* FIXME */
11368 -                       reg = <2 0ec00000 8
11369 -                              2 0ec80000 f0
11370 -                              2 0ec80100 fc>;
11371 +                       #interrupt-cells = <1>;
11372 +                       #size-cells = <2>;
11373 +                       #address-cells = <3>;
11374 +                       compatible = "ibm,plb440gp-pcix", "ibm,plb-pcix";
11375 +                       primary;
11376 +                       reg = <2 0ec00000 8     /* Config space access */
11377 +                              0 0 0            /* no IACK cycles */
11378 +                              2 0ed00000 4     /* Special cycles */
11379 +                              2 0ec80000 f0    /* Internal registers */
11380 +                              2 0ec80100 fc>;  /* Internal messaging registers */
11381 +
11382 +                       /* Outbound ranges, one memory and one IO,
11383 +                        * later cannot be changed
11384 +                        */
11385 +                       ranges = <02000000 0 80000000 00000003 80000000 0 80000000
11386 +                                 01000000 0 00000000 00000002 08000000 0 00010000>;
11387 +
11388 +                       /* Inbound 2GB range starting at 0 */
11389 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
11390 +
11391 +                       /* Ebony has all 4 IRQ pins tied together per slot */
11392 +                       interrupt-map-mask = <f800 0 0 0>;
11393 +                       interrupt-map = <
11394 +                               /* IDSEL 1 */
11395 +                               0800 0 0 0 &UIC0 17 8
11396 +
11397 +                               /* IDSEL 2 */
11398 +                               1000 0 0 0 &UIC0 18 8
11399 +
11400 +                               /* IDSEL 3 */
11401 +                               1800 0 0 0 &UIC0 19 8
11402 +
11403 +                               /* IDSEL 4 */
11404 +                               2000 0 0 0 &UIC0 1a 8
11405 +                       >;
11406                 };
11407         };
11408  
11409 Index: linux-2.6.24.7/arch/powerpc/boot/dts/ep405.dts
11410 ===================================================================
11411 --- /dev/null
11412 +++ linux-2.6.24.7/arch/powerpc/boot/dts/ep405.dts
11413 @@ -0,0 +1,228 @@
11414 +/*
11415 + * Device Tree Source for EP405
11416 + *
11417 + * Copyright 2007 IBM Corp.
11418 + * Benjamin Herrenschmidt <benh@kernel.crashing.org>
11419 + *
11420 + * This file is licensed under the terms of the GNU General Public
11421 + * License version 2.  This program is licensed "as is" without
11422 + * any warranty of any kind, whether express or implied.
11423 + */
11424 +
11425 +/ {
11426 +       #address-cells = <1>;
11427 +       #size-cells = <1>;
11428 +       model = "ep405";
11429 +       compatible = "ep405";
11430 +       dcr-parent = <&/cpus/cpu@0>;
11431 +
11432 +       aliases {
11433 +               ethernet0 = &EMAC;
11434 +               serial0 = &UART0;
11435 +               serial1 = &UART1;
11436 +       };
11437 +
11438 +       cpus {
11439 +               #address-cells = <1>;
11440 +               #size-cells = <0>;
11441 +
11442 +               cpu@0 {
11443 +                       device_type = "cpu";
11444 +                       model = "PowerPC,405GP";
11445 +                       reg = <0>;
11446 +                       clock-frequency = <bebc200>; /* Filled in by zImage */
11447 +                       timebase-frequency = <0>; /* Filled in by zImage */
11448 +                       i-cache-line-size = <20>;
11449 +                       d-cache-line-size = <20>;
11450 +                       i-cache-size = <4000>;
11451 +                       d-cache-size = <4000>;
11452 +                       dcr-controller;
11453 +                       dcr-access-method = "native";
11454 +               };
11455 +       };
11456 +
11457 +       memory {
11458 +               device_type = "memory";
11459 +               reg = <0 0>; /* Filled in by zImage */
11460 +       };
11461 +
11462 +       UIC0: interrupt-controller {
11463 +               compatible = "ibm,uic";
11464 +               interrupt-controller;
11465 +               cell-index = <0>;
11466 +               dcr-reg = <0c0 9>;
11467 +               #address-cells = <0>;
11468 +               #size-cells = <0>;
11469 +               #interrupt-cells = <2>;
11470 +       };
11471 +
11472 +       plb {
11473 +               compatible = "ibm,plb3";
11474 +               #address-cells = <1>;
11475 +               #size-cells = <1>;
11476 +               ranges;
11477 +               clock-frequency = <0>; /* Filled in by zImage */
11478 +
11479 +               SDRAM0: memory-controller {
11480 +                       compatible = "ibm,sdram-405gp";
11481 +                       dcr-reg = <010 2>;
11482 +               };
11483 +
11484 +               MAL: mcmal {
11485 +                       compatible = "ibm,mcmal-405gp", "ibm,mcmal";
11486 +                       dcr-reg = <180 62>;
11487 +                       num-tx-chans = <1>;
11488 +                       num-rx-chans = <1>;
11489 +                       interrupt-parent = <&UIC0>;
11490 +                       interrupts = <
11491 +                               b 4 /* TXEOB */
11492 +                               c 4 /* RXEOB */
11493 +                               a 4 /* SERR */
11494 +                               d 4 /* TXDE */
11495 +                               e 4 /* RXDE */>;
11496 +               };
11497 +
11498 +               POB0: opb {
11499 +                       compatible = "ibm,opb-405gp", "ibm,opb";
11500 +                       #address-cells = <1>;
11501 +                       #size-cells = <1>;
11502 +                       ranges = <ef600000 ef600000 a00000>;
11503 +                       dcr-reg = <0a0 5>;
11504 +                       clock-frequency = <0>; /* Filled in by zImage */
11505 +
11506 +                       UART0: serial@ef600300 {
11507 +                               device_type = "serial";
11508 +                               compatible = "ns16550";
11509 +                               reg = <ef600300 8>;
11510 +                               virtual-reg = <ef600300>;
11511 +                               clock-frequency = <0>; /* Filled in by zImage */
11512 +                               current-speed = <2580>;
11513 +                               interrupt-parent = <&UIC0>;
11514 +                               interrupts = <0 4>;
11515 +                       };
11516 +
11517 +                       UART1: serial@ef600400 {
11518 +                               device_type = "serial";
11519 +                               compatible = "ns16550";
11520 +                               reg = <ef600400 8>;
11521 +                               virtual-reg = <ef600400>;
11522 +                               clock-frequency = <0>; /* Filled in by zImage */
11523 +                               current-speed = <2580>;
11524 +                               interrupt-parent = <&UIC0>;
11525 +                               interrupts = <1 4>;
11526 +                       };
11527 +
11528 +                       IIC: i2c@ef600500 {
11529 +                               compatible = "ibm,iic-405gp", "ibm,iic";
11530 +                               reg = <ef600500 11>;
11531 +                               interrupt-parent = <&UIC0>;
11532 +                               interrupts = <2 4>;
11533 +                       };
11534 +
11535 +                       GPIO: gpio@ef600700 {
11536 +                               compatible = "ibm,gpio-405gp";
11537 +                               reg = <ef600700 20>;
11538 +                       };
11539 +
11540 +                       EMAC: ethernet@ef600800 {
11541 +                               linux,network-index = <0>;
11542 +                               device_type = "network";
11543 +                               compatible = "ibm,emac-405gp", "ibm,emac";
11544 +                               interrupt-parent = <&UIC0>;
11545 +                               interrupts = <
11546 +                                       f 4 /* Ethernet */
11547 +                                       9 4 /* Ethernet Wake Up */>;
11548 +                               local-mac-address = [000000000000]; /* Filled in by zImage */
11549 +                               reg = <ef600800 70>;
11550 +                               mal-device = <&MAL>;
11551 +                               mal-tx-channel = <0>;
11552 +                               mal-rx-channel = <0>;
11553 +                               cell-index = <0>;
11554 +                               max-frame-size = <5dc>;
11555 +                               rx-fifo-size = <1000>;
11556 +                               tx-fifo-size = <800>;
11557 +                               phy-mode = "rmii";
11558 +                               phy-map = <00000000>;
11559 +                       };
11560 +
11561 +               };
11562 +
11563 +               EBC0: ebc {
11564 +                       compatible = "ibm,ebc-405gp", "ibm,ebc";
11565 +                       dcr-reg = <012 2>;
11566 +                       #address-cells = <2>;
11567 +                       #size-cells = <1>;
11568 +
11569 +
11570 +                       /* The ranges property is supplied by the bootwrapper
11571 +                        * and is based on the firmware's configuration of the
11572 +                        * EBC bridge
11573 +                        */
11574 +                       clock-frequency = <0>; /* Filled in by zImage */
11575 +
11576 +                       /* NVRAM and RTC */
11577 +                       nvrtc@4,200000 {
11578 +                               compatible = "ds1742";
11579 +                               reg = <4 200000 0>; /* size fixed up by zImage */
11580 +                       };
11581 +
11582 +                       /* "BCSR" CPLD contains a PCI irq controller */
11583 +                       bcsr@4,0 {
11584 +                               compatible = "ep405-bcsr";
11585 +                               reg = <4 0 10>;
11586 +                               interrupt-controller;
11587 +                               /* Routing table */
11588 +                               irq-routing = [ 00      /* SYSERR */
11589 +                                               01      /* STTM */
11590 +                                               01      /* RTC */
11591 +                                               01      /* FENET */
11592 +                                               02      /* NB PCIIRQ mux ? */
11593 +                                               03      /* SB Winbond 8259 ? */
11594 +                                               04      /* Serial Ring */
11595 +                                               05      /* USB (ep405pc) */
11596 +                                               06      /* XIRQ 0 */
11597 +                                               06      /* XIRQ 1 */
11598 +                                               06      /* XIRQ 2 */
11599 +                                               06      /* XIRQ 3 */
11600 +                                               06      /* XIRQ 4 */
11601 +                                               06      /* XIRQ 5 */
11602 +                                               06      /* XIRQ 6 */
11603 +                                               07];    /* Reserved */
11604 +                       };
11605 +               };
11606 +
11607 +               PCI0: pci@ec000000 {
11608 +                       device_type = "pci";
11609 +                       #interrupt-cells = <1>;
11610 +                       #size-cells = <2>;
11611 +                       #address-cells = <3>;
11612 +                       compatible = "ibm,plb405gp-pci", "ibm,plb-pci";
11613 +                       primary;
11614 +                       reg = <eec00000 8       /* Config space access */
11615 +                              eed80000 4       /* IACK */
11616 +                              eed80000 4       /* Special cycle */
11617 +                              ef480000 40>;    /* Internal registers */
11618 +
11619 +                       /* Outbound ranges, one memory and one IO,
11620 +                        * later cannot be changed. Chip supports a second
11621 +                        * IO range but we don't use it for now
11622 +                        */
11623 +                       ranges = <02000000 0 80000000 80000000 0 20000000
11624 +                                 01000000 0 00000000 e8000000 0 00010000>;
11625 +
11626 +                       /* Inbound 2GB range starting at 0 */
11627 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
11628 +
11629 +                       /* That's all I know about IRQs on that thing ... */
11630 +                       interrupt-map-mask = <f800 0 0 0>;
11631 +                       interrupt-map = <
11632 +                               /* USB */
11633 +                               7000 0 0 0 &UIC0 1e 8 /* IRQ5 */
11634 +                       >;
11635 +               };
11636 +       };
11637 +
11638 +       chosen {
11639 +               linux,stdout-path = "/plb/opb/serial@ef600300";
11640 +       };
11641 +};
11642 Index: linux-2.6.24.7/arch/powerpc/boot/dts/ep8248e.dts
11643 ===================================================================
11644 --- /dev/null
11645 +++ linux-2.6.24.7/arch/powerpc/boot/dts/ep8248e.dts
11646 @@ -0,0 +1,207 @@
11647 +/*
11648 + * Device Tree for the Embedded Planet EP8248E board running PlanetCore.
11649 + *
11650 + * Copyright 2007 Freescale Semiconductor Inc.
11651 + *
11652 + * This program is free software; you can redistribute  it and/or modify it
11653 + * under  the terms of  the GNU General  Public License as published by the
11654 + * Free Software Foundation;  either version 2 of the  License, or (at your
11655 + * option) any later version.
11656 + */
11657 +
11658 +/dts-v1/;
11659 +/ {
11660 +       model = "EP8248E";
11661 +       compatible = "fsl,ep8248e";
11662 +       #address-cells = <1>;
11663 +       #size-cells = <1>;
11664 +
11665 +       aliases {
11666 +               planetcore-SMC1 = &smc1;
11667 +               planetcore-SCC1 = &scc1;
11668 +               ethernet0 = &eth0;
11669 +               ethernet1 = &eth1;
11670 +               serial0 = &smc1;
11671 +               serial1 = &scc1;
11672 +       };
11673 +
11674 +       cpus {
11675 +               #address-cells = <1>;
11676 +               #size-cells = <0>;
11677 +
11678 +               PowerPC,8248@0 {
11679 +                       device_type = "cpu";
11680 +                       reg = <0>;
11681 +                       d-cache-line-size = <32>;
11682 +                       i-cache-line-size = <32>;
11683 +                       d-cache-size = <16384>;
11684 +                       i-cache-size = <16384>;
11685 +                       timebase-frequency = <0>;
11686 +                       clock-frequency = <0>;
11687 +               };
11688 +       };
11689 +
11690 +       localbus@f0010100 {
11691 +               compatible = "fsl,mpc8248-localbus",
11692 +                            "fsl,pq2-localbus",
11693 +                            "simple-bus";
11694 +               #address-cells = <2>;
11695 +               #size-cells = <1>;
11696 +               reg = <0xf0010100 0x40>;
11697 +
11698 +               ranges = <0 0 0xfc000000 0x04000000
11699 +                         1 0 0xfa000000 0x00008000>;
11700 +
11701 +               flash@0,3800000 {
11702 +                       compatible = "cfi-flash";
11703 +                       reg = <0 0x3800000 0x800000>;
11704 +                       bank-width = <4>;
11705 +                       device-width = <2>;
11706 +               };
11707 +
11708 +               bcsr@1,0 {
11709 +                       #address-cells = <2>;
11710 +                       #size-cells = <1>;
11711 +                       reg = <1 0 0x10>;
11712 +                       compatible = "fsl,ep8248e-bcsr";
11713 +                       ranges;
11714 +
11715 +                       mdio {
11716 +                               device_type = "mdio";
11717 +                               compatible = "fsl,ep8248e-mdio-bitbang";
11718 +                               #address-cells = <1>;
11719 +                               #size-cells = <0>;
11720 +                               reg = <1 8 1>;
11721 +
11722 +                               PHY0: ethernet-phy@0 {
11723 +                                       interrupt-parent = <&PIC>;
11724 +                                       reg = <0>;
11725 +                                       device_type = "ethernet-phy";
11726 +                               };
11727 +
11728 +                               PHY1: ethernet-phy@1 {
11729 +                                       interrupt-parent = <&PIC>;
11730 +                                       reg = <1>;
11731 +                                       device_type = "ethernet-phy";
11732 +                               };
11733 +                       };
11734 +               };
11735 +       };
11736 +
11737 +       memory {
11738 +               device_type = "memory";
11739 +               reg = <0 0>;
11740 +       };
11741 +
11742 +       soc@f0000000 {
11743 +               #address-cells = <1>;
11744 +               #size-cells = <1>;
11745 +               compatible = "fsl,mpc8248-immr", "fsl,pq2-soc", "simple-bus";
11746 +               ranges = <0x00000000 0xf0000000 0x00053000>;
11747 +
11748 +               // Temporary until code stops depending on it.
11749 +               device_type = "soc";
11750 +
11751 +               // Temporary -- will go away once kernel uses ranges for get_immrbase().
11752 +               reg = <0xf0000000 0x00053000>;
11753 +
11754 +               cpm@119c0 {
11755 +                       #address-cells = <1>;
11756 +                       #size-cells = <1>;
11757 +                       #interrupt-cells = <2>;
11758 +                       compatible = "fsl,mpc8248-cpm", "fsl,cpm2",
11759 +                                    "simple-bus";
11760 +                       reg = <0x119c0 0x30>;
11761 +                       ranges;
11762 +
11763 +                       muram {
11764 +                               #address-cells = <1>;
11765 +                               #size-cells = <1>;
11766 +                               ranges = <0 0 0x10000>;
11767 +
11768 +                               data@0 {
11769 +                                       compatible = "fsl,cpm-muram-data";
11770 +                                       reg = <0 0x1100 0x1140
11771 +                                              0xec0 0x9800 0x800>;
11772 +                               };
11773 +                       };
11774 +
11775 +                       brg@119f0 {
11776 +                               compatible = "fsl,mpc8248-brg",
11777 +                                            "fsl,cpm2-brg",
11778 +                                            "fsl,cpm-brg";
11779 +                               reg = <0x119f0 0x10 0x115f0 0x10>;
11780 +                       };
11781 +
11782 +                       /* Monitor port/SMC1 */
11783 +                       smc1: serial@11a80 {
11784 +                               device_type = "serial";
11785 +                               compatible = "fsl,mpc8248-smc-uart",
11786 +                                            "fsl,cpm2-smc-uart";
11787 +                               reg = <0x11a80 0x20 0x1100 0x40>;
11788 +                               interrupts = <4 8>;
11789 +                               interrupt-parent = <&PIC>;
11790 +                               fsl,cpm-brg = <7>;
11791 +                               fsl,cpm-command = <0x1d000000>;
11792 +                               linux,planetcore-label = "SMC1";
11793 +                       };
11794 +
11795 +                       /* "Serial" port/SCC1 */
11796 +                       scc1: serial@11a00 {
11797 +                               device_type = "serial";
11798 +                               compatible = "fsl,mpc8248-scc-uart",
11799 +                                            "fsl,cpm2-scc-uart";
11800 +                               reg = <0x11a00 0x20 0x8000 0x100>;
11801 +                               interrupts = <40 8>;
11802 +                               interrupt-parent = <&PIC>;
11803 +                               fsl,cpm-brg = <1>;
11804 +                               fsl,cpm-command = <0x00800000>;
11805 +                               linux,planetcore-label = "SCC1";
11806 +                       };
11807 +
11808 +                       eth0: ethernet@11300 {
11809 +                               device_type = "network";
11810 +                               compatible = "fsl,mpc8248-fcc-enet",
11811 +                                            "fsl,cpm2-fcc-enet";
11812 +                               reg = <0x11300 0x20 0x8400 0x100 0x11390 1>;
11813 +                               local-mac-address = [ 00 00 00 00 00 00 ];
11814 +                               interrupts = <32 8>;
11815 +                               interrupt-parent = <&PIC>;
11816 +                               phy-handle = <&PHY0>;
11817 +                               linux,network-index = <0>;
11818 +                               fsl,cpm-command = <0x12000300>;
11819 +                       };
11820 +
11821 +                       eth1: ethernet@11320 {
11822 +                               device_type = "network";
11823 +                               compatible = "fsl,mpc8248-fcc-enet",
11824 +                                            "fsl,cpm2-fcc-enet";
11825 +                               reg = <0x11320 0x20 0x8500 0x100 0x113b0 1>;
11826 +                               local-mac-address = [ 00 00 00 00 00 00 ];
11827 +                               interrupts = <33 8>;
11828 +                               interrupt-parent = <&PIC>;
11829 +                               phy-handle = <&PHY1>;
11830 +                               linux,network-index = <1>;
11831 +                               fsl,cpm-command = <0x16200300>;
11832 +                       };
11833 +
11834 +                       usb@11b60 {
11835 +                               #address-cells = <1>;
11836 +                               #size-cells = <0>;
11837 +                               compatible = "fsl,mpc8248-usb",
11838 +                                            "fsl,cpm2-usb";
11839 +                               reg = <0x11b60 0x18 0x8b00 0x100>;
11840 +                               interrupt-parent = <&PIC>;
11841 +                               interrupts = <11 8>;
11842 +                               fsl,cpm-command = <0x2e600000>;
11843 +                       };
11844 +               };
11845 +
11846 +               PIC: interrupt-controller@10c00 {
11847 +                       #interrupt-cells = <2>;
11848 +                       interrupt-controller;
11849 +                       reg = <0x10c00 0x80>;
11850 +                       compatible = "fsl,mpc8248-pic", "fsl,pq2-pic";
11851 +               };
11852 +       };
11853 +};
11854 Index: linux-2.6.24.7/arch/powerpc/boot/dts/haleakala.dts
11855 ===================================================================
11856 --- /dev/null
11857 +++ linux-2.6.24.7/arch/powerpc/boot/dts/haleakala.dts
11858 @@ -0,0 +1,274 @@
11859 +/*
11860 + * Device Tree Source for AMCC Haleakala (405EXr)
11861 + *
11862 + * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
11863 + *
11864 + * This file is licensed under the terms of the GNU General Public
11865 + * License version 2.  This program is licensed "as is" without
11866 + * any warranty of any kind, whether express or implied.
11867 + */
11868 +
11869 +/ {
11870 +       #address-cells = <1>;
11871 +       #size-cells = <1>;
11872 +       model = "amcc,haleakala";
11873 +       compatible = "amcc,kilauea";
11874 +       dcr-parent = <&/cpus/cpu@0>;
11875 +
11876 +       aliases {
11877 +               ethernet0 = &EMAC0;
11878 +               serial0 = &UART0;
11879 +               serial1 = &UART1;
11880 +       };
11881 +
11882 +       cpus {
11883 +               #address-cells = <1>;
11884 +               #size-cells = <0>;
11885 +
11886 +               cpu@0 {
11887 +                       device_type = "cpu";
11888 +                       model = "PowerPC,405EXr";
11889 +                       reg = <0>;
11890 +                       clock-frequency = <0>; /* Filled in by U-Boot */
11891 +                       timebase-frequency = <0>; /* Filled in by U-Boot */
11892 +                       i-cache-line-size = <20>;
11893 +                       d-cache-line-size = <20>;
11894 +                       i-cache-size = <4000>; /* 16 kB */
11895 +                       d-cache-size = <4000>; /* 16 kB */
11896 +                       dcr-controller;
11897 +                       dcr-access-method = "native";
11898 +               };
11899 +       };
11900 +
11901 +       memory {
11902 +               device_type = "memory";
11903 +               reg = <0 0>; /* Filled in by U-Boot */
11904 +       };
11905 +
11906 +       UIC0: interrupt-controller {
11907 +               compatible = "ibm,uic-405exr", "ibm,uic";
11908 +               interrupt-controller;
11909 +               cell-index = <0>;
11910 +               dcr-reg = <0c0 009>;
11911 +               #address-cells = <0>;
11912 +               #size-cells = <0>;
11913 +               #interrupt-cells = <2>;
11914 +       };
11915 +
11916 +       UIC1: interrupt-controller1 {
11917 +               compatible = "ibm,uic-405exr","ibm,uic";
11918 +               interrupt-controller;
11919 +               cell-index = <1>;
11920 +               dcr-reg = <0d0 009>;
11921 +               #address-cells = <0>;
11922 +               #size-cells = <0>;
11923 +               #interrupt-cells = <2>;
11924 +               interrupts = <1e 4 1f 4>; /* cascade */
11925 +               interrupt-parent = <&UIC0>;
11926 +       };
11927 +
11928 +       UIC2: interrupt-controller2 {
11929 +               compatible = "ibm,uic-405exr","ibm,uic";
11930 +               interrupt-controller;
11931 +               cell-index = <2>;
11932 +               dcr-reg = <0e0 009>;
11933 +               #address-cells = <0>;
11934 +               #size-cells = <0>;
11935 +               #interrupt-cells = <2>;
11936 +               interrupts = <1c 4 1d 4>; /* cascade */
11937 +               interrupt-parent = <&UIC0>;
11938 +       };
11939 +
11940 +       plb {
11941 +               compatible = "ibm,plb-405exr", "ibm,plb4";
11942 +               #address-cells = <1>;
11943 +               #size-cells = <1>;
11944 +               ranges;
11945 +               clock-frequency = <0>; /* Filled in by U-Boot */
11946 +
11947 +               SDRAM0: memory-controller {
11948 +                       compatible = "ibm,sdram-405exr";
11949 +                       dcr-reg = <010 2>;
11950 +               };
11951 +
11952 +               MAL0: mcmal {
11953 +                       compatible = "ibm,mcmal-405exr", "ibm,mcmal2";
11954 +                       dcr-reg = <180 62>;
11955 +                       num-tx-chans = <2>;
11956 +                       num-rx-chans = <2>;
11957 +                       interrupt-parent = <&MAL0>;
11958 +                       interrupts = <0 1 2 3 4>;
11959 +                       #interrupt-cells = <1>;
11960 +                       #address-cells = <0>;
11961 +                       #size-cells = <0>;
11962 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
11963 +                                       /*RXEOB*/ 1 &UIC0 b 4
11964 +                                       /*SERR*/  2 &UIC1 0 4
11965 +                                       /*TXDE*/  3 &UIC1 1 4
11966 +                                       /*RXDE*/  4 &UIC1 2 4>;
11967 +                       interrupt-map-mask = <ffffffff>;
11968 +               };
11969 +
11970 +               POB0: opb {
11971 +                       compatible = "ibm,opb-405exr", "ibm,opb";
11972 +                       #address-cells = <1>;
11973 +                       #size-cells = <1>;
11974 +                       ranges = <80000000 80000000 10000000
11975 +                                 ef600000 ef600000 a00000
11976 +                                 f0000000 f0000000 10000000>;
11977 +                       dcr-reg = <0a0 5>;
11978 +                       clock-frequency = <0>; /* Filled in by U-Boot */
11979 +
11980 +                       EBC0: ebc {
11981 +                               compatible = "ibm,ebc-405exr", "ibm,ebc";
11982 +                               dcr-reg = <012 2>;
11983 +                               #address-cells = <2>;
11984 +                               #size-cells = <1>;
11985 +                               clock-frequency = <0>; /* Filled in by U-Boot */
11986 +                               /* ranges property is supplied by U-Boot */
11987 +                               interrupts = <5 1>;
11988 +                               interrupt-parent = <&UIC1>;
11989 +
11990 +                               nor_flash@0,0 {
11991 +                                       compatible = "amd,s29gl512n", "cfi-flash";
11992 +                                       bank-width = <2>;
11993 +                                       reg = <0 000000 4000000>;
11994 +                                       #address-cells = <1>;
11995 +                                       #size-cells = <1>;
11996 +                                       partition@0 {
11997 +                                               label = "kernel";
11998 +                                               reg = <0 200000>;
11999 +                                       };
12000 +                                       partition@200000 {
12001 +                                               label = "root";
12002 +                                               reg = <200000 200000>;
12003 +                                       };
12004 +                                       partition@400000 {
12005 +                                               label = "user";
12006 +                                               reg = <400000 3b60000>;
12007 +                                       };
12008 +                                       partition@3f60000 {
12009 +                                               label = "env";
12010 +                                               reg = <3f60000 40000>;
12011 +                                       };
12012 +                                       partition@3fa0000 {
12013 +                                               label = "u-boot";
12014 +                                               reg = <3fa0000 60000>;
12015 +                                       };
12016 +                               };
12017 +                       };
12018 +
12019 +                       UART0: serial@ef600200 {
12020 +                               device_type = "serial";
12021 +                               compatible = "ns16550";
12022 +                               reg = <ef600200 8>;
12023 +                               virtual-reg = <ef600200>;
12024 +                               clock-frequency = <0>; /* Filled in by U-Boot */
12025 +                               current-speed = <0>;
12026 +                               interrupt-parent = <&UIC0>;
12027 +                               interrupts = <1a 4>;
12028 +                       };
12029 +
12030 +                       UART1: serial@ef600300 {
12031 +                               device_type = "serial";
12032 +                               compatible = "ns16550";
12033 +                               reg = <ef600300 8>;
12034 +                               virtual-reg = <ef600300>;
12035 +                               clock-frequency = <0>; /* Filled in by U-Boot */
12036 +                               current-speed = <0>;
12037 +                               interrupt-parent = <&UIC0>;
12038 +                               interrupts = <1 4>;
12039 +                       };
12040 +
12041 +                       IIC0: i2c@ef600400 {
12042 +                               compatible = "ibm,iic-405exr", "ibm,iic";
12043 +                               reg = <ef600400 14>;
12044 +                               interrupt-parent = <&UIC0>;
12045 +                               interrupts = <2 4>;
12046 +                       };
12047 +
12048 +                       IIC1: i2c@ef600500 {
12049 +                               compatible = "ibm,iic-405exr", "ibm,iic";
12050 +                               reg = <ef600500 14>;
12051 +                               interrupt-parent = <&UIC0>;
12052 +                               interrupts = <7 4>;
12053 +                       };
12054 +
12055 +
12056 +                       RGMII0: emac-rgmii@ef600b00 {
12057 +                               compatible = "ibm,rgmii-405exr", "ibm,rgmii";
12058 +                               reg = <ef600b00 104>;
12059 +                               has-mdio;
12060 +                       };
12061 +
12062 +                       EMAC0: ethernet@ef600900 {
12063 +                               linux,network-index = <0>;
12064 +                               device_type = "network";
12065 +                               compatible = "ibm,emac-405exr", "ibm,emac4";
12066 +                               interrupt-parent = <&EMAC0>;
12067 +                               interrupts = <0 1>;
12068 +                               #interrupt-cells = <1>;
12069 +                               #address-cells = <0>;
12070 +                               #size-cells = <0>;
12071 +                               interrupt-map = </*Status*/ 0 &UIC0 18 4
12072 +                                               /*Wake*/  1 &UIC1 1d 4>;
12073 +                               reg = <ef600900 70>;
12074 +                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
12075 +                               mal-device = <&MAL0>;
12076 +                               mal-tx-channel = <0>;
12077 +                               mal-rx-channel = <0>;
12078 +                               cell-index = <0>;
12079 +                               max-frame-size = <5dc>;
12080 +                               rx-fifo-size = <1000>;
12081 +                               tx-fifo-size = <800>;
12082 +                               phy-mode = "rgmii";
12083 +                               phy-map = <00000000>;
12084 +                               rgmii-device = <&RGMII0>;
12085 +                               rgmii-channel = <0>;
12086 +                               has-inverted-stacr-oc;
12087 +                               has-new-stacr-staopc;
12088 +                       };
12089 +               };
12090 +
12091 +               PCIE0: pciex@0a0000000 {
12092 +                       device_type = "pci";
12093 +                       #interrupt-cells = <1>;
12094 +                       #size-cells = <2>;
12095 +                       #address-cells = <3>;
12096 +                       compatible = "ibm,plb-pciex-405exr", "ibm,plb-pciex";
12097 +                       primary;
12098 +                       port = <0>; /* port number */
12099 +                       reg = <a0000000 20000000        /* Config space access */
12100 +                              ef000000 00001000>;      /* Registers */
12101 +                       dcr-reg = <040 020>;
12102 +                       sdr-base = <400>;
12103 +
12104 +                       /* Outbound ranges, one memory and one IO,
12105 +                        * later cannot be changed
12106 +                        */
12107 +                       ranges = <02000000 0 80000000 90000000 0 08000000
12108 +                                 01000000 0 00000000 e0000000 0 00010000>;
12109 +
12110 +                       /* Inbound 2GB range starting at 0 */
12111 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
12112 +
12113 +                       /* This drives busses 0x00 to 0x3f */
12114 +                       bus-range = <00 3f>;
12115 +
12116 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12117 +                        * to invert PCIe legacy interrupts).
12118 +                        * We are de-swizzling here because the numbers are actually for
12119 +                        * port of the root complex virtual P2P bridge. But I want
12120 +                        * to avoid putting a node for it in the tree, so the numbers
12121 +                        * below are basically de-swizzled numbers.
12122 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12123 +                        */
12124 +                       interrupt-map-mask = <0000 0 0 7>;
12125 +                       interrupt-map = <
12126 +                               0000 0 0 1 &UIC2 0 4 /* swizzled int A */
12127 +                               0000 0 0 2 &UIC2 1 4 /* swizzled int B */
12128 +                               0000 0 0 3 &UIC2 2 4 /* swizzled int C */
12129 +                               0000 0 0 4 &UIC2 3 4 /* swizzled int D */>;
12130 +               };
12131 +       };
12132 +};
12133 Index: linux-2.6.24.7/arch/powerpc/boot/dts/katmai.dts
12134 ===================================================================
12135 --- /dev/null
12136 +++ linux-2.6.24.7/arch/powerpc/boot/dts/katmai.dts
12137 @@ -0,0 +1,400 @@
12138 +/*
12139 + * Device Tree Source for AMCC Katmai eval board
12140 + *
12141 + * Copyright (c) 2006, 2007 IBM Corp.
12142 + * Benjamin Herrenschmidt <benh@kernel.crashing.org>
12143 + *
12144 + * Copyright (c) 2006, 2007 IBM Corp.
12145 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
12146 + *
12147 + * This file is licensed under the terms of the GNU General Public
12148 + * License version 2.  This program is licensed "as is" without
12149 + * any warranty of any kind, whether express or implied.
12150 + */
12151 +
12152 +/ {
12153 +       #address-cells = <2>;
12154 +       #size-cells = <1>;
12155 +       model = "amcc,katmai";
12156 +       compatible = "amcc,katmai";
12157 +       dcr-parent = <&/cpus/cpu@0>;
12158 +
12159 +       aliases {
12160 +               ethernet0 = &EMAC0;
12161 +               serial0 = &UART0;
12162 +               serial1 = &UART1;
12163 +               serial2 = &UART2;
12164 +       };
12165 +
12166 +       cpus {
12167 +               #address-cells = <1>;
12168 +               #size-cells = <0>;
12169 +
12170 +               cpu@0 {
12171 +                       device_type = "cpu";
12172 +                       model = "PowerPC,440SPe";
12173 +                       reg = <0>;
12174 +                       clock-frequency = <0>; /* Filled in by zImage */
12175 +                       timebase-frequency = <0>; /* Filled in by zImage */
12176 +                       i-cache-line-size = <20>;
12177 +                       d-cache-line-size = <20>;
12178 +                       i-cache-size = <20000>;
12179 +                       d-cache-size = <20000>;
12180 +                       dcr-controller;
12181 +                       dcr-access-method = "native";
12182 +               };
12183 +       };
12184 +
12185 +       memory {
12186 +               device_type = "memory";
12187 +               reg = <0 0 0>; /* Filled in by zImage */
12188 +       };
12189 +
12190 +       UIC0: interrupt-controller0 {
12191 +               compatible = "ibm,uic-440spe","ibm,uic";
12192 +               interrupt-controller;
12193 +               cell-index = <0>;
12194 +               dcr-reg = <0c0 009>;
12195 +               #address-cells = <0>;
12196 +               #size-cells = <0>;
12197 +               #interrupt-cells = <2>;
12198 +       };
12199 +
12200 +       UIC1: interrupt-controller1 {
12201 +               compatible = "ibm,uic-440spe","ibm,uic";
12202 +               interrupt-controller;
12203 +               cell-index = <1>;
12204 +               dcr-reg = <0d0 009>;
12205 +               #address-cells = <0>;
12206 +               #size-cells = <0>;
12207 +               #interrupt-cells = <2>;
12208 +               interrupts = <1e 4 1f 4>; /* cascade */
12209 +               interrupt-parent = <&UIC0>;
12210 +       };
12211 +
12212 +       UIC2: interrupt-controller2 {
12213 +               compatible = "ibm,uic-440spe","ibm,uic";
12214 +               interrupt-controller;
12215 +               cell-index = <2>;
12216 +               dcr-reg = <0e0 009>;
12217 +               #address-cells = <0>;
12218 +               #size-cells = <0>;
12219 +               #interrupt-cells = <2>;
12220 +               interrupts = <a 4 b 4>; /* cascade */
12221 +               interrupt-parent = <&UIC0>;
12222 +       };
12223 +
12224 +       UIC3: interrupt-controller3 {
12225 +               compatible = "ibm,uic-440spe","ibm,uic";
12226 +               interrupt-controller;
12227 +               cell-index = <3>;
12228 +               dcr-reg = <0f0 009>;
12229 +               #address-cells = <0>;
12230 +               #size-cells = <0>;
12231 +               #interrupt-cells = <2>;
12232 +               interrupts = <10 4 11 4>; /* cascade */
12233 +               interrupt-parent = <&UIC0>;
12234 +       };
12235 +
12236 +       SDR0: sdr {
12237 +               compatible = "ibm,sdr-440spe";
12238 +               dcr-reg = <00e 002>;
12239 +       };
12240 +
12241 +       CPR0: cpr {
12242 +               compatible = "ibm,cpr-440spe";
12243 +               dcr-reg = <00c 002>;
12244 +       };
12245 +
12246 +       plb {
12247 +               compatible = "ibm,plb-440spe", "ibm,plb-440gp", "ibm,plb4";
12248 +               #address-cells = <2>;
12249 +               #size-cells = <1>;
12250 +               ranges;
12251 +               clock-frequency = <0>; /* Filled in by zImage */
12252 +
12253 +               SDRAM0: sdram {
12254 +                       compatible = "ibm,sdram-440spe", "ibm,sdram-405gp";
12255 +                       dcr-reg = <010 2>;
12256 +               };
12257 +
12258 +               MAL0: mcmal {
12259 +                       compatible = "ibm,mcmal-440spe", "ibm,mcmal2";
12260 +                       dcr-reg = <180 62>;
12261 +                       num-tx-chans = <2>;
12262 +                       num-rx-chans = <1>;
12263 +                       interrupt-parent = <&MAL0>;
12264 +                       interrupts = <0 1 2 3 4>;
12265 +                       #interrupt-cells = <1>;
12266 +                       #address-cells = <0>;
12267 +                       #size-cells = <0>;
12268 +                       interrupt-map = </*TXEOB*/ 0 &UIC1 6 4
12269 +                                        /*RXEOB*/ 1 &UIC1 7 4
12270 +                                        /*SERR*/  2 &UIC1 1 4
12271 +                                        /*TXDE*/  3 &UIC1 2 4
12272 +                                        /*RXDE*/  4 &UIC1 3 4>;
12273 +               };
12274 +
12275 +               POB0: opb {
12276 +                       compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb";
12277 +                       #address-cells = <1>;
12278 +                       #size-cells = <1>;
12279 +                       ranges = <00000000 4 e0000000 20000000>;
12280 +                       clock-frequency = <0>; /* Filled in by zImage */
12281 +
12282 +                       EBC0: ebc {
12283 +                               compatible = "ibm,ebc-440spe", "ibm,ebc-440gp", "ibm,ebc";
12284 +                               dcr-reg = <012 2>;
12285 +                               #address-cells = <2>;
12286 +                               #size-cells = <1>;
12287 +                               clock-frequency = <0>; /* Filled in by zImage */
12288 +                               interrupts = <5 1>;
12289 +                               interrupt-parent = <&UIC1>;
12290 +                       };
12291 +
12292 +                       UART0: serial@10000200 {
12293 +                               device_type = "serial";
12294 +                               compatible = "ns16550";
12295 +                               reg = <10000200 8>;
12296 +                               virtual-reg = <a0000200>;
12297 +                               clock-frequency = <0>; /* Filled in by zImage */
12298 +                               current-speed = <1c200>;
12299 +                               interrupt-parent = <&UIC0>;
12300 +                               interrupts = <0 4>;
12301 +                       };
12302 +
12303 +                       UART1: serial@10000300 {
12304 +                               device_type = "serial";
12305 +                               compatible = "ns16550";
12306 +                               reg = <10000300 8>;
12307 +                               virtual-reg = <a0000300>;
12308 +                               clock-frequency = <0>;
12309 +                               current-speed = <0>;
12310 +                               interrupt-parent = <&UIC0>;
12311 +                               interrupts = <1 4>;
12312 +                       };
12313 +
12314 +
12315 +                       UART2: serial@10000600 {
12316 +                               device_type = "serial";
12317 +                               compatible = "ns16550";
12318 +                               reg = <10000600 8>;
12319 +                               virtual-reg = <a0000600>;
12320 +                               clock-frequency = <0>;
12321 +                               current-speed = <0>;
12322 +                               interrupt-parent = <&UIC1>;
12323 +                               interrupts = <5 4>;
12324 +                       };
12325 +
12326 +                       IIC0: i2c@10000400 {
12327 +                               device_type = "i2c";
12328 +                               compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic";
12329 +                               reg = <10000400 14>;
12330 +                               interrupt-parent = <&UIC0>;
12331 +                               interrupts = <2 4>;
12332 +                       };
12333 +
12334 +                       IIC1: i2c@10000500 {
12335 +                               device_type = "i2c";
12336 +                               compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic";
12337 +                               reg = <10000500 14>;
12338 +                               interrupt-parent = <&UIC0>;
12339 +                               interrupts = <3 4>;
12340 +                       };
12341 +
12342 +                       EMAC0: ethernet@10000800 {
12343 +                               linux,network-index = <0>;
12344 +                               device_type = "network";
12345 +                               compatible = "ibm,emac-440spe", "ibm,emac4";
12346 +                               interrupt-parent = <&UIC1>;
12347 +                               interrupts = <1c 4 1d 4>;
12348 +                               reg = <10000800 70>;
12349 +                               local-mac-address = [000000000000];
12350 +                               mal-device = <&MAL0>;
12351 +                               mal-tx-channel = <0>;
12352 +                               mal-rx-channel = <0>;
12353 +                               cell-index = <0>;
12354 +                               max-frame-size = <5dc>;
12355 +                               rx-fifo-size = <1000>;
12356 +                               tx-fifo-size = <800>;
12357 +                               phy-mode = "gmii";
12358 +                               phy-map = <00000000>;
12359 +                               has-inverted-stacr-oc;
12360 +                               has-new-stacr-staopc;
12361 +                       };
12362 +               };
12363 +
12364 +               PCIX0: pci@c0ec00000 {
12365 +                       device_type = "pci";
12366 +                       #interrupt-cells = <1>;
12367 +                       #size-cells = <2>;
12368 +                       #address-cells = <3>;
12369 +                       compatible = "ibm,plb-pcix-440spe", "ibm,plb-pcix";
12370 +                       primary;
12371 +                       large-inbound-windows;
12372 +                       enable-msi-hole;
12373 +                       reg = <c 0ec00000   8   /* Config space access */
12374 +                              0 0 0            /* no IACK cycles */
12375 +                              c 0ed00000   4   /* Special cycles */
12376 +                              c 0ec80000 100   /* Internal registers */
12377 +                              c 0ec80100  fc>; /* Internal messaging registers */
12378 +
12379 +                       /* Outbound ranges, one memory and one IO,
12380 +                        * later cannot be changed
12381 +                        */
12382 +                       ranges = <02000000 0 80000000 0000000d 80000000 0 80000000
12383 +                                 01000000 0 00000000 0000000c 08000000 0 00010000>;
12384 +
12385 +                       /* Inbound 2GB range starting at 0 */
12386 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12387 +
12388 +                       /* This drives busses 0 to 0xf */
12389 +                       bus-range = <0 f>;
12390 +
12391 +                       /*
12392 +                        * On Katmai, the following PCI-X interrupts signals
12393 +                        * have to be enabled via jumpers (only INTA is
12394 +                        * enabled per default):
12395 +                        *
12396 +                        * INTB: J3: 1-2
12397 +                        * INTC: J2: 1-2
12398 +                        * INTD: J1: 1-2
12399 +                        */
12400 +                       interrupt-map-mask = <f800 0 0 7>;
12401 +                       interrupt-map = <
12402 +                               /* IDSEL 1 */
12403 +                               0800 0 0 1 &UIC1 14 8
12404 +                               0800 0 0 2 &UIC1 13 8
12405 +                               0800 0 0 3 &UIC1 12 8
12406 +                               0800 0 0 4 &UIC1 11 8
12407 +                       >;
12408 +               };
12409 +
12410 +               PCIE0: pciex@d00000000 {
12411 +                       device_type = "pci";
12412 +                       #interrupt-cells = <1>;
12413 +                       #size-cells = <2>;
12414 +                       #address-cells = <3>;
12415 +                       compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
12416 +                       primary;
12417 +                       port = <0>; /* port number */
12418 +                       reg = <d 00000000 20000000      /* Config space access */
12419 +                              c 10000000 00001000>;    /* Registers */
12420 +                       dcr-reg = <100 020>;
12421 +                       sdr-base = <300>;
12422 +
12423 +                       /* Outbound ranges, one memory and one IO,
12424 +                        * later cannot be changed
12425 +                        */
12426 +                       ranges = <02000000 0 80000000 0000000e 00000000 0 80000000
12427 +                                 01000000 0 00000000 0000000f 80000000 0 00010000>;
12428 +
12429 +                       /* Inbound 2GB range starting at 0 */
12430 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12431 +
12432 +                       /* This drives busses 10 to 0x1f */
12433 +                       bus-range = <10 1f>;
12434 +
12435 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12436 +                        * to invert PCIe legacy interrupts).
12437 +                        * We are de-swizzling here because the numbers are actually for
12438 +                        * port of the root complex virtual P2P bridge. But I want
12439 +                        * to avoid putting a node for it in the tree, so the numbers
12440 +                        * below are basically de-swizzled numbers.
12441 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12442 +                        */
12443 +                       interrupt-map-mask = <0000 0 0 7>;
12444 +                       interrupt-map = <
12445 +                               0000 0 0 1 &UIC3 0 4 /* swizzled int A */
12446 +                               0000 0 0 2 &UIC3 1 4 /* swizzled int B */
12447 +                               0000 0 0 3 &UIC3 2 4 /* swizzled int C */
12448 +                               0000 0 0 4 &UIC3 3 4 /* swizzled int D */>;
12449 +               };
12450 +
12451 +               PCIE1: pciex@d20000000 {
12452 +                       device_type = "pci";
12453 +                       #interrupt-cells = <1>;
12454 +                       #size-cells = <2>;
12455 +                       #address-cells = <3>;
12456 +                       compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
12457 +                       primary;
12458 +                       port = <1>; /* port number */
12459 +                       reg = <d 20000000 20000000      /* Config space access */
12460 +                              c 10001000 00001000>;    /* Registers */
12461 +                       dcr-reg = <120 020>;
12462 +                       sdr-base = <340>;
12463 +
12464 +                       /* Outbound ranges, one memory and one IO,
12465 +                        * later cannot be changed
12466 +                        */
12467 +                       ranges = <02000000 0 80000000 0000000e 80000000 0 80000000
12468 +                                 01000000 0 00000000 0000000f 80010000 0 00010000>;
12469 +
12470 +                       /* Inbound 2GB range starting at 0 */
12471 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12472 +
12473 +                       /* This drives busses 10 to 0x1f */
12474 +                       bus-range = <20 2f>;
12475 +
12476 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12477 +                        * to invert PCIe legacy interrupts).
12478 +                        * We are de-swizzling here because the numbers are actually for
12479 +                        * port of the root complex virtual P2P bridge. But I want
12480 +                        * to avoid putting a node for it in the tree, so the numbers
12481 +                        * below are basically de-swizzled numbers.
12482 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12483 +                        */
12484 +                       interrupt-map-mask = <0000 0 0 7>;
12485 +                       interrupt-map = <
12486 +                               0000 0 0 1 &UIC3 4 4 /* swizzled int A */
12487 +                               0000 0 0 2 &UIC3 5 4 /* swizzled int B */
12488 +                               0000 0 0 3 &UIC3 6 4 /* swizzled int C */
12489 +                               0000 0 0 4 &UIC3 7 4 /* swizzled int D */>;
12490 +               };
12491 +
12492 +               PCIE2: pciex@d40000000 {
12493 +                       device_type = "pci";
12494 +                       #interrupt-cells = <1>;
12495 +                       #size-cells = <2>;
12496 +                       #address-cells = <3>;
12497 +                       compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
12498 +                       primary;
12499 +                       port = <2>; /* port number */
12500 +                       reg = <d 40000000 20000000      /* Config space access */
12501 +                              c 10002000 00001000>;    /* Registers */
12502 +                       dcr-reg = <140 020>;
12503 +                       sdr-base = <370>;
12504 +
12505 +                       /* Outbound ranges, one memory and one IO,
12506 +                        * later cannot be changed
12507 +                        */
12508 +                       ranges = <02000000 0 80000000 0000000f 00000000 0 80000000
12509 +                                 01000000 0 00000000 0000000f 80020000 0 00010000>;
12510 +
12511 +                       /* Inbound 2GB range starting at 0 */
12512 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12513 +
12514 +                       /* This drives busses 10 to 0x1f */
12515 +                       bus-range = <30 3f>;
12516 +
12517 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12518 +                        * to invert PCIe legacy interrupts).
12519 +                        * We are de-swizzling here because the numbers are actually for
12520 +                        * port of the root complex virtual P2P bridge. But I want
12521 +                        * to avoid putting a node for it in the tree, so the numbers
12522 +                        * below are basically de-swizzled numbers.
12523 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12524 +                        */
12525 +                       interrupt-map-mask = <0000 0 0 7>;
12526 +                       interrupt-map = <
12527 +                               0000 0 0 1 &UIC3 8 4 /* swizzled int A */
12528 +                               0000 0 0 2 &UIC3 9 4 /* swizzled int B */
12529 +                               0000 0 0 3 &UIC3 a 4 /* swizzled int C */
12530 +                               0000 0 0 4 &UIC3 b 4 /* swizzled int D */>;
12531 +               };
12532 +       };
12533 +
12534 +       chosen {
12535 +               linux,stdout-path = "/plb/opb/serial@10000200";
12536 +       };
12537 +};
12538 Index: linux-2.6.24.7/arch/powerpc/boot/dts/kilauea.dts
12539 ===================================================================
12540 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/kilauea.dts
12541 +++ linux-2.6.24.7/arch/powerpc/boot/dts/kilauea.dts
12542 @@ -13,14 +13,22 @@
12543         #size-cells = <1>;
12544         model = "amcc,kilauea";
12545         compatible = "amcc,kilauea";
12546 -       dcr-parent = <&/cpus/PowerPC,405EX@0>;
12547 +       dcr-parent = <&/cpus/cpu@0>;
12548 +
12549 +       aliases {
12550 +               ethernet0 = &EMAC0;
12551 +               ethernet1 = &EMAC1;
12552 +               serial0 = &UART0;
12553 +               serial1 = &UART1;
12554 +       };
12555  
12556         cpus {
12557                 #address-cells = <1>;
12558                 #size-cells = <0>;
12559  
12560 -               PowerPC,405EX@0 {
12561 +               cpu@0 {
12562                         device_type = "cpu";
12563 +                       model = "PowerPC,405EX";
12564                         reg = <0>;
12565                         clock-frequency = <0>; /* Filled in by U-Boot */
12566                         timebase-frequency = <0>; /* Filled in by U-Boot */
12567 @@ -194,6 +202,7 @@
12568                                 device_type = "rgmii-interface";
12569                                 compatible = "ibm,rgmii-405ex", "ibm,rgmii";
12570                                 reg = <ef600b00 104>;
12571 +                               has-mdio;
12572                         };
12573  
12574                         EMAC0: ethernet@ef600900 {
12575 @@ -220,6 +229,8 @@
12576                                 phy-map = <00000000>;
12577                                 rgmii-device = <&RGMII0>;
12578                                 rgmii-channel = <0>;
12579 +                               has-inverted-stacr-oc;
12580 +                               has-new-stacr-staopc;
12581                         };
12582  
12583                         EMAC1: ethernet@ef600a00 {
12584 @@ -246,7 +257,91 @@
12585                                 phy-map = <00000000>;
12586                                 rgmii-device = <&RGMII0>;
12587                                 rgmii-channel = <1>;
12588 +                               has-inverted-stacr-oc;
12589 +                               has-new-stacr-staopc;
12590                         };
12591                 };
12592 +
12593 +               PCIE0: pciex@0a0000000 {
12594 +                       device_type = "pci";
12595 +                       #interrupt-cells = <1>;
12596 +                       #size-cells = <2>;
12597 +                       #address-cells = <3>;
12598 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
12599 +                       primary;
12600 +                       port = <0>; /* port number */
12601 +                       reg = <a0000000 20000000        /* Config space access */
12602 +                              ef000000 00001000>;      /* Registers */
12603 +                       dcr-reg = <040 020>;
12604 +                       sdr-base = <400>;
12605 +
12606 +                       /* Outbound ranges, one memory and one IO,
12607 +                        * later cannot be changed
12608 +                        */
12609 +                       ranges = <02000000 0 80000000 90000000 0 08000000
12610 +                                 01000000 0 00000000 e0000000 0 00010000>;
12611 +
12612 +                       /* Inbound 2GB range starting at 0 */
12613 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
12614 +
12615 +                       /* This drives busses 0x00 to 0x3f */
12616 +                       bus-range = <00 3f>;
12617 +
12618 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12619 +                        * to invert PCIe legacy interrupts).
12620 +                        * We are de-swizzling here because the numbers are actually for
12621 +                        * port of the root complex virtual P2P bridge. But I want
12622 +                        * to avoid putting a node for it in the tree, so the numbers
12623 +                        * below are basically de-swizzled numbers.
12624 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12625 +                        */
12626 +                       interrupt-map-mask = <0000 0 0 7>;
12627 +                       interrupt-map = <
12628 +                               0000 0 0 1 &UIC2 0 4 /* swizzled int A */
12629 +                               0000 0 0 2 &UIC2 1 4 /* swizzled int B */
12630 +                               0000 0 0 3 &UIC2 2 4 /* swizzled int C */
12631 +                               0000 0 0 4 &UIC2 3 4 /* swizzled int D */>;
12632 +               };
12633 +
12634 +               PCIE1: pciex@0c0000000 {
12635 +                       device_type = "pci";
12636 +                       #interrupt-cells = <1>;
12637 +                       #size-cells = <2>;
12638 +                       #address-cells = <3>;
12639 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
12640 +                       primary;
12641 +                       port = <1>; /* port number */
12642 +                       reg = <c0000000 20000000        /* Config space access */
12643 +                              ef001000 00001000>;      /* Registers */
12644 +                       dcr-reg = <060 020>;
12645 +                       sdr-base = <440>;
12646 +
12647 +                       /* Outbound ranges, one memory and one IO,
12648 +                        * later cannot be changed
12649 +                        */
12650 +                       ranges = <02000000 0 80000000 98000000 0 08000000
12651 +                                 01000000 0 00000000 e0010000 0 00010000>;
12652 +
12653 +                       /* Inbound 2GB range starting at 0 */
12654 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
12655 +
12656 +                       /* This drives busses 0x40 to 0x7f */
12657 +                       bus-range = <40 7f>;
12658 +
12659 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12660 +                        * to invert PCIe legacy interrupts).
12661 +                        * We are de-swizzling here because the numbers are actually for
12662 +                        * port of the root complex virtual P2P bridge. But I want
12663 +                        * to avoid putting a node for it in the tree, so the numbers
12664 +                        * below are basically de-swizzled numbers.
12665 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12666 +                        */
12667 +                       interrupt-map-mask = <0000 0 0 7>;
12668 +                       interrupt-map = <
12669 +                               0000 0 0 1 &UIC2 b 4 /* swizzled int A */
12670 +                               0000 0 0 2 &UIC2 c 4 /* swizzled int B */
12671 +                               0000 0 0 3 &UIC2 d 4 /* swizzled int C */
12672 +                               0000 0 0 4 &UIC2 e 4 /* swizzled int D */>;
12673 +               };
12674         };
12675  };
12676 Index: linux-2.6.24.7/arch/powerpc/boot/dts/kuroboxHD.dts
12677 ===================================================================
12678 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/kuroboxHD.dts
12679 +++ linux-2.6.24.7/arch/powerpc/boot/dts/kuroboxHD.dts
12680 @@ -23,6 +23,12 @@ XXXX add flash parts, rtc, ??
12681         #address-cells = <1>;
12682         #size-cells = <1>;
12683  
12684 +       aliases {
12685 +               serial0 = &serial0;
12686 +               serial1 = &serial1;
12687 +               pci0 = &pci0;
12688 +       };
12689 +
12690         cpus {
12691                 #address-cells = <1>;
12692                 #size-cells = <0>;
12693 @@ -60,7 +66,7 @@ XXXX add flash parts, rtc, ??
12694                 i2c@80003000 {
12695                         #address-cells = <1>;
12696                         #size-cells = <0>;
12697 -                       device_type = "i2c";
12698 +                       cell-index = <0>;
12699                         compatible = "fsl-i2c";
12700                         reg = <80003000 1000>;
12701                         interrupts = <5 2>;
12702 @@ -73,7 +79,8 @@ XXXX add flash parts, rtc, ??
12703                         };
12704                 };
12705  
12706 -               serial@80004500 {
12707 +               serial0: serial@80004500 {
12708 +                       cell-index = <0>;
12709                         device_type = "serial";
12710                         compatible = "ns16550";
12711                         reg = <80004500 8>;
12712 @@ -83,7 +90,8 @@ XXXX add flash parts, rtc, ??
12713                         interrupt-parent = <&mpic>;
12714                 };
12715  
12716 -               serial@80004600 {
12717 +               serial1: serial@80004600 {
12718 +                       cell-index = <1>;
12719                         device_type = "serial";
12720                         compatible = "ns16550";
12721                         reg = <80004600 8>;
12722 @@ -102,7 +110,7 @@ XXXX add flash parts, rtc, ??
12723                         reg = <80040000 40000>;
12724                 };
12725  
12726 -               pci@fec00000 {
12727 +               pci0: pci@fec00000 {
12728                         #address-cells = <3>;
12729                         #size-cells = <2>;
12730                         #interrupt-cells = <1>;
12731 Index: linux-2.6.24.7/arch/powerpc/boot/dts/kuroboxHG.dts
12732 ===================================================================
12733 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/kuroboxHG.dts
12734 +++ linux-2.6.24.7/arch/powerpc/boot/dts/kuroboxHG.dts
12735 @@ -23,6 +23,12 @@ XXXX add flash parts, rtc, ??
12736         #address-cells = <1>;
12737         #size-cells = <1>;
12738  
12739 +       aliases {
12740 +               serial0 = &serial0;
12741 +               serial1 = &serial1;
12742 +               pci0 = &pci0;
12743 +       };
12744 +
12745         cpus {
12746                 #address-cells = <1>;
12747                 #size-cells = <0>;
12748 @@ -60,7 +66,7 @@ XXXX add flash parts, rtc, ??
12749                 i2c@80003000 {
12750                         #address-cells = <1>;
12751                         #size-cells = <0>;
12752 -                       device_type = "i2c";
12753 +                       cell-index = <0>;
12754                         compatible = "fsl-i2c";
12755                         reg = <80003000 1000>;
12756                         interrupts = <5 2>;
12757 @@ -73,7 +79,8 @@ XXXX add flash parts, rtc, ??
12758                         };
12759                 };
12760  
12761 -               serial@80004500 {
12762 +               serial0: serial@80004500 {
12763 +                       cell-index = <0>;
12764                         device_type = "serial";
12765                         compatible = "ns16550";
12766                         reg = <80004500 8>;
12767 @@ -83,7 +90,8 @@ XXXX add flash parts, rtc, ??
12768                         interrupt-parent = <&mpic>;
12769                 };
12770  
12771 -               serial@80004600 {
12772 +               serial1: serial@80004600 {
12773 +                       cell-index = <1>;
12774                         device_type = "serial";
12775                         compatible = "ns16550";
12776                         reg = <80004600 8>;
12777 @@ -102,7 +110,7 @@ XXXX add flash parts, rtc, ??
12778                         reg = <80040000 40000>;
12779                 };
12780  
12781 -               pci@fec00000 {
12782 +               pci0: pci@fec00000 {
12783                         #address-cells = <3>;
12784                         #size-cells = <2>;
12785                         #interrupt-cells = <1>;
12786 Index: linux-2.6.24.7/arch/powerpc/boot/dts/lite5200.dts
12787 ===================================================================
12788 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/lite5200.dts
12789 +++ linux-2.6.24.7/arch/powerpc/boot/dts/lite5200.dts
12790 @@ -19,7 +19,7 @@
12791  / {
12792         model = "fsl,lite5200";
12793         // revision = "1.0";
12794 -       compatible = "fsl,lite5200","generic-mpc5200";
12795 +       compatible = "fsl,lite5200";
12796         #address-cells = <1>;
12797         #size-cells = <1>;
12798  
12799 @@ -284,7 +284,8 @@
12800                 };
12801  
12802                 i2c@3d00 {
12803 -                       device_type = "i2c";
12804 +                       #address-cells = <1>;
12805 +                       #size-cells = <0>;
12806                         compatible = "mpc5200-i2c","fsl-i2c";
12807                         cell-index = <0>;
12808                         reg = <3d00 40>;
12809 @@ -294,7 +295,8 @@
12810                 };
12811  
12812                 i2c@3d40 {
12813 -                       device_type = "i2c";
12814 +                       #address-cells = <1>;
12815 +                       #size-cells = <0>;
12816                         compatible = "mpc5200-i2c","fsl-i2c";
12817                         cell-index = <1>;
12818                         reg = <3d40 40>;
12819 Index: linux-2.6.24.7/arch/powerpc/boot/dts/lite5200b.dts
12820 ===================================================================
12821 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/lite5200b.dts
12822 +++ linux-2.6.24.7/arch/powerpc/boot/dts/lite5200b.dts
12823 @@ -19,7 +19,7 @@
12824  / {
12825         model = "fsl,lite5200b";
12826         // revision = "1.0";
12827 -       compatible = "fsl,lite5200b","generic-mpc5200";
12828 +       compatible = "fsl,lite5200b";
12829         #address-cells = <1>;
12830         #size-cells = <1>;
12831  
12832 @@ -300,7 +300,8 @@
12833                 };
12834  
12835                 i2c@3d00 {
12836 -                       device_type = "i2c";
12837 +                       #address-cells = <1>;
12838 +                       #size-cells = <0>;
12839                         compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
12840                         cell-index = <0>;
12841                         reg = <3d00 40>;
12842 @@ -310,7 +311,8 @@
12843                 };
12844  
12845                 i2c@3d40 {
12846 -                       device_type = "i2c";
12847 +                       #address-cells = <1>;
12848 +                       #size-cells = <0>;
12849                         compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
12850                         cell-index = <1>;
12851                         reg = <3d40 40>;
12852 Index: linux-2.6.24.7/arch/powerpc/boot/dts/makalu.dts
12853 ===================================================================
12854 --- /dev/null
12855 +++ linux-2.6.24.7/arch/powerpc/boot/dts/makalu.dts
12856 @@ -0,0 +1,347 @@
12857 +/*
12858 + * Device Tree Source for AMCC Makalu (405EX)
12859 + *
12860 + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
12861 + *
12862 + * This file is licensed under the terms of the GNU General Public
12863 + * License version 2.  This program is licensed "as is" without
12864 + * any warranty of any kind, whether express or implied.
12865 + */
12866 +
12867 +/ {
12868 +       #address-cells = <1>;
12869 +       #size-cells = <1>;
12870 +       model = "amcc,makalu";
12871 +       compatible = "amcc,makalu";
12872 +       dcr-parent = <&/cpus/cpu@0>;
12873 +
12874 +       aliases {
12875 +               ethernet0 = &EMAC0;
12876 +               ethernet1 = &EMAC1;
12877 +               serial0 = &UART0;
12878 +               serial1 = &UART1;
12879 +       };
12880 +
12881 +       cpus {
12882 +               #address-cells = <1>;
12883 +               #size-cells = <0>;
12884 +
12885 +               cpu@0 {
12886 +                       device_type = "cpu";
12887 +                       model = "PowerPC,405EX";
12888 +                       reg = <0>;
12889 +                       clock-frequency = <0>; /* Filled in by U-Boot */
12890 +                       timebase-frequency = <0>; /* Filled in by U-Boot */
12891 +                       i-cache-line-size = <20>;
12892 +                       d-cache-line-size = <20>;
12893 +                       i-cache-size = <4000>; /* 16 kB */
12894 +                       d-cache-size = <4000>; /* 16 kB */
12895 +                       dcr-controller;
12896 +                       dcr-access-method = "native";
12897 +               };
12898 +       };
12899 +
12900 +       memory {
12901 +               device_type = "memory";
12902 +               reg = <0 0>; /* Filled in by U-Boot */
12903 +       };
12904 +
12905 +       UIC0: interrupt-controller {
12906 +               compatible = "ibm,uic-405ex", "ibm,uic";
12907 +               interrupt-controller;
12908 +               cell-index = <0>;
12909 +               dcr-reg = <0c0 009>;
12910 +               #address-cells = <0>;
12911 +               #size-cells = <0>;
12912 +               #interrupt-cells = <2>;
12913 +       };
12914 +
12915 +       UIC1: interrupt-controller1 {
12916 +               compatible = "ibm,uic-405ex","ibm,uic";
12917 +               interrupt-controller;
12918 +               cell-index = <1>;
12919 +               dcr-reg = <0d0 009>;
12920 +               #address-cells = <0>;
12921 +               #size-cells = <0>;
12922 +               #interrupt-cells = <2>;
12923 +               interrupts = <1e 4 1f 4>; /* cascade */
12924 +               interrupt-parent = <&UIC0>;
12925 +       };
12926 +
12927 +       UIC2: interrupt-controller2 {
12928 +               compatible = "ibm,uic-405ex","ibm,uic";
12929 +               interrupt-controller;
12930 +               cell-index = <2>;
12931 +               dcr-reg = <0e0 009>;
12932 +               #address-cells = <0>;
12933 +               #size-cells = <0>;
12934 +               #interrupt-cells = <2>;
12935 +               interrupts = <1c 4 1d 4>; /* cascade */
12936 +               interrupt-parent = <&UIC0>;
12937 +       };
12938 +
12939 +       plb {
12940 +               compatible = "ibm,plb-405ex", "ibm,plb4";
12941 +               #address-cells = <1>;
12942 +               #size-cells = <1>;
12943 +               ranges;
12944 +               clock-frequency = <0>; /* Filled in by U-Boot */
12945 +
12946 +               SDRAM0: memory-controller {
12947 +                       compatible = "ibm,sdram-405ex";
12948 +                       dcr-reg = <010 2>;
12949 +               };
12950 +
12951 +               MAL0: mcmal {
12952 +                       compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
12953 +                       dcr-reg = <180 62>;
12954 +                       num-tx-chans = <2>;
12955 +                       num-rx-chans = <2>;
12956 +                       interrupt-parent = <&MAL0>;
12957 +                       interrupts = <0 1 2 3 4>;
12958 +                       #interrupt-cells = <1>;
12959 +                       #address-cells = <0>;
12960 +                       #size-cells = <0>;
12961 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
12962 +                                       /*RXEOB*/ 1 &UIC0 b 4
12963 +                                       /*SERR*/  2 &UIC1 0 4
12964 +                                       /*TXDE*/  3 &UIC1 1 4
12965 +                                       /*RXDE*/  4 &UIC1 2 4>;
12966 +                       interrupt-map-mask = <ffffffff>;
12967 +               };
12968 +
12969 +               POB0: opb {
12970 +                       compatible = "ibm,opb-405ex", "ibm,opb";
12971 +                       #address-cells = <1>;
12972 +                       #size-cells = <1>;
12973 +                       ranges = <80000000 80000000 10000000
12974 +                                 ef600000 ef600000 a00000
12975 +                                 f0000000 f0000000 10000000>;
12976 +                       dcr-reg = <0a0 5>;
12977 +                       clock-frequency = <0>; /* Filled in by U-Boot */
12978 +
12979 +                       EBC0: ebc {
12980 +                               compatible = "ibm,ebc-405ex", "ibm,ebc";
12981 +                               dcr-reg = <012 2>;
12982 +                               #address-cells = <2>;
12983 +                               #size-cells = <1>;
12984 +                               clock-frequency = <0>; /* Filled in by U-Boot */
12985 +                               /* ranges property is supplied by U-Boot */
12986 +                               interrupts = <5 1>;
12987 +                               interrupt-parent = <&UIC1>;
12988 +
12989 +                               nor_flash@0,0 {
12990 +                                       compatible = "amd,s29gl512n", "cfi-flash";
12991 +                                       bank-width = <2>;
12992 +                                       reg = <0 000000 4000000>;
12993 +                                       #address-cells = <1>;
12994 +                                       #size-cells = <1>;
12995 +                                       partition@0 {
12996 +                                               label = "kernel";
12997 +                                               reg = <0 200000>;
12998 +                                       };
12999 +                                       partition@200000 {
13000 +                                               label = "root";
13001 +                                               reg = <200000 200000>;
13002 +                                       };
13003 +                                       partition@400000 {
13004 +                                               label = "user";
13005 +                                               reg = <400000 3b60000>;
13006 +                                       };
13007 +                                       partition@3f60000 {
13008 +                                               label = "env";
13009 +                                               reg = <3f60000 40000>;
13010 +                                       };
13011 +                                       partition@3fa0000 {
13012 +                                               label = "u-boot";
13013 +                                               reg = <3fa0000 60000>;
13014 +                                       };
13015 +                               };
13016 +                       };
13017 +
13018 +                       UART0: serial@ef600200 {
13019 +                               device_type = "serial";
13020 +                               compatible = "ns16550";
13021 +                               reg = <ef600200 8>;
13022 +                               virtual-reg = <ef600200>;
13023 +                               clock-frequency = <0>; /* Filled in by U-Boot */
13024 +                               current-speed = <0>;
13025 +                               interrupt-parent = <&UIC0>;
13026 +                               interrupts = <1a 4>;
13027 +                       };
13028 +
13029 +                       UART1: serial@ef600300 {
13030 +                               device_type = "serial";
13031 +                               compatible = "ns16550";
13032 +                               reg = <ef600300 8>;
13033 +                               virtual-reg = <ef600300>;
13034 +                               clock-frequency = <0>; /* Filled in by U-Boot */
13035 +                               current-speed = <0>;
13036 +                               interrupt-parent = <&UIC0>;
13037 +                               interrupts = <1 4>;
13038 +                       };
13039 +
13040 +                       IIC0: i2c@ef600400 {
13041 +                               device_type = "i2c";
13042 +                               compatible = "ibm,iic-405ex", "ibm,iic";
13043 +                               reg = <ef600400 14>;
13044 +                               interrupt-parent = <&UIC0>;
13045 +                               interrupts = <2 4>;
13046 +                       };
13047 +
13048 +                       IIC1: i2c@ef600500 {
13049 +                               device_type = "i2c";
13050 +                               compatible = "ibm,iic-405ex", "ibm,iic";
13051 +                               reg = <ef600500 14>;
13052 +                               interrupt-parent = <&UIC0>;
13053 +                               interrupts = <7 4>;
13054 +                       };
13055 +
13056 +
13057 +                       RGMII0: emac-rgmii@ef600b00 {
13058 +                               device_type = "rgmii-interface";
13059 +                               compatible = "ibm,rgmii-405ex", "ibm,rgmii";
13060 +                               reg = <ef600b00 104>;
13061 +                               has-mdio;
13062 +                       };
13063 +
13064 +                       EMAC0: ethernet@ef600900 {
13065 +                               linux,network-index = <0>;
13066 +                               device_type = "network";
13067 +                               compatible = "ibm,emac-405ex", "ibm,emac4";
13068 +                               interrupt-parent = <&EMAC0>;
13069 +                               interrupts = <0 1>;
13070 +                               #interrupt-cells = <1>;
13071 +                               #address-cells = <0>;
13072 +                               #size-cells = <0>;
13073 +                               interrupt-map = </*Status*/ 0 &UIC0 18 4
13074 +                                               /*Wake*/  1 &UIC1 1d 4>;
13075 +                               reg = <ef600900 70>;
13076 +                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
13077 +                               mal-device = <&MAL0>;
13078 +                               mal-tx-channel = <0>;
13079 +                               mal-rx-channel = <0>;
13080 +                               cell-index = <0>;
13081 +                               max-frame-size = <5dc>;
13082 +                               rx-fifo-size = <1000>;
13083 +                               tx-fifo-size = <800>;
13084 +                               phy-mode = "rgmii";
13085 +                               phy-map = <0000003f>;   /* Start at 6 */
13086 +                               rgmii-device = <&RGMII0>;
13087 +                               rgmii-channel = <0>;
13088 +                               has-inverted-stacr-oc;
13089 +                               has-new-stacr-staopc;
13090 +                       };
13091 +
13092 +                       EMAC1: ethernet@ef600a00 {
13093 +                               linux,network-index = <1>;
13094 +                               device_type = "network";
13095 +                               compatible = "ibm,emac-405ex", "ibm,emac4";
13096 +                               interrupt-parent = <&EMAC1>;
13097 +                               interrupts = <0 1>;
13098 +                               #interrupt-cells = <1>;
13099 +                               #address-cells = <0>;
13100 +                               #size-cells = <0>;
13101 +                               interrupt-map = </*Status*/ 0 &UIC0 19 4
13102 +                                               /*Wake*/  1 &UIC1 1f 4>;
13103 +                               reg = <ef600a00 70>;
13104 +                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
13105 +                               mal-device = <&MAL0>;
13106 +                               mal-tx-channel = <1>;
13107 +                               mal-rx-channel = <1>;
13108 +                               cell-index = <1>;
13109 +                               max-frame-size = <5dc>;
13110 +                               rx-fifo-size = <1000>;
13111 +                               tx-fifo-size = <800>;
13112 +                               phy-mode = "rgmii";
13113 +                               phy-map = <00000000>;
13114 +                               rgmii-device = <&RGMII0>;
13115 +                               rgmii-channel = <1>;
13116 +                               has-inverted-stacr-oc;
13117 +                               has-new-stacr-staopc;
13118 +                       };
13119 +               };
13120 +
13121 +               PCIE0: pciex@0a0000000 {
13122 +                       device_type = "pci";
13123 +                       #interrupt-cells = <1>;
13124 +                       #size-cells = <2>;
13125 +                       #address-cells = <3>;
13126 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
13127 +                       primary;
13128 +                       port = <0>; /* port number */
13129 +                       reg = <a0000000 20000000        /* Config space access */
13130 +                              ef000000 00001000>;      /* Registers */
13131 +                       dcr-reg = <040 020>;
13132 +                       sdr-base = <400>;
13133 +
13134 +                       /* Outbound ranges, one memory and one IO,
13135 +                        * later cannot be changed
13136 +                        */
13137 +                       ranges = <02000000 0 80000000 90000000 0 08000000
13138 +                                 01000000 0 00000000 e0000000 0 00010000>;
13139 +
13140 +                       /* Inbound 2GB range starting at 0 */
13141 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
13142 +
13143 +                       /* This drives busses 0x00 to 0x3f */
13144 +                       bus-range = <00 3f>;
13145 +
13146 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
13147 +                        * to invert PCIe legacy interrupts).
13148 +                        * We are de-swizzling here because the numbers are actually for
13149 +                        * port of the root complex virtual P2P bridge. But I want
13150 +                        * to avoid putting a node for it in the tree, so the numbers
13151 +                        * below are basically de-swizzled numbers.
13152 +                        * The real slot is on idsel 0, so the swizzling is 1:1
13153 +                        */
13154 +                       interrupt-map-mask = <0000 0 0 7>;
13155 +                       interrupt-map = <
13156 +                               0000 0 0 1 &UIC2 0 4 /* swizzled int A */
13157 +                               0000 0 0 2 &UIC2 1 4 /* swizzled int B */
13158 +                               0000 0 0 3 &UIC2 2 4 /* swizzled int C */
13159 +                               0000 0 0 4 &UIC2 3 4 /* swizzled int D */>;
13160 +               };
13161 +
13162 +               PCIE1: pciex@0c0000000 {
13163 +                       device_type = "pci";
13164 +                       #interrupt-cells = <1>;
13165 +                       #size-cells = <2>;
13166 +                       #address-cells = <3>;
13167 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
13168 +                       primary;
13169 +                       port = <1>; /* port number */
13170 +                       reg = <c0000000 20000000        /* Config space access */
13171 +                              ef001000 00001000>;      /* Registers */
13172 +                       dcr-reg = <060 020>;
13173 +                       sdr-base = <440>;
13174 +
13175 +                       /* Outbound ranges, one memory and one IO,
13176 +                        * later cannot be changed
13177 +                        */
13178 +                       ranges = <02000000 0 80000000 98000000 0 08000000
13179 +                                 01000000 0 00000000 e0010000 0 00010000>;
13180 +
13181 +                       /* Inbound 2GB range starting at 0 */
13182 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
13183 +
13184 +                       /* This drives busses 0x40 to 0x7f */
13185 +                       bus-range = <40 7f>;
13186 +
13187 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
13188 +                        * to invert PCIe legacy interrupts).
13189 +                        * We are de-swizzling here because the numbers are actually for
13190 +                        * port of the root complex virtual P2P bridge. But I want
13191 +                        * to avoid putting a node for it in the tree, so the numbers
13192 +                        * below are basically de-swizzled numbers.
13193 +                        * The real slot is on idsel 0, so the swizzling is 1:1
13194 +                        */
13195 +                       interrupt-map-mask = <0000 0 0 7>;
13196 +                       interrupt-map = <
13197 +                               0000 0 0 1 &UIC2 b 4 /* swizzled int A */
13198 +                               0000 0 0 2 &UIC2 c 4 /* swizzled int B */
13199 +                               0000 0 0 3 &UIC2 d 4 /* swizzled int C */
13200 +                               0000 0 0 4 &UIC2 e 4 /* swizzled int D */>;
13201 +               };
13202 +       };
13203 +};
13204 Index: linux-2.6.24.7/arch/powerpc/boot/dts/motionpro.dts
13205 ===================================================================
13206 --- /dev/null
13207 +++ linux-2.6.24.7/arch/powerpc/boot/dts/motionpro.dts
13208 @@ -0,0 +1,309 @@
13209 +/*
13210 + * Motion-PRO board Device Tree Source
13211 + *
13212 + * Copyright (C) 2007 Semihalf
13213 + * Marian Balakowicz <m8@semihalf.com>
13214 + *
13215 + * This program is free software; you can redistribute  it and/or modify it
13216 + * under  the terms of  the GNU General  Public License as published by the
13217 + * Free Software Foundation;  either version 2 of the  License, or (at your
13218 + * option) any later version.
13219 + */
13220 +
13221 +/*
13222 + * WARNING: Do not depend on this tree layout remaining static just yet.
13223 + * The MPC5200 device tree conventions are still in flux
13224 + * Keep an eye on the linuxppc-dev mailing list for more details
13225 + */
13226 +
13227 +/ {
13228 +       model = "promess,motionpro";
13229 +       compatible = "promess,motionpro";
13230 +       #address-cells = <1>;
13231 +       #size-cells = <1>;
13232 +
13233 +       cpus {
13234 +               #address-cells = <1>;
13235 +               #size-cells = <0>;
13236 +
13237 +               PowerPC,5200@0 {
13238 +                       device_type = "cpu";
13239 +                       reg = <0>;
13240 +                       d-cache-line-size = <20>;
13241 +                       i-cache-line-size = <20>;
13242 +                       d-cache-size = <4000>;          // L1, 16K
13243 +                       i-cache-size = <4000>;          // L1, 16K
13244 +                       timebase-frequency = <0>;       // from bootloader
13245 +                       bus-frequency = <0>;            // from bootloader
13246 +                       clock-frequency = <0>;          // from bootloader
13247 +               };
13248 +       };
13249 +
13250 +       memory {
13251 +               device_type = "memory";
13252 +               reg = <00000000 04000000>;      // 64MB
13253 +       };
13254 +
13255 +       soc5200@f0000000 {
13256 +               model = "fsl,mpc5200b";
13257 +               compatible = "fsl,mpc5200b";
13258 +               revision = "";                  // from bootloader
13259 +               device_type = "soc";
13260 +               ranges = <0 f0000000 0000c000>;
13261 +               reg = <f0000000 00000100>;
13262 +               bus-frequency = <0>;            // from bootloader
13263 +               system-frequency = <0>;         // from bootloader
13264 +
13265 +               cdm@200 {
13266 +                       compatible = "mpc5200b-cdm","mpc5200-cdm";
13267 +                       reg = <200 38>;
13268 +               };
13269 +
13270 +               mpc5200_pic: pic@500 {
13271 +                       // 5200 interrupts are encoded into two levels;
13272 +                       interrupt-controller;
13273 +                       #interrupt-cells = <3>;
13274 +                       compatible = "mpc5200b-pic","mpc5200-pic";
13275 +                       reg = <500 80>;
13276 +               };
13277 +
13278 +               gpt@600 {       // General Purpose Timer
13279 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13280 +                       reg = <600 10>;
13281 +                       interrupts = <1 9 0>;
13282 +                       interrupt-parent = <&mpc5200_pic>;
13283 +                       fsl,has-wdt;
13284 +               };
13285 +
13286 +               gpt@610 {       // General Purpose Timer
13287 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13288 +                       reg = <610 10>;
13289 +                       interrupts = <1 a 0>;
13290 +                       interrupt-parent = <&mpc5200_pic>;
13291 +               };
13292 +
13293 +               gpt@620 {       // General Purpose Timer
13294 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13295 +                       reg = <620 10>;
13296 +                       interrupts = <1 b 0>;
13297 +                       interrupt-parent = <&mpc5200_pic>;
13298 +               };
13299 +
13300 +               gpt@630 {       // General Purpose Timer
13301 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13302 +                       reg = <630 10>;
13303 +                       interrupts = <1 c 0>;
13304 +                       interrupt-parent = <&mpc5200_pic>;
13305 +               };
13306 +
13307 +               gpt@640 {       // General Purpose Timer
13308 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13309 +                       reg = <640 10>;
13310 +                       interrupts = <1 d 0>;
13311 +                       interrupt-parent = <&mpc5200_pic>;
13312 +               };
13313 +
13314 +               gpt@650 {       // General Purpose Timer
13315 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13316 +                       reg = <650 10>;
13317 +                       interrupts = <1 e 0>;
13318 +                       interrupt-parent = <&mpc5200_pic>;
13319 +               };
13320 +
13321 +               motionpro-led@660 {     // Motion-PRO status LED
13322 +                       compatible = "promess,motionpro-led";
13323 +                       label = "motionpro-statusled";
13324 +                       reg = <660 10>;
13325 +                       interrupts = <1 f 0>;
13326 +                       interrupt-parent = <&mpc5200_pic>;
13327 +                       blink-delay = <64>; // 100 msec
13328 +               };
13329 +
13330 +               motionpro-led@670 {     // Motion-PRO ready LED
13331 +                       compatible = "promess,motionpro-led";
13332 +                       label = "motionpro-readyled";
13333 +                       reg = <670 10>;
13334 +                       interrupts = <1 10 0>;
13335 +                       interrupt-parent = <&mpc5200_pic>;
13336 +               };
13337 +
13338 +               rtc@800 {       // Real time clock
13339 +                       compatible = "mpc5200b-rtc","mpc5200-rtc";
13340 +                       reg = <800 100>;
13341 +                       interrupts = <1 5 0 1 6 0>;
13342 +                       interrupt-parent = <&mpc5200_pic>;
13343 +               };
13344 +
13345 +               mscan@980 {
13346 +                       compatible = "mpc5200b-mscan","mpc5200-mscan";
13347 +                       interrupts = <2 12 0>;
13348 +                       interrupt-parent = <&mpc5200_pic>;
13349 +                       reg = <980 80>;
13350 +               };
13351 +
13352 +               gpio@b00 {
13353 +                       compatible = "mpc5200b-gpio","mpc5200-gpio";
13354 +                       reg = <b00 40>;
13355 +                       interrupts = <1 7 0>;
13356 +                       interrupt-parent = <&mpc5200_pic>;
13357 +               };
13358 +
13359 +               gpio-wkup@c00 {
13360 +                       compatible = "mpc5200b-gpio-wkup","mpc5200-gpio-wkup";
13361 +                       reg = <c00 40>;
13362 +                       interrupts = <1 8 0 0 3 0>;
13363 +                       interrupt-parent = <&mpc5200_pic>;
13364 +               };
13365 +
13366 +
13367 +               spi@f00 {
13368 +                       compatible = "mpc5200b-spi","mpc5200-spi";
13369 +                       reg = <f00 20>;
13370 +                       interrupts = <2 d 0 2 e 0>;
13371 +                       interrupt-parent = <&mpc5200_pic>;
13372 +               };
13373 +
13374 +               usb@1000 {
13375 +                       compatible = "mpc5200b-ohci","mpc5200-ohci","ohci-be";
13376 +                       reg = <1000 ff>;
13377 +                       interrupts = <2 6 0>;
13378 +                       interrupt-parent = <&mpc5200_pic>;
13379 +               };
13380 +
13381 +               dma-controller@1200 {
13382 +                       compatible = "mpc5200b-bestcomm","mpc5200-bestcomm";
13383 +                       reg = <1200 80>;
13384 +                       interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
13385 +                                     3 4 0  3 5 0  3 6 0  3 7 0
13386 +                                     3 8 0  3 9 0  3 a 0  3 b 0
13387 +                                     3 c 0  3 d 0  3 e 0  3 f 0>;
13388 +                       interrupt-parent = <&mpc5200_pic>;
13389 +               };
13390 +
13391 +               xlb@1f00 {
13392 +                       compatible = "mpc5200b-xlb","mpc5200-xlb";
13393 +                       reg = <1f00 100>;
13394 +               };
13395 +
13396 +               serial@2000 {           // PSC1
13397 +                       device_type = "serial";
13398 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
13399 +                       port-number = <0>;  // Logical port assignment
13400 +                       reg = <2000 100>;
13401 +                       interrupts = <2 1 0>;
13402 +                       interrupt-parent = <&mpc5200_pic>;
13403 +               };
13404 +
13405 +               // PSC2 in spi master mode 
13406 +               spi@2200 {              // PSC2
13407 +                       compatible = "mpc5200b-psc-spi","mpc5200-psc-spi";
13408 +                       cell-index = <1>;
13409 +                       reg = <2200 100>;
13410 +                       interrupts = <2 2 0>;
13411 +                       interrupt-parent = <&mpc5200_pic>;
13412 +               };
13413 +
13414 +               // PSC5 in uart mode
13415 +               serial@2800 {           // PSC5
13416 +                       device_type = "serial";
13417 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
13418 +                       port-number = <4>;  // Logical port assignment
13419 +                       reg = <2800 100>;
13420 +                       interrupts = <2 c 0>;
13421 +                       interrupt-parent = <&mpc5200_pic>;
13422 +               };
13423 +
13424 +               ethernet@3000 {
13425 +                       device_type = "network";
13426 +                       compatible = "mpc5200b-fec","mpc5200-fec";
13427 +                       reg = <3000 800>;
13428 +                       local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
13429 +                       interrupts = <2 5 0>;
13430 +                       interrupt-parent = <&mpc5200_pic>;
13431 +               };
13432 +
13433 +               ata@3a00 {
13434 +                       compatible = "mpc5200b-ata","mpc5200-ata";
13435 +                       reg = <3a00 100>;
13436 +                       interrupts = <2 7 0>;
13437 +                       interrupt-parent = <&mpc5200_pic>;
13438 +               };
13439 +
13440 +               i2c@3d40 {
13441 +                       compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
13442 +                       reg = <3d40 40>;
13443 +                       interrupts = <2 10 0>;
13444 +                       interrupt-parent = <&mpc5200_pic>;
13445 +                       fsl5200-clocking;
13446 +               };
13447 +
13448 +               sram@8000 {
13449 +                       compatible = "mpc5200b-sram","mpc5200-sram";
13450 +                       reg = <8000 4000>;
13451 +               };
13452 +       };
13453 +
13454 +       lpb {
13455 +               model = "fsl,lpb";
13456 +               compatible = "fsl,lpb";
13457 +               #address-cells = <2>;
13458 +               #size-cells = <1>;
13459 +               ranges = <1 0 50000000 00010000
13460 +                         2 0 50010000 00010000
13461 +                         3 0 50020000 00010000>;
13462 +
13463 +               // 8-bit DualPort SRAM on LocalPlus Bus CS1
13464 +               kollmorgen@1,0 {
13465 +                       compatible = "promess,motionpro-kollmorgen";
13466 +                       reg = <1 0 10000>;
13467 +                       interrupts = <1 1 0>;
13468 +                       interrupt-parent = <&mpc5200_pic>;
13469 +               };
13470 +
13471 +               // 8-bit board CPLD on LocalPlus Bus CS2
13472 +               cpld@2,0 {
13473 +                       compatible = "promess,motionpro-cpld";
13474 +                       reg = <2 0 10000>;
13475 +               };
13476 +
13477 +               // 8-bit custom Anybus Module on LocalPlus Bus CS3
13478 +               anybus@3,0 {
13479 +                       compatible = "promess,motionpro-anybus";
13480 +                       reg = <3 0 10000>;
13481 +               };
13482 +               pro_module_general@3,0 {
13483 +                       compatible = "promess,pro_module_general";
13484 +                       reg = <3 0 3>;
13485 +               };
13486 +               pro_module_dio@3,800 {
13487 +                       compatible = "promess,pro_module_dio";
13488 +                       reg = <3 800 2>;
13489 +               };
13490 +       };
13491 +
13492 +       pci@f0000d00 {
13493 +               #interrupt-cells = <1>;
13494 +               #size-cells = <2>;
13495 +               #address-cells = <3>;
13496 +               device_type = "pci";
13497 +               compatible = "mpc5200b-pci","mpc5200-pci";
13498 +               reg = <f0000d00 100>;
13499 +               interrupt-map-mask = <f800 0 0 7>;
13500 +               interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot
13501 +                                c000 0 0 2 &mpc5200_pic 1 1 3
13502 +                                c000 0 0 3 &mpc5200_pic 1 2 3
13503 +                                c000 0 0 4 &mpc5200_pic 1 3 3
13504 +
13505 +                                c800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot
13506 +                                c800 0 0 2 &mpc5200_pic 1 2 3
13507 +                                c800 0 0 3 &mpc5200_pic 1 3 3
13508 +                                c800 0 0 4 &mpc5200_pic 0 0 3>;
13509 +               clock-frequency = <0>; // From boot loader
13510 +               interrupts = <2 8 0 2 9 0 2 a 0>;
13511 +               interrupt-parent = <&mpc5200_pic>;
13512 +               bus-range = <0 0>;
13513 +               ranges = <42000000 0 80000000 80000000 0 20000000
13514 +                         02000000 0 a0000000 a0000000 0 10000000
13515 +                         01000000 0 00000000 b0000000 0 01000000>;
13516 +       };
13517 +};
13518 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8313erdb.dts
13519 ===================================================================
13520 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8313erdb.dts
13521 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8313erdb.dts
13522 @@ -15,6 +15,14 @@
13523         #address-cells = <1>;
13524         #size-cells = <1>;
13525  
13526 +       aliases {
13527 +               ethernet0 = &enet0;
13528 +               ethernet1 = &enet1;
13529 +               serial0 = &serial0;
13530 +               serial1 = &serial1;
13531 +               pci0 = &pci0;
13532 +       };
13533 +
13534         cpus {
13535                 #address-cells = <1>;
13536                 #size-cells = <0>;
13537 @@ -37,10 +45,58 @@
13538                 reg = <00000000 08000000>;      // 128MB at 0
13539         };
13540  
13541 +       localbus@e0005000 {
13542 +               #address-cells = <2>;
13543 +               #size-cells = <1>;
13544 +               compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";
13545 +               reg = <e0005000 1000>;
13546 +               interrupts = <d#77 8>;
13547 +               interrupt-parent = <&ipic>;
13548 +
13549 +               // CS0 and CS1 are swapped when
13550 +               // booting from nand, but the
13551 +               // addresses are the same.
13552 +               ranges = <0 0 fe000000 00800000
13553 +                         1 0 e2800000 00008000
13554 +                         2 0 f0000000 00020000
13555 +                         3 0 fa000000 00008000>;
13556 +
13557 +               flash@0,0 {
13558 +                       #address-cells = <1>;
13559 +                       #size-cells = <1>;
13560 +                       compatible = "cfi-flash";
13561 +                       reg = <0 0 800000>;
13562 +                       bank-width = <2>;
13563 +                       device-width = <1>;
13564 +               };
13565 +
13566 +               nand@1,0 {
13567 +                       #address-cells = <1>;
13568 +                       #size-cells = <1>;
13569 +                       compatible = "fsl,mpc8313-fcm-nand",
13570 +                                    "fsl,elbc-fcm-nand";
13571 +                       reg = <1 0 2000>;
13572 +
13573 +                       u-boot@0 {
13574 +                               reg = <0 100000>;
13575 +                               read-only;
13576 +                       };
13577 +
13578 +                       kernel@100000 {
13579 +                               reg = <100000 300000>;
13580 +                       };
13581 +
13582 +                       fs@400000 {
13583 +                               reg = <400000 1c00000>;
13584 +                       };
13585 +               };
13586 +       };
13587 +
13588         soc8313@e0000000 {
13589                 #address-cells = <1>;
13590                 #size-cells = <1>;
13591                 device_type = "soc";
13592 +               compatible = "simple-bus";
13593                 ranges = <0 e0000000 00100000>;
13594                 reg = <e0000000 00000200>;
13595                 bus-frequency = <0>;
13596 @@ -52,7 +108,9 @@
13597                 };
13598  
13599                 i2c@3000 {
13600 -                       device_type = "i2c";
13601 +                       #address-cells = <1>;
13602 +                       #size-cells = <0>;
13603 +                       cell-index = <0>;
13604                         compatible = "fsl-i2c";
13605                         reg = <3000 100>;
13606                         interrupts = <e 8>;
13607 @@ -61,7 +119,9 @@
13608                 };
13609  
13610                 i2c@3100 {
13611 -                       device_type = "i2c";
13612 +                       #address-cells = <1>;
13613 +                       #size-cells = <0>;
13614 +                       cell-index = <1>;
13615                         compatible = "fsl-i2c";
13616                         reg = <3100 100>;
13617                         interrupts = <f 8>;
13618 @@ -80,7 +140,6 @@
13619  
13620                 /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
13621                 usb@23000 {
13622 -                       device_type = "usb";
13623                         compatible = "fsl-usb2-dr";
13624                         reg = <23000 1000>;
13625                         #address-cells = <1>;
13626 @@ -91,11 +150,10 @@
13627                 };
13628  
13629                 mdio@24520 {
13630 -                       device_type = "mdio";
13631 -                       compatible = "gianfar";
13632 -                       reg = <24520 20>;
13633                         #address-cells = <1>;
13634                         #size-cells = <0>;
13635 +                       compatible = "fsl,gianfar-mdio";
13636 +                       reg = <24520 20>;
13637                         phy1: ethernet-phy@1 {
13638                                 interrupt-parent = < &ipic >;
13639                                 interrupts = <13 8>;
13640 @@ -110,7 +168,8 @@
13641                         };
13642                 };
13643  
13644 -               ethernet@24000 {
13645 +               enet0: ethernet@24000 {
13646 +                       cell-index = <0>;
13647                         device_type = "network";
13648                         model = "eTSEC";
13649                         compatible = "gianfar";
13650 @@ -121,7 +180,8 @@
13651                         phy-handle = < &phy1 >;
13652                 };
13653  
13654 -               ethernet@25000 {
13655 +               enet1: ethernet@25000 {
13656 +                       cell-index = <1>;
13657                         device_type = "network";
13658                         model = "eTSEC";
13659                         compatible = "gianfar";
13660 @@ -132,7 +192,8 @@
13661                         phy-handle = < &phy4 >;
13662                 };
13663  
13664 -               serial@4500 {
13665 +               serial0: serial@4500 {
13666 +                       cell-index = <0>;
13667                         device_type = "serial";
13668                         compatible = "ns16550";
13669                         reg = <4500 100>;
13670 @@ -141,7 +202,8 @@
13671                         interrupt-parent = < &ipic >;
13672                 };
13673  
13674 -               serial@4600 {
13675 +               serial1: serial@4600 {
13676 +                       cell-index = <1>;
13677                         device_type = "serial";
13678                         compatible = "ns16550";
13679                         reg = <4600 100>;
13680 @@ -179,7 +241,8 @@
13681                 };
13682         };
13683  
13684 -       pci@e0008500 {
13685 +       pci0: pci@e0008500 {
13686 +               cell-index = <1>;
13687                 interrupt-map-mask = <f800 0 0 7>;
13688                 interrupt-map = <
13689  
13690 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc832x_mds.dts
13691 ===================================================================
13692 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc832x_mds.dts
13693 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc832x_mds.dts
13694 @@ -7,6 +7,18 @@
13695   * under  the terms of  the GNU General  Public License as published by the
13696   * Free Software Foundation;  either version 2 of the  License, or (at your
13697   * option) any later version.
13698 +
13699 + * To enable external serial I/O on a Freescale MPC 8323 SYS/MDS board, do
13700 + * this:
13701 + *
13702 + * 1) On chip U61, lift (disconnect) pins 21 (TXD) and 22 (RXD) from the board.
13703 + * 2) Solder a wire from U61-21 to P19A-23.  P19 is a grid of pins on the board
13704 + *    next to the serial ports.
13705 + * 3) Solder a wire from U61-22 to P19K-22.
13706 + *
13707 + * Note that there's a typo in the schematic.  The board labels the last column
13708 + * of pins "P19K", but in the schematic, that column is called "P19J".  So if
13709 + * you're going by the schematic, the pin is called "P19J-K22".
13710   */
13711  
13712  / {
13713 @@ -15,6 +27,14 @@
13714         #address-cells = <1>;
13715         #size-cells = <1>;
13716  
13717 +       aliases {
13718 +               ethernet0 = &enet0;
13719 +               ethernet1 = &enet1;
13720 +               serial0 = &serial0;
13721 +               serial1 = &serial1;
13722 +               pci0 = &pci0;
13723 +       };
13724 +
13725         cpus {
13726                 #address-cells = <1>;
13727                 #size-cells = <0>;
13728 @@ -59,7 +79,7 @@
13729                 i2c@3000 {
13730                         #address-cells = <1>;
13731                         #size-cells = <0>;
13732 -                       device_type = "i2c";
13733 +                       cell-index = <0>;
13734                         compatible = "fsl-i2c";
13735                         reg = <3000 100>;
13736                         interrupts = <e 8>;
13737 @@ -72,7 +92,8 @@
13738                         };
13739                 };
13740  
13741 -               serial@4500 {
13742 +               serial0: serial@4500 {
13743 +                       cell-index = <0>;
13744                         device_type = "serial";
13745                         compatible = "ns16550";
13746                         reg = <4500 100>;
13747 @@ -81,7 +102,8 @@
13748                         interrupt-parent = < &ipic >;
13749                 };
13750  
13751 -               serial@4600 {
13752 +               serial1: serial@4600 {
13753 +                       cell-index = <1>;
13754                         device_type = "serial";
13755                         compatible = "ns16550";
13756                         reg = <4600 100>;
13757 @@ -159,6 +181,23 @@
13758                                         1 1e  1  0  1  0        /* TX_EN */
13759                                         1 1f  2  0  1  0>;/* CRS */
13760                         };
13761 +                       pio5: ucc_pin@05 {
13762 +                               pio-map = <
13763 +                               /*
13764 +                                *                    open       has
13765 +                                *   port  pin  dir  drain  sel  irq
13766 +                                */
13767 +                                       2    0    1      0    2    0  /* TxD5 */
13768 +                                       2    8    2      0    2    0  /* RxD5 */
13769 +
13770 +                                       2   1d    2      0    0    0  /* CTS5 */
13771 +                                       2   1f    1      0    2    0  /* RTS5 */
13772 +
13773 +                                       2   18    2      0    0    0  /* CD */
13774 +
13775 +                               >;
13776 +                       };
13777 +
13778                 };
13779         };
13780  
13781 @@ -166,6 +205,7 @@
13782                 #address-cells = <1>;
13783                 #size-cells = <1>;
13784                 device_type = "qe";
13785 +               compatible = "fsl,qe";
13786                 model = "QE";
13787                 ranges = <0 e0100000 00100000>;
13788                 reg = <e0100000 480>;
13789 @@ -200,7 +240,6 @@
13790                 };
13791  
13792                 usb@6c0 {
13793 -                       device_type = "usb";
13794                         compatible = "qe_udc";
13795                         reg = <6c0 40 8B00 100>;
13796                         interrupts = <b>;
13797 @@ -208,48 +247,58 @@
13798                         mode = "slave";
13799                 };
13800  
13801 -               ucc@2200 {
13802 +               enet0: ucc@2200 {
13803                         device_type = "network";
13804                         compatible = "ucc_geth";
13805                         model = "UCC";
13806 +                       cell-index = <3>;
13807                         device-id = <3>;
13808                         reg = <2200 200>;
13809                         interrupts = <22>;
13810                         interrupt-parent = < &qeic >;
13811 -                       /*
13812 -                        * mac-address is deprecated and will be removed
13813 -                        * in 2.6.25.  Only recent versions of
13814 -                        * U-Boot support local-mac-address, however.
13815 -                        */
13816 -                       mac-address = [ 00 00 00 00 00 00 ];
13817                         local-mac-address = [ 00 00 00 00 00 00 ];
13818 -                       rx-clock = <19>;
13819 -                       tx-clock = <1a>;
13820 +                       rx-clock-name = "clk9";
13821 +                       tx-clock-name = "clk10";
13822                         phy-handle = < &phy3 >;
13823                         pio-handle = < &pio3 >;
13824                 };
13825  
13826 -               ucc@3200 {
13827 +               enet1: ucc@3200 {
13828                         device_type = "network";
13829                         compatible = "ucc_geth";
13830                         model = "UCC";
13831 +                       cell-index = <4>;
13832                         device-id = <4>;
13833                         reg = <3200 200>;
13834                         interrupts = <23>;
13835                         interrupt-parent = < &qeic >;
13836 -                       /*
13837 -                        * mac-address is deprecated and will be removed
13838 -                        * in 2.6.25.  Only recent versions of
13839 -                        * U-Boot support local-mac-address, however.
13840 -                        */
13841 -                       mac-address = [ 00 00 00 00 00 00 ];
13842                         local-mac-address = [ 00 00 00 00 00 00 ];
13843 -                       rx-clock = <17>;
13844 -                       tx-clock = <18>;
13845 +                       rx-clock-name = "clk7";
13846 +                       tx-clock-name = "clk8";
13847                         phy-handle = < &phy4 >;
13848                         pio-handle = < &pio4 >;
13849                 };
13850  
13851 +               ucc@2400 {
13852 +                       device_type = "serial";
13853 +                       compatible = "ucc_uart";
13854 +                       model = "UCC";
13855 +                       device-id = <5>;        /* The UCC number, 1-7*/
13856 +                       port-number = <0>;      /* Which ttyQEx device */
13857 +                       soft-uart;              /* We need Soft-UART */
13858 +                       reg = <2400 200>;
13859 +                       interrupts = <28>;      /* From Table 18-12 */
13860 +                       interrupt-parent = < &qeic >;
13861 +                       /*
13862 +                        * For Soft-UART, we need to set TX to 1X, which
13863 +                        * means specifying separate clock sources.
13864 +                        */
13865 +                       rx-clock-name = "brg5";
13866 +                       tx-clock-name = "brg6";
13867 +                       pio-handle = < &pio5 >;
13868 +               };
13869 +
13870 +
13871                 mdio@2320 {
13872                         #address-cells = <1>;
13873                         #size-cells = <0>;
13874 @@ -283,7 +332,8 @@
13875                 };
13876         };
13877  
13878 -       pci@e0008500 {
13879 +       pci0: pci@e0008500 {
13880 +               cell-index = <1>;
13881                 interrupt-map-mask = <f800 0 0 7>;
13882                 interrupt-map = <
13883                                 /* IDSEL 0x11 AD17 */
13884 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc832x_rdb.dts
13885 ===================================================================
13886 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc832x_rdb.dts
13887 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc832x_rdb.dts
13888 @@ -15,6 +15,14 @@
13889         #address-cells = <1>;
13890         #size-cells = <1>;
13891  
13892 +       aliases {
13893 +               ethernet0 = &enet0;
13894 +               ethernet1 = &enet1;
13895 +               serial0 = &serial0;
13896 +               serial1 = &serial1;
13897 +               pci0 = &pci0;
13898 +       };
13899 +
13900         cpus {
13901                 #address-cells = <1>;
13902                 #size-cells = <0>;
13903 @@ -52,7 +60,9 @@
13904                 };
13905  
13906                 i2c@3000 {
13907 -                       device_type = "i2c";
13908 +                       #address-cells = <1>;
13909 +                       #size-cells = <0>;
13910 +                       cell-index = <0>;
13911                         compatible = "fsl-i2c";
13912                         reg = <3000 100>;
13913                         interrupts = <e 8>;
13914 @@ -60,7 +70,8 @@
13915                         dfsrr;
13916                 };
13917  
13918 -               serial@4500 {
13919 +               serial0: serial@4500 {
13920 +                       cell-index = <0>;
13921                         device_type = "serial";
13922                         compatible = "ns16550";
13923                         reg = <4500 100>;
13924 @@ -69,7 +80,8 @@
13925                         interrupt-parent = <&pic>;
13926                 };
13927  
13928 -               serial@4600 {
13929 +               serial1: serial@4600 {
13930 +                       cell-index = <1>;
13931                         device_type = "serial";
13932                         compatible = "ns16550";
13933                         reg = <4600 100>;
13934 @@ -187,44 +199,34 @@
13935                         mode = "cpu";
13936                 };
13937  
13938 -               ucc@3000 {
13939 +               enet0: ucc@3000 {
13940                         device_type = "network";
13941                         compatible = "ucc_geth";
13942                         model = "UCC";
13943 +                       cell-index = <2>;
13944                         device-id = <2>;
13945                         reg = <3000 200>;
13946                         interrupts = <21>;
13947                         interrupt-parent = <&qeic>;
13948 -                       /*
13949 -                        * mac-address is deprecated and will be removed
13950 -                        * in 2.6.25.  Only recent versions of
13951 -                        * U-Boot support local-mac-address, however.
13952 -                        */
13953 -                       mac-address = [ 00 00 00 00 00 00 ];
13954                         local-mac-address = [ 00 00 00 00 00 00 ];
13955 -                       rx-clock = <20>;
13956 -                       tx-clock = <13>;
13957 +                       rx-clock-name = "clk16";
13958 +                       tx-clock-name = "clk3";
13959                         phy-handle = <&phy00>;
13960                         pio-handle = <&ucc2pio>;
13961                 };
13962  
13963 -               ucc@2200 {
13964 +               enet1: ucc@2200 {
13965                         device_type = "network";
13966                         compatible = "ucc_geth";
13967                         model = "UCC";
13968 +                       cell-index = <3>;
13969                         device-id = <3>;
13970                         reg = <2200 200>;
13971                         interrupts = <22>;
13972                         interrupt-parent = <&qeic>;
13973 -                       /*
13974 -                        * mac-address is deprecated and will be removed
13975 -                        * in 2.6.25.  Only recent versions of
13976 -                        * U-Boot support local-mac-address, however.
13977 -                        */
13978 -                       mac-address = [ 00 00 00 00 00 00 ];
13979                         local-mac-address = [ 00 00 00 00 00 00 ];
13980 -                       rx-clock = <19>;
13981 -                       tx-clock = <1a>;
13982 +                       rx-clock-name = "clk9";
13983 +                       tx-clock-name = "clk10";
13984                         phy-handle = <&phy04>;
13985                         pio-handle = <&ucc3pio>;
13986                 };
13987 @@ -262,7 +264,8 @@
13988                 };
13989         };
13990  
13991 -       pci@e0008500 {
13992 +       pci0: pci@e0008500 {
13993 +               cell-index = <1>;
13994                 interrupt-map-mask = <f800 0 0 7>;
13995                 interrupt-map = <
13996                                 /* IDSEL 0x10 AD16 (USB) */
13997 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8349emitx.dts
13998 ===================================================================
13999 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8349emitx.dts
14000 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8349emitx.dts
14001 @@ -14,6 +14,15 @@
14002         #address-cells = <1>;
14003         #size-cells = <1>;
14004  
14005 +       aliases {
14006 +               ethernet0 = &enet0;
14007 +               ethernet1 = &enet1;
14008 +               serial0 = &serial0;
14009 +               serial1 = &serial1;
14010 +               pci0 = &pci0;
14011 +               pci1 = &pci1;
14012 +       };
14013 +
14014         cpus {
14015                 #address-cells = <1>;
14016                 #size-cells = <0>;
14017 @@ -51,7 +60,9 @@
14018                 };
14019  
14020                 i2c@3000 {
14021 -                       device_type = "i2c";
14022 +                       #address-cells = <1>;
14023 +                       #size-cells = <0>;
14024 +                       cell-index = <0>;
14025                         compatible = "fsl-i2c";
14026                         reg = <3000 100>;
14027                         interrupts = <e 8>;
14028 @@ -60,7 +71,9 @@
14029                 };
14030  
14031                 i2c@3100 {
14032 -                       device_type = "i2c";
14033 +                       #address-cells = <1>;
14034 +                       #size-cells = <0>;
14035 +                       cell-index = <1>;
14036                         compatible = "fsl-i2c";
14037                         reg = <3100 100>;
14038                         interrupts = <f 8>;
14039 @@ -78,7 +91,6 @@
14040                 };
14041  
14042                 usb@22000 {
14043 -                       device_type = "usb";
14044                         compatible = "fsl-usb2-mph";
14045                         reg = <22000 1000>;
14046                         #address-cells = <1>;
14047 @@ -90,7 +102,6 @@
14048                 };
14049  
14050                 usb@23000 {
14051 -                       device_type = "usb";
14052                         compatible = "fsl-usb2-dr";
14053                         reg = <23000 1000>;
14054                         #address-cells = <1>;
14055 @@ -102,11 +113,10 @@
14056                 };
14057  
14058                 mdio@24520 {
14059 -                       device_type = "mdio";
14060 -                       compatible = "gianfar";
14061 -                       reg = <24520 20>;
14062                         #address-cells = <1>;
14063                         #size-cells = <0>;
14064 +                       compatible = "fsl,gianfar-mdio";
14065 +                       reg = <24520 20>;
14066  
14067                         /* Vitesse 8201 */
14068                         phy1c: ethernet-phy@1c {
14069 @@ -115,27 +125,14 @@
14070                                 reg = <1c>;
14071                                 device_type = "ethernet-phy";
14072                         };
14073 -
14074 -                       /* Vitesse 7385 */
14075 -                       phy1f: ethernet-phy@1f {
14076 -                               interrupt-parent = < &ipic >;
14077 -                               interrupts = <12 8>;
14078 -                               reg = <1f>;
14079 -                               device_type = "ethernet-phy";
14080 -                       };
14081                 };
14082  
14083 -               ethernet@24000 {
14084 +               enet0: ethernet@24000 {
14085 +                       cell-index = <0>;
14086                         device_type = "network";
14087                         model = "TSEC";
14088                         compatible = "gianfar";
14089                         reg = <24000 1000>;
14090 -                       /*
14091 -                        * address is deprecated and will be removed
14092 -                        * in 2.6.25.  Only recent versions of
14093 -                        * U-Boot support local-mac-address, however.
14094 -                        */
14095 -                       address = [ 00 00 00 00 00 00 ];
14096                         local-mac-address = [ 00 00 00 00 00 00 ];
14097                         interrupts = <20 8 21 8 22 8>;
14098                         interrupt-parent = < &ipic >;
14099 @@ -143,27 +140,22 @@
14100                         linux,network-index = <0>;
14101                 };
14102  
14103 -               ethernet@25000 {
14104 -                       #address-cells = <1>;
14105 -                       #size-cells = <0>;
14106 +               enet1: ethernet@25000 {
14107 +                       cell-index = <1>;
14108                         device_type = "network";
14109                         model = "TSEC";
14110                         compatible = "gianfar";
14111                         reg = <25000 1000>;
14112 -                       /*
14113 -                        * address is deprecated and will be removed
14114 -                        * in 2.6.25.  Only recent versions of
14115 -                        * U-Boot support local-mac-address, however.
14116 -                        */
14117 -                       address = [ 00 00 00 00 00 00 ];
14118                         local-mac-address = [ 00 00 00 00 00 00 ];
14119                         interrupts = <23 8 24 8 25 8>;
14120                         interrupt-parent = < &ipic >;
14121 -                       phy-handle = < &phy1f >;
14122 +                       /* Vitesse 7385 isn't on the MDIO bus */
14123 +                       fixed-link = <1 1 d#1000 0 0>;
14124                         linux,network-index = <1>;
14125                 };
14126  
14127 -               serial@4500 {
14128 +               serial0: serial@4500 {
14129 +                       cell-index = <0>;
14130                         device_type = "serial";
14131                         compatible = "ns16550";
14132                         reg = <4500 100>;
14133 @@ -172,7 +164,8 @@
14134                         interrupt-parent = < &ipic >;
14135                 };
14136  
14137 -               serial@4600 {
14138 +               serial1: serial@4600 {
14139 +                       cell-index = <1>;
14140                         device_type = "serial";
14141                         compatible = "ns16550";
14142                         reg = <4600 100>;
14143 @@ -203,7 +196,8 @@
14144                 };
14145         };
14146  
14147 -       pci@e0008500 {
14148 +       pci0: pci@e0008500 {
14149 +               cell-index = <1>;
14150                 interrupt-map-mask = <f800 0 0 7>;
14151                 interrupt-map = <
14152                                 /* IDSEL 0x10 - SATA */
14153 @@ -224,7 +218,8 @@
14154                 device_type = "pci";
14155         };
14156  
14157 -       pci@e0008600 {
14158 +       pci1: pci@e0008600 {
14159 +               cell-index = <2>;
14160                 interrupt-map-mask = <f800 0 0 7>;
14161                 interrupt-map = <
14162                                 /* IDSEL 0x0E - MiniPCI Slot */
14163 @@ -249,6 +244,21 @@
14164                 device_type = "pci";
14165         };
14166  
14167 -
14168 -
14169 +       localbus@e0005000 {
14170 +               #address-cells = <2>;
14171 +               #size-cells = <1>;
14172 +               compatible = "fsl,mpc8349e-localbus",
14173 +                            "fsl,pq2pro-localbus";
14174 +               reg = <e0005000 d8>;
14175 +               ranges = <3 0 f0000000 210>;
14176 +
14177 +               pata@3,0 {
14178 +                       compatible = "fsl,mpc8349emitx-pata", "ata-generic";
14179 +                       reg = <3 0 10 3 20c 4>;
14180 +                       reg-shift = <1>;
14181 +                       pio-mode = <6>;
14182 +                       interrupts = <17 8>;
14183 +                       interrupt-parent = <&ipic>;
14184 +               };
14185 +       };
14186  };
14187 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8349emitxgp.dts
14188 ===================================================================
14189 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8349emitxgp.dts
14190 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8349emitxgp.dts
14191 @@ -14,6 +14,13 @@
14192         #address-cells = <1>;
14193         #size-cells = <1>;
14194  
14195 +       aliases {
14196 +               ethernet0 = &enet0;
14197 +               serial0 = &serial0;
14198 +               serial1 = &serial1;
14199 +               pci0 = &pci0;
14200 +       };
14201 +
14202         cpus {
14203                 #address-cells = <1>;
14204                 #size-cells = <0>;
14205 @@ -51,7 +58,9 @@
14206                 };
14207  
14208                 i2c@3000 {
14209 -                       device_type = "i2c";
14210 +                       #address-cells = <1>;
14211 +                       #size-cells = <0>;
14212 +                       cell-index = <0>;
14213                         compatible = "fsl-i2c";
14214                         reg = <3000 100>;
14215                         interrupts = <e 8>;
14216 @@ -60,7 +69,9 @@
14217                 };
14218  
14219                 i2c@3100 {
14220 -                       device_type = "i2c";
14221 +                       #address-cells = <1>;
14222 +                       #size-cells = <0>;
14223 +                       cell-index = <1>;
14224                         compatible = "fsl-i2c";
14225                         reg = <3100 100>;
14226                         interrupts = <f 8>;
14227 @@ -78,7 +89,6 @@
14228                 };
14229  
14230                 usb@23000 {
14231 -                       device_type = "usb";
14232                         compatible = "fsl-usb2-dr";
14233                         reg = <23000 1000>;
14234                         #address-cells = <1>;
14235 @@ -90,11 +100,10 @@
14236                 };
14237  
14238                 mdio@24520 {
14239 -                       device_type = "mdio";
14240 -                       compatible = "gianfar";
14241 -                       reg = <24520 20>;
14242                         #address-cells = <1>;
14243                         #size-cells = <0>;
14244 +                       compatible = "fsl,gianfar-mdio";
14245 +                       reg = <24520 20>;
14246  
14247                         /* Vitesse 8201 */
14248                         phy1c: ethernet-phy@1c {
14249 @@ -105,7 +114,8 @@
14250                         };
14251                 };
14252  
14253 -               ethernet@24000 {
14254 +               enet0: ethernet@24000 {
14255 +                       cell-index = <0>;
14256                         device_type = "network";
14257                         model = "TSEC";
14258                         compatible = "gianfar";
14259 @@ -117,7 +127,8 @@
14260                         linux,network-index = <0>;
14261                 };
14262  
14263 -               serial@4500 {
14264 +               serial0: serial@4500 {
14265 +                       cell-index = <0>;
14266                         device_type = "serial";
14267                         compatible = "ns16550";
14268                         reg = <4500 100>;
14269 @@ -126,7 +137,8 @@
14270                         interrupt-parent = < &ipic >;
14271                 };
14272  
14273 -               serial@4600 {
14274 +               serial1: serial@4600 {
14275 +                       cell-index = <1>;
14276                         device_type = "serial";
14277                         compatible = "ns16550";
14278                         reg = <4600 100>;
14279 @@ -157,7 +169,8 @@
14280                 };
14281         };
14282  
14283 -       pci@e0008600 {
14284 +       pci0: pci@e0008600 {
14285 +               cell-index = <2>;
14286                 interrupt-map-mask = <f800 0 0 7>;
14287                 interrupt-map = <
14288                                 /* IDSEL 0x0F - PCI Slot */
14289 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc834x_mds.dts
14290 ===================================================================
14291 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc834x_mds.dts
14292 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc834x_mds.dts
14293 @@ -15,6 +15,15 @@
14294         #address-cells = <1>;
14295         #size-cells = <1>;
14296  
14297 +       aliases {
14298 +               ethernet0 = &enet0;
14299 +               ethernet1 = &enet1;
14300 +               serial0 = &serial0;
14301 +               serial1 = &serial1;
14302 +               pci0 = &pci0;
14303 +               pci1 = &pci1;
14304 +       };
14305 +
14306         cpus {
14307                 #address-cells = <1>;
14308                 #size-cells = <0>;
14309 @@ -59,7 +68,7 @@
14310                 i2c@3000 {
14311                         #address-cells = <1>;
14312                         #size-cells = <0>;
14313 -                       device_type = "i2c";
14314 +                       cell-index = <0>;
14315                         compatible = "fsl-i2c";
14316                         reg = <3000 100>;
14317                         interrupts = <e 8>;
14318 @@ -75,7 +84,7 @@
14319                 i2c@3100 {
14320                         #address-cells = <1>;
14321                         #size-cells = <0>;
14322 -                       device_type = "i2c";
14323 +                       cell-index = <1>;
14324                         compatible = "fsl-i2c";
14325                         reg = <3100 100>;
14326                         interrupts = <f 8>;
14327 @@ -95,7 +104,6 @@
14328                 /* phy type (ULPI or SERIAL) are only types supportted for MPH */
14329                 /* port = 0 or 1 */
14330                 usb@22000 {
14331 -                       device_type = "usb";
14332                         compatible = "fsl-usb2-mph";
14333                         reg = <22000 1000>;
14334                         #address-cells = <1>;
14335 @@ -107,7 +115,6 @@
14336                 };
14337                 /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
14338                 usb@23000 {
14339 -                       device_type = "usb";
14340                         compatible = "fsl-usb2-dr";
14341                         reg = <23000 1000>;
14342                         #address-cells = <1>;
14343 @@ -119,11 +126,11 @@
14344                 };
14345  
14346                 mdio@24520 {
14347 -                       device_type = "mdio";
14348 -                       compatible = "gianfar";
14349 -                       reg = <24520 20>;
14350                         #address-cells = <1>;
14351                         #size-cells = <0>;
14352 +                       compatible = "fsl,gianfar-mdio";
14353 +                       reg = <24520 20>;
14354 +
14355                         phy0: ethernet-phy@0 {
14356                                 interrupt-parent = < &ipic >;
14357                                 interrupts = <11 8>;
14358 @@ -138,17 +145,12 @@
14359                         };
14360                 };
14361  
14362 -               ethernet@24000 {
14363 +               enet0: ethernet@24000 {
14364 +                       cell-index = <0>;
14365                         device_type = "network";
14366                         model = "TSEC";
14367                         compatible = "gianfar";
14368                         reg = <24000 1000>;
14369 -                       /*
14370 -                        * address is deprecated and will be removed
14371 -                        * in 2.6.25.  Only recent versions of
14372 -                        * U-Boot support local-mac-address, however.
14373 -                        */
14374 -                       address = [ 00 00 00 00 00 00 ];
14375                         local-mac-address = [ 00 00 00 00 00 00 ];
14376                         interrupts = <20 8 21 8 22 8>;
14377                         interrupt-parent = < &ipic >;
14378 @@ -156,19 +158,12 @@
14379                         linux,network-index = <0>;
14380                 };
14381  
14382 -               ethernet@25000 {
14383 -                       #address-cells = <1>;
14384 -                       #size-cells = <0>;
14385 +               enet1: ethernet@25000 {
14386 +                       cell-index = <1>;
14387                         device_type = "network";
14388                         model = "TSEC";
14389                         compatible = "gianfar";
14390                         reg = <25000 1000>;
14391 -                       /*
14392 -                        * address is deprecated and will be removed
14393 -                        * in 2.6.25.  Only recent versions of
14394 -                        * U-Boot support local-mac-address, however.
14395 -                        */
14396 -                       address = [ 00 00 00 00 00 00 ];
14397                         local-mac-address = [ 00 00 00 00 00 00 ];
14398                         interrupts = <23 8 24 8 25 8>;
14399                         interrupt-parent = < &ipic >;
14400 @@ -176,7 +171,8 @@
14401                         linux,network-index = <1>;
14402                 };
14403  
14404 -               serial@4500 {
14405 +               serial0: serial@4500 {
14406 +                       cell-index = <0>;
14407                         device_type = "serial";
14408                         compatible = "ns16550";
14409                         reg = <4500 100>;
14410 @@ -185,7 +181,8 @@
14411                         interrupt-parent = < &ipic >;
14412                 };
14413  
14414 -               serial@4600 {
14415 +               serial1: serial@4600 {
14416 +                       cell-index = <1>;
14417                         device_type = "serial";
14418                         compatible = "ns16550";
14419                         reg = <4600 100>;
14420 @@ -225,7 +222,8 @@
14421                 };
14422         };
14423  
14424 -       pci@e0008500 {
14425 +       pci0: pci@e0008500 {
14426 +               cell-index = <1>;
14427                 interrupt-map-mask = <f800 0 0 7>;
14428                 interrupt-map = <
14429  
14430 @@ -285,7 +283,8 @@
14431                 device_type = "pci";
14432         };
14433  
14434 -       pci@e0008600 {
14435 +       pci1: pci@e0008600 {
14436 +               cell-index = <2>;
14437                 interrupt-map-mask = <f800 0 0 7>;
14438                 interrupt-map = <
14439  
14440 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc836x_mds.dts
14441 ===================================================================
14442 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc836x_mds.dts
14443 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc836x_mds.dts
14444 @@ -20,6 +20,14 @@
14445         #address-cells = <1>;
14446         #size-cells = <1>;
14447  
14448 +       aliases {
14449 +               ethernet0 = &enet0;
14450 +               ethernet1 = &enet1;
14451 +               serial0 = &serial0;
14452 +               serial1 = &serial1;
14453 +               pci0 = &pci0;
14454 +       };
14455 +
14456         cpus {
14457                 #address-cells = <1>;
14458                 #size-cells = <0>;
14459 @@ -64,7 +72,7 @@
14460                 i2c@3000 {
14461                         #address-cells = <1>;
14462                         #size-cells = <0>;
14463 -                       device_type = "i2c";
14464 +                       cell-index = <0>;
14465                         compatible = "fsl-i2c";
14466                         reg = <3000 100>;
14467                         interrupts = <e 8>;
14468 @@ -80,7 +88,7 @@
14469                 i2c@3100 {
14470                         #address-cells = <1>;
14471                         #size-cells = <0>;
14472 -                       device_type = "i2c";
14473 +                       cell-index = <1>;
14474                         compatible = "fsl-i2c";
14475                         reg = <3100 100>;
14476                         interrupts = <f 8>;
14477 @@ -88,7 +96,8 @@
14478                         dfsrr;
14479                 };
14480  
14481 -               serial@4500 {
14482 +               serial0: serial@4500 {
14483 +                       cell-index = <0>;
14484                         device_type = "serial";
14485                         compatible = "ns16550";
14486                         reg = <4500 100>;
14487 @@ -97,7 +106,8 @@
14488                         interrupt-parent = < &ipic >;
14489                 };
14490  
14491 -               serial@4600 {
14492 +               serial1: serial@4600 {
14493 +                       cell-index = <1>;
14494                         device_type = "serial";
14495                         compatible = "ns16550";
14496                         reg = <4600 100>;
14497 @@ -231,7 +241,6 @@
14498                 };
14499  
14500                 usb@6c0 {
14501 -                       device_type = "usb";
14502                         compatible = "qe_udc";
14503                         reg = <6c0 40 8B00 100>;
14504                         interrupts = <b>;
14505 @@ -239,45 +248,35 @@
14506                         mode = "slave";
14507                 };
14508  
14509 -               ucc@2000 {
14510 +               enet0: ucc@2000 {
14511                         device_type = "network";
14512                         compatible = "ucc_geth";
14513                         model = "UCC";
14514 +                       cell-index = <1>;
14515                         device-id = <1>;
14516                         reg = <2000 200>;
14517                         interrupts = <20>;
14518                         interrupt-parent = < &qeic >;
14519 -                       /*
14520 -                        * mac-address is deprecated and will be removed
14521 -                        * in 2.6.25.  Only recent versions of
14522 -                        * U-Boot support local-mac-address, however.
14523 -                        */
14524 -                       mac-address = [ 00 00 00 00 00 00 ];
14525                         local-mac-address = [ 00 00 00 00 00 00 ];
14526 -                       rx-clock = <0>;
14527 -                       tx-clock = <19>;
14528 +                       rx-clock-name = "none";
14529 +                       tx-clock-name = "clk9";
14530                         phy-handle = < &phy0 >;
14531                         phy-connection-type = "rgmii-id";
14532                         pio-handle = < &pio1 >;
14533                 };
14534  
14535 -               ucc@3000 {
14536 +               enet1: ucc@3000 {
14537                         device_type = "network";
14538                         compatible = "ucc_geth";
14539                         model = "UCC";
14540 +                       cell-index = <2>;
14541                         device-id = <2>;
14542                         reg = <3000 200>;
14543                         interrupts = <21>;
14544                         interrupt-parent = < &qeic >;
14545 -                       /*
14546 -                        * mac-address is deprecated and will be removed
14547 -                        * in 2.6.25.  Only recent versions of
14548 -                        * U-Boot support local-mac-address, however.
14549 -                        */
14550 -                       mac-address = [ 00 00 00 00 00 00 ];
14551                         local-mac-address = [ 00 00 00 00 00 00 ];
14552 -                       rx-clock = <0>;
14553 -                       tx-clock = <14>;
14554 +                       rx-clock-name = "none";
14555 +                       tx-clock-name = "clk4";
14556                         phy-handle = < &phy1 >;
14557                         phy-connection-type = "rgmii-id";
14558                         pio-handle = < &pio2 >;
14559 @@ -316,7 +315,8 @@
14560                 };
14561         };
14562  
14563 -       pci@e0008500 {
14564 +       pci0: pci@e0008500 {
14565 +               cell-index = <1>;
14566                 interrupt-map-mask = <f800 0 0 7>;
14567                 interrupt-map = <
14568  
14569 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8377_mds.dts
14570 ===================================================================
14571 --- /dev/null
14572 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8377_mds.dts
14573 @@ -0,0 +1,279 @@
14574 +/*
14575 + * MPC8377E MDS Device Tree Source
14576 + *
14577 + * Copyright 2007 Freescale Semiconductor Inc.
14578 + *
14579 + * This program is free software; you can redistribute  it and/or modify it
14580 + * under  the terms of  the GNU General  Public License as published by the
14581 + * Free Software Foundation;  either version 2 of the  License, or (at your
14582 + * option) any later version.
14583 + */
14584 +
14585 +/dts-v1/;
14586 +
14587 +/ {
14588 +       model = "fsl,mpc8377emds";
14589 +       compatible = "fsl,mpc8377emds","fsl,mpc837xmds";
14590 +       #address-cells = <1>;
14591 +       #size-cells = <1>;
14592 +
14593 +       aliases {
14594 +               ethernet0 = &enet0;
14595 +               ethernet1 = &enet1;
14596 +               serial0 = &serial0;
14597 +               serial1 = &serial1;
14598 +               pci0 = &pci0;
14599 +       };
14600 +
14601 +       cpus {
14602 +               #address-cells = <1>;
14603 +               #size-cells = <0>;
14604 +
14605 +               PowerPC,8377@0 {
14606 +                       device_type = "cpu";
14607 +                       reg = <0>;
14608 +                       d-cache-line-size = <0x20>;
14609 +                       i-cache-line-size = <0x20>;
14610 +                       d-cache-size = <0x8000>;                // L1, 32K
14611 +                       i-cache-size = <0x8000>;                // L1, 32K
14612 +                       timebase-frequency = <0>;
14613 +                       bus-frequency = <0>;
14614 +                       clock-frequency = <0>;
14615 +               };
14616 +       };
14617 +
14618 +       memory {
14619 +               device_type = "memory";
14620 +               reg = <0x00000000 0x20000000>;  // 512MB at 0
14621 +       };
14622 +
14623 +       soc@e0000000 {
14624 +               #address-cells = <1>;
14625 +               #size-cells = <1>;
14626 +               device_type = "soc";
14627 +               ranges = <0x0 0xe0000000 0x00100000>;
14628 +               reg = <0xe0000000 0x00000200>;
14629 +               bus-frequency = <0>;
14630 +
14631 +               wdt@200 {
14632 +                       compatible = "mpc83xx_wdt";
14633 +                       reg = <0x200 0x100>;
14634 +               };
14635 +
14636 +               i2c@3000 {
14637 +                       #address-cells = <1>;
14638 +                       #size-cells = <0>;
14639 +                       cell-index = <0>;
14640 +                       compatible = "fsl-i2c";
14641 +                       reg = <0x3000 0x100>;
14642 +                       interrupts = <0xe 0x8>;
14643 +                       interrupt-parent = < &ipic >;
14644 +                       dfsrr;
14645 +               };
14646 +
14647 +               i2c@3100 {
14648 +                       #address-cells = <1>;
14649 +                       #size-cells = <0>;
14650 +                       cell-index = <1>;
14651 +                       compatible = "fsl-i2c";
14652 +                       reg = <0x3100 0x100>;
14653 +                       interrupts = <0xf 0x8>;
14654 +                       interrupt-parent = < &ipic >;
14655 +                       dfsrr;
14656 +               };
14657 +
14658 +               spi@7000 {
14659 +                       compatible = "fsl_spi";
14660 +                       reg = <0x7000 0x1000>;
14661 +                       interrupts = <0x10 0x8>;
14662 +                       interrupt-parent = < &ipic >;
14663 +                       mode = "cpu";
14664 +               };
14665 +
14666 +               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
14667 +               usb@23000 {
14668 +                       compatible = "fsl-usb2-dr";
14669 +                       reg = <0x23000 0x1000>;
14670 +                       #address-cells = <1>;
14671 +                       #size-cells = <0>;
14672 +                       interrupt-parent = < &ipic >;
14673 +                       interrupts = <0x26 0x8>;
14674 +                       phy_type = "utmi_wide";
14675 +               };
14676 +
14677 +               mdio@24520 {
14678 +                       #address-cells = <1>;
14679 +                       #size-cells = <0>;
14680 +                       compatible = "fsl,gianfar-mdio";
14681 +                       reg = <0x24520 0x20>;
14682 +                       phy2: ethernet-phy@2 {
14683 +                               interrupt-parent = < &ipic >;
14684 +                               interrupts = <0x11 0x8>;
14685 +                               reg = <2>;
14686 +                               device_type = "ethernet-phy";
14687 +                       };
14688 +                       phy3: ethernet-phy@3 {
14689 +                               interrupt-parent = < &ipic >;
14690 +                               interrupts = <0x12 0x8>;
14691 +                               reg = <3>;
14692 +                               device_type = "ethernet-phy";
14693 +                       };
14694 +               };
14695 +
14696 +               enet0: ethernet@24000 {
14697 +                       cell-index = <0>;
14698 +                       device_type = "network";
14699 +                       model = "eTSEC";
14700 +                       compatible = "gianfar";
14701 +                       reg = <0x24000 0x1000>;
14702 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14703 +                       interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
14704 +                       phy-connection-type = "mii";
14705 +                       interrupt-parent = < &ipic >;
14706 +                       phy-handle = < &phy2 >;
14707 +               };
14708 +
14709 +               enet1: ethernet@25000 {
14710 +                       cell-index = <1>;
14711 +                       device_type = "network";
14712 +                       model = "eTSEC";
14713 +                       compatible = "gianfar";
14714 +                       reg = <0x25000 0x1000>;
14715 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14716 +                       interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
14717 +                       phy-connection-type = "mii";
14718 +                       interrupt-parent = < &ipic >;
14719 +                       phy-handle = < &phy3 >;
14720 +               };
14721 +
14722 +               serial0: serial@4500 {
14723 +                       cell-index = <0>;
14724 +                       device_type = "serial";
14725 +                       compatible = "ns16550";
14726 +                       reg = <0x4500 0x100>;
14727 +                       clock-frequency = <0>;
14728 +                       interrupts = <0x9 0x8>;
14729 +                       interrupt-parent = < &ipic >;
14730 +               };
14731 +
14732 +               serial1: serial@4600 {
14733 +                       cell-index = <1>;
14734 +                       device_type = "serial";
14735 +                       compatible = "ns16550";
14736 +                       reg = <0x4600 0x100>;
14737 +                       clock-frequency = <0>;
14738 +                       interrupts = <0xa 0x8>;
14739 +                       interrupt-parent = < &ipic >;
14740 +               };
14741 +
14742 +               crypto@30000 {
14743 +                       model = "SEC3";
14744 +                       compatible = "talitos";
14745 +                       reg = <0x30000 0x10000>;
14746 +                       interrupts = <0xb 0x8>;
14747 +                       interrupt-parent = < &ipic >;
14748 +                       /* Rev. 3.0 geometry */
14749 +                       num-channels = <4>;
14750 +                       channel-fifo-len = <0x18>;
14751 +                       exec-units-mask = <0x000001fe>;
14752 +                       descriptor-types-mask = <0x03ab0ebf>;
14753 +               };
14754 +
14755 +               sdhc@2e000 {
14756 +                       model = "eSDHC";
14757 +                       compatible = "fsl,esdhc";
14758 +                       reg = <0x2e000 0x1000>;
14759 +                       interrupts = <0x2a 0x8>;
14760 +                       interrupt-parent = < &ipic >;
14761 +               };
14762 +
14763 +               sata@18000 {
14764 +                       compatible = "fsl,mpc8379-sata";
14765 +                       reg = <0x18000 0x1000>;
14766 +                       interrupts = <0x2c 0x8>;
14767 +                       interrupt-parent = < &ipic >;
14768 +               };
14769 +
14770 +               sata@19000 {
14771 +                       compatible = "fsl,mpc8379-sata";
14772 +                       reg = <0x19000 0x1000>;
14773 +                       interrupts = <0x2d 0x8>;
14774 +                       interrupt-parent = < &ipic >;
14775 +               };
14776 +
14777 +               /* IPIC
14778 +                * interrupts cell = <intr #, sense>
14779 +                * sense values match linux IORESOURCE_IRQ_* defines:
14780 +                * sense == 8: Level, low assertion
14781 +                * sense == 2: Edge, high-to-low change
14782 +                */
14783 +               ipic: pic@700 {
14784 +                       compatible = "fsl,ipic";
14785 +                       interrupt-controller;
14786 +                       #address-cells = <0>;
14787 +                       #interrupt-cells = <2>;
14788 +                       reg = <0x700 0x100>;
14789 +               };
14790 +       };
14791 +
14792 +       pci0: pci@e0008500 {
14793 +               cell-index = <0>;
14794 +               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
14795 +               interrupt-map = <
14796 +
14797 +                               /* IDSEL 0x11 */
14798 +                                0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
14799 +                                0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
14800 +                                0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
14801 +                                0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
14802 +
14803 +                               /* IDSEL 0x12 */
14804 +                                0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
14805 +                                0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
14806 +                                0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
14807 +                                0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
14808 +
14809 +                               /* IDSEL 0x13 */
14810 +                                0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
14811 +                                0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
14812 +                                0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
14813 +                                0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
14814 +
14815 +                               /* IDSEL 0x15 */
14816 +                                0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
14817 +                                0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
14818 +                                0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
14819 +                                0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
14820 +
14821 +                               /* IDSEL 0x16 */
14822 +                                0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
14823 +                                0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
14824 +                                0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
14825 +                                0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
14826 +
14827 +                               /* IDSEL 0x17 */
14828 +                                0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
14829 +                                0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
14830 +                                0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
14831 +                                0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
14832 +
14833 +                               /* IDSEL 0x18 */
14834 +                                0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
14835 +                                0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
14836 +                                0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
14837 +                                0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
14838 +               interrupt-parent = < &ipic >;
14839 +               interrupts = <0x42 0x8>;
14840 +               bus-range = <0 0>;
14841 +               ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
14842 +                         0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
14843 +                         0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
14844 +               clock-frequency = <0>;
14845 +               #interrupt-cells = <1>;
14846 +               #size-cells = <2>;
14847 +               #address-cells = <3>;
14848 +               reg = <0xe0008500 0x100>;
14849 +               compatible = "fsl,mpc8349-pci";
14850 +               device_type = "pci";
14851 +       };
14852 +};
14853 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8378_mds.dts
14854 ===================================================================
14855 --- /dev/null
14856 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8378_mds.dts
14857 @@ -0,0 +1,265 @@
14858 +/*
14859 + * MPC8378E MDS Device Tree Source
14860 + *
14861 + * Copyright 2007 Freescale Semiconductor Inc.
14862 + *
14863 + * This program is free software; you can redistribute  it and/or modify it
14864 + * under  the terms of  the GNU General  Public License as published by the
14865 + * Free Software Foundation;  either version 2 of the  License, or (at your
14866 + * option) any later version.
14867 + */
14868 +
14869 +/dts-v1/;
14870 +
14871 +/ {
14872 +       model = "fsl,mpc8378emds";
14873 +       compatible = "fsl,mpc8378emds","fsl,mpc837xmds";
14874 +       #address-cells = <1>;
14875 +       #size-cells = <1>;
14876 +
14877 +       aliases {
14878 +               ethernet0 = &enet0;
14879 +               ethernet1 = &enet1;
14880 +               serial0 = &serial0;
14881 +               serial1 = &serial1;
14882 +               pci0 = &pci0;
14883 +       };
14884 +
14885 +       cpus {
14886 +               #address-cells = <1>;
14887 +               #size-cells = <0>;
14888 +
14889 +               PowerPC,8378@0 {
14890 +                       device_type = "cpu";
14891 +                       reg = <0>;
14892 +                       d-cache-line-size = <0x20>;
14893 +                       i-cache-line-size = <0x20>;
14894 +                       d-cache-size = <0x8000>;                // L1, 32K
14895 +                       i-cache-size = <0x8000>;                // L1, 32K
14896 +                       timebase-frequency = <0>;
14897 +                       bus-frequency = <0>;
14898 +                       clock-frequency = <0>;
14899 +               };
14900 +       };
14901 +
14902 +       memory {
14903 +               device_type = "memory";
14904 +               reg = <0x00000000 0x20000000>;  // 512MB at 0
14905 +       };
14906 +
14907 +       soc@e0000000 {
14908 +               #address-cells = <1>;
14909 +               #size-cells = <1>;
14910 +               device_type = "soc";
14911 +               ranges = <0x0 0xe0000000 0x00100000>;
14912 +               reg = <0xe0000000 0x00000200>;
14913 +               bus-frequency = <0>;
14914 +
14915 +               wdt@200 {
14916 +                       compatible = "mpc83xx_wdt";
14917 +                       reg = <0x200 0x100>;
14918 +               };
14919 +
14920 +               i2c@3000 {
14921 +                       #address-cells = <1>;
14922 +                       #size-cells = <0>;
14923 +                       cell-index = <0>;
14924 +                       compatible = "fsl-i2c";
14925 +                       reg = <0x3000 0x100>;
14926 +                       interrupts = <0xe 0x8>;
14927 +                       interrupt-parent = < &ipic >;
14928 +                       dfsrr;
14929 +               };
14930 +
14931 +               i2c@3100 {
14932 +                       #address-cells = <1>;
14933 +                       #size-cells = <0>;
14934 +                       cell-index = <1>;
14935 +                       compatible = "fsl-i2c";
14936 +                       reg = <0x3100 0x100>;
14937 +                       interrupts = <0xf 0x8>;
14938 +                       interrupt-parent = < &ipic >;
14939 +                       dfsrr;
14940 +               };
14941 +
14942 +               spi@7000 {
14943 +                       compatible = "fsl_spi";
14944 +                       reg = <0x7000 0x1000>;
14945 +                       interrupts = <0x10 0x8>;
14946 +                       interrupt-parent = < &ipic >;
14947 +                       mode = "cpu";
14948 +               };
14949 +
14950 +               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
14951 +               usb@23000 {
14952 +                       compatible = "fsl-usb2-dr";
14953 +                       reg = <0x23000 0x1000>;
14954 +                       #address-cells = <1>;
14955 +                       #size-cells = <0>;
14956 +                       interrupt-parent = < &ipic >;
14957 +                       interrupts = <0x26 0x8>;
14958 +                       phy_type = "utmi_wide";
14959 +               };
14960 +
14961 +               mdio@24520 {
14962 +                       #address-cells = <1>;
14963 +                       #size-cells = <0>;
14964 +                       compatible = "fsl,gianfar-mdio";
14965 +                       reg = <0x24520 0x20>;
14966 +                       phy2: ethernet-phy@2 {
14967 +                               interrupt-parent = < &ipic >;
14968 +                               interrupts = <0x11 0x8>;
14969 +                               reg = <2>;
14970 +                               device_type = "ethernet-phy";
14971 +                       };
14972 +                       phy3: ethernet-phy@3 {
14973 +                               interrupt-parent = < &ipic >;
14974 +                               interrupts = <0x12 0x8>;
14975 +                               reg = <3>;
14976 +                               device_type = "ethernet-phy";
14977 +                       };
14978 +               };
14979 +
14980 +               enet0: ethernet@24000 {
14981 +                       cell-index = <0>;
14982 +                       device_type = "network";
14983 +                       model = "eTSEC";
14984 +                       compatible = "gianfar";
14985 +                       reg = <0x24000 0x1000>;
14986 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14987 +                       interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
14988 +                       phy-connection-type = "mii";
14989 +                       interrupt-parent = < &ipic >;
14990 +                       phy-handle = < &phy2 >;
14991 +               };
14992 +
14993 +               enet1: ethernet@25000 {
14994 +                       cell-index = <1>;
14995 +                       device_type = "network";
14996 +                       model = "eTSEC";
14997 +                       compatible = "gianfar";
14998 +                       reg = <0x25000 0x1000>;
14999 +                       local-mac-address = [ 00 00 00 00 00 00 ];
15000 +                       interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
15001 +                       phy-connection-type = "mii";
15002 +                       interrupt-parent = < &ipic >;
15003 +                       phy-handle = < &phy3 >;
15004 +               };
15005 +
15006 +               serial0: serial@4500 {
15007 +                       cell-index = <0>;
15008 +                       device_type = "serial";
15009 +                       compatible = "ns16550";
15010 +                       reg = <0x4500 0x100>;
15011 +                       clock-frequency = <0>;
15012 +                       interrupts = <0x9 0x8>;
15013 +                       interrupt-parent = < &ipic >;
15014 +               };
15015 +
15016 +               serial1: serial@4600 {
15017 +                       cell-index = <1>;
15018 +                       device_type = "serial";
15019 +                       compatible = "ns16550";
15020 +                       reg = <0x4600 0x100>;
15021 +                       clock-frequency = <0>;
15022 +                       interrupts = <0xa 0x8>;
15023 +                       interrupt-parent = < &ipic >;
15024 +               };
15025 +
15026 +               crypto@30000 {
15027 +                       model = "SEC3";
15028 +                       compatible = "talitos";
15029 +                       reg = <0x30000 0x10000>;
15030 +                       interrupts = <0xb 0x8>;
15031 +                       interrupt-parent = < &ipic >;
15032 +                       /* Rev. 3.0 geometry */
15033 +                       num-channels = <4>;
15034 +                       channel-fifo-len = <0x18>;
15035 +                       exec-units-mask = <0x000001fe>;
15036 +                       descriptor-types-mask = <0x03ab0ebf>;
15037 +               };
15038 +
15039 +               sdhc@2e000 {
15040 +                       model = "eSDHC";
15041 +                       compatible = "fsl,esdhc";
15042 +                       reg = <0x2e000 0x1000>;
15043 +                       interrupts = <0x2a 0x8>;
15044 +                       interrupt-parent = < &ipic >;
15045 +               };
15046 +
15047 +               /* IPIC
15048 +                * interrupts cell = <intr #, sense>
15049 +                * sense values match linux IORESOURCE_IRQ_* defines:
15050 +                * sense == 8: Level, low assertion
15051 +                * sense == 2: Edge, high-to-low change
15052 +                */
15053 +               ipic: pic@700 {
15054 +                       compatible = "fsl,ipic";
15055 +                       interrupt-controller;
15056 +                       #address-cells = <0>;
15057 +                       #interrupt-cells = <2>;
15058 +                       reg = <0x700 0x100>;
15059 +               };
15060 +       };
15061 +
15062 +       pci0: pci@e0008500 {
15063 +               cell-index = <0>;
15064 +               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
15065 +               interrupt-map = <
15066 +
15067 +                               /* IDSEL 0x11 */
15068 +                                0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
15069 +                                0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
15070 +                                0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
15071 +                                0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
15072 +
15073 +                               /* IDSEL 0x12 */
15074 +                                0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
15075 +                                0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
15076 +                                0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
15077 +                                0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
15078 +
15079 +                               /* IDSEL 0x13 */
15080 +                                0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
15081 +                                0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
15082 +                                0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
15083 +                                0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
15084 +
15085 +                               /* IDSEL 0x15 */
15086 +                                0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
15087 +                                0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
15088 +                                0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
15089 +                                0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
15090 +
15091 +                               /* IDSEL 0x16 */
15092 +                                0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
15093 +                                0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
15094 +                                0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
15095 +                                0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
15096 +
15097 +                               /* IDSEL 0x17 */
15098 +                                0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
15099 +                                0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
15100 +                                0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
15101 +                                0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
15102 +
15103 +                               /* IDSEL 0x18 */
15104 +                                0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
15105 +                                0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
15106 +                                0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
15107 +                                0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
15108 +               interrupt-parent = < &ipic >;
15109 +               interrupts = <0x42 0x8>;
15110 +               bus-range = <0 0>;
15111 +               ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
15112 +                         0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
15113 +                         0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
15114 +               clock-frequency = <0>;
15115 +               #interrupt-cells = <1>;
15116 +               #size-cells = <2>;
15117 +               #address-cells = <3>;
15118 +               reg = <0xe0008500 0x100>;
15119 +               compatible = "fsl,mpc8349-pci";
15120 +               device_type = "pci";
15121 +       };
15122 +};
15123 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8379_mds.dts
15124 ===================================================================
15125 --- /dev/null
15126 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8379_mds.dts
15127 @@ -0,0 +1,293 @@
15128 +/*
15129 + * MPC8379E MDS Device Tree Source
15130 + *
15131 + * Copyright 2007 Freescale Semiconductor Inc.
15132 + *
15133 + * This program is free software; you can redistribute  it and/or modify it
15134 + * under  the terms of  the GNU General  Public License as published by the
15135 + * Free Software Foundation;  either version 2 of the  License, or (at your
15136 + * option) any later version.
15137 + */
15138 +
15139 +/dts-v1/;
15140 +
15141 +/ {
15142 +       model = "fsl,mpc8379emds";
15143 +       compatible = "fsl,mpc8379emds","fsl,mpc837xmds";
15144 +       #address-cells = <1>;
15145 +       #size-cells = <1>;
15146 +
15147 +       aliases {
15148 +               ethernet0 = &enet0;
15149 +               ethernet1 = &enet1;
15150 +               serial0 = &serial0;
15151 +               serial1 = &serial1;
15152 +               pci0 = &pci0;
15153 +       };
15154 +
15155 +       cpus {
15156 +               #address-cells = <1>;
15157 +               #size-cells = <0>;
15158 +
15159 +               PowerPC,8379@0 {
15160 +                       device_type = "cpu";
15161 +                       reg = <0>;
15162 +                       d-cache-line-size = <0x20>;
15163 +                       i-cache-line-size = <0x20>;
15164 +                       d-cache-size = <0x8000>;                // L1, 32K
15165 +                       i-cache-size = <0x8000>;                // L1, 32K
15166 +                       timebase-frequency = <0>;
15167 +                       bus-frequency = <0>;
15168 +                       clock-frequency = <0>;
15169 +               };
15170 +       };
15171 +
15172 +       memory {
15173 +               device_type = "memory";
15174 +               reg = <0x00000000 0x20000000>;  // 512MB at 0
15175 +       };
15176 +
15177 +       soc@e0000000 {
15178 +               #address-cells = <1>;
15179 +               #size-cells = <1>;
15180 +               device_type = "soc";
15181 +               ranges = <0x0 0xe0000000 0x00100000>;
15182 +               reg = <0xe0000000 0x00000200>;
15183 +               bus-frequency = <0>;
15184 +
15185 +               wdt@200 {
15186 +                       compatible = "mpc83xx_wdt";
15187 +                       reg = <0x200 0x100>;
15188 +               };
15189 +
15190 +               i2c@3000 {
15191 +                       #address-cells = <1>;
15192 +                       #size-cells = <0>;
15193 +                       cell-index = <0>;
15194 +                       compatible = "fsl-i2c";
15195 +                       reg = <0x3000 0x100>;
15196 +                       interrupts = <0xe 0x8>;
15197 +                       interrupt-parent = < &ipic >;
15198 +                       dfsrr;
15199 +               };
15200 +
15201 +               i2c@3100 {
15202 +                       #address-cells = <1>;
15203 +                       #size-cells = <0>;
15204 +                       cell-index = <1>;
15205 +                       compatible = "fsl-i2c";
15206 +                       reg = <0x3100 0x100>;
15207 +                       interrupts = <0xf 0x8>;
15208 +                       interrupt-parent = < &ipic >;
15209 +                       dfsrr;
15210 +               };
15211 +
15212 +               spi@7000 {
15213 +                       compatible = "fsl_spi";
15214 +                       reg = <0x7000 0x1000>;
15215 +                       interrupts = <0x10 0x8>;
15216 +                       interrupt-parent = < &ipic >;
15217 +                       mode = "cpu";
15218 +               };
15219 +
15220 +               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
15221 +               usb@23000 {
15222 +                       compatible = "fsl-usb2-dr";
15223 +                       reg = <0x23000 0x1000>;
15224 +                       #address-cells = <1>;
15225 +                       #size-cells = <0>;
15226 +                       interrupt-parent = < &ipic >;
15227 +                       interrupts = <0x26 0x8>;
15228 +                       phy_type = "utmi_wide";
15229 +               };
15230 +
15231 +               mdio@24520 {
15232 +                       #address-cells = <1>;
15233 +                       #size-cells = <0>;
15234 +                       compatible = "fsl,gianfar-mdio";
15235 +                       reg = <0x24520 0x20>;
15236 +                       phy2: ethernet-phy@2 {
15237 +                               interrupt-parent = < &ipic >;
15238 +                               interrupts = <0x11 0x8>;
15239 +                               reg = <2>;
15240 +                               device_type = "ethernet-phy";
15241 +                       };
15242 +                       phy3: ethernet-phy@3 {
15243 +                               interrupt-parent = < &ipic >;
15244 +                               interrupts = <0x12 0x8>;
15245 +                               reg = <3>;
15246 +                               device_type = "ethernet-phy";
15247 +                       };
15248 +               };
15249 +
15250 +               enet0: ethernet@24000 {
15251 +                       cell-index = <0>;
15252 +                       device_type = "network";
15253 +                       model = "eTSEC";
15254 +                       compatible = "gianfar";
15255 +                       reg = <0x24000 0x1000>;
15256 +                       local-mac-address = [ 00 00 00 00 00 00 ];
15257 +                       interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
15258 +                       phy-connection-type = "mii";
15259 +                       interrupt-parent = < &ipic >;
15260 +                       phy-handle = < &phy2 >;
15261 +               };
15262 +
15263 +               enet1: ethernet@25000 {
15264 +                       cell-index = <1>;
15265 +                       device_type = "network";
15266 +                       model = "eTSEC";
15267 +                       compatible = "gianfar";
15268 +                       reg = <0x25000 0x1000>;
15269 +                       local-mac-address = [ 00 00 00 00 00 00 ];
15270 +                       interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
15271 +                       phy-connection-type = "mii";
15272 +                       interrupt-parent = < &ipic >;
15273 +                       phy-handle = < &phy3 >;
15274 +               };
15275 +
15276 +               serial0: serial@4500 {
15277 +                       cell-index = <0>;
15278 +                       device_type = "serial";
15279 +                       compatible = "ns16550";
15280 +                       reg = <0x4500 0x100>;
15281 +                       clock-frequency = <0>;
15282 +                       interrupts = <0x9 0x8>;
15283 +                       interrupt-parent = < &ipic >;
15284 +               };
15285 +
15286 +               serial1: serial@4600 {
15287 +                       cell-index = <1>;
15288 +                       device_type = "serial";
15289 +                       compatible = "ns16550";
15290 +                       reg = <0x4600 0x100>;
15291 +                       clock-frequency = <0>;
15292 +                       interrupts = <0xa 0x8>;
15293 +                       interrupt-parent = < &ipic >;
15294 +               };
15295 +
15296 +               crypto@30000 {
15297 +                       model = "SEC3";
15298 +                       compatible = "talitos";
15299 +                       reg = <0x30000 0x10000>;
15300 +                       interrupts = <0xb 0x8>;
15301 +                       interrupt-parent = < &ipic >;
15302 +                       /* Rev. 3.0 geometry */
15303 +                       num-channels = <4>;
15304 +                       channel-fifo-len = <0x18>;
15305 +                       exec-units-mask = <0x000001fe>;
15306 +                       descriptor-types-mask = <0x03ab0ebf>;
15307 +               };
15308 +
15309 +               sdhc@2e000 {
15310 +                       model = "eSDHC";
15311 +                       compatible = "fsl,esdhc";
15312 +                       reg = <0x2e000 0x1000>;
15313 +                       interrupts = <0x2a 0x8>;
15314 +                       interrupt-parent = < &ipic >;
15315 +               };
15316 +
15317 +               sata@18000 {
15318 +                       compatible = "fsl,mpc8379-sata";
15319 +                       reg = <0x18000 0x1000>;
15320 +                       interrupts = <0x2c 0x8>;
15321 +                       interrupt-parent = < &ipic >;
15322 +               };
15323 +
15324 +               sata@19000 {
15325 +                       compatible = "fsl,mpc8379-sata";
15326 +                       reg = <0x19000 0x1000>;
15327 +                       interrupts = <0x2d 0x8>;
15328 +                       interrupt-parent = < &ipic >;
15329 +               };
15330 +
15331 +               sata@1a000 {
15332 +                       compatible = "fsl,mpc8379-sata";
15333 +                       reg = <0x1a000 0x1000>;
15334 +                       interrupts = <0x2e 0x8>;
15335 +                       interrupt-parent = < &ipic >;
15336 +               };
15337 +
15338 +               sata@1b000 {
15339 +                       compatible = "fsl,mpc8379-sata";
15340 +                       reg = <0x1b000 0x1000>;
15341 +                       interrupts = <0x2f 0x8>;
15342 +                       interrupt-parent = < &ipic >;
15343 +               };
15344 +
15345 +               /* IPIC
15346 +                * interrupts cell = <intr #, sense>
15347 +                * sense values match linux IORESOURCE_IRQ_* defines:
15348 +                * sense == 8: Level, low assertion
15349 +                * sense == 2: Edge, high-to-low change
15350 +                */
15351 +               ipic: pic@700 {
15352 +                       compatible = "fsl,ipic";
15353 +                       interrupt-controller;
15354 +                       #address-cells = <0>;
15355 +                       #interrupt-cells = <2>;
15356 +                       reg = <0x700 0x100>;
15357 +               };
15358 +       };
15359 +
15360 +       pci0: pci@e0008500 {
15361 +               cell-index = <0>;
15362 +               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
15363 +               interrupt-map = <
15364 +
15365 +                               /* IDSEL 0x11 */
15366 +                                0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
15367 +                                0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
15368 +                                0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
15369 +                                0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
15370 +
15371 +                               /* IDSEL 0x12 */
15372 +                                0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
15373 +                                0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
15374 +                                0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
15375 +                                0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
15376 +
15377 +                               /* IDSEL 0x13 */
15378 +                                0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
15379 +                                0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
15380 +                                0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
15381 +                                0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
15382 +
15383 +                               /* IDSEL 0x15 */
15384 +                                0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
15385 +                                0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
15386 +                                0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
15387 +                                0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
15388 +
15389 +                               /* IDSEL 0x16 */
15390 +                                0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
15391 +                                0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
15392 +                                0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
15393 +                                0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
15394 +
15395 +                               /* IDSEL 0x17 */
15396 +                                0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
15397 +                                0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
15398 +                                0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
15399 +                                0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
15400 +
15401 +                               /* IDSEL 0x18 */
15402 +                                0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
15403 +                                0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
15404 +                                0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
15405 +                                0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
15406 +               interrupt-parent = < &ipic >;
15407 +               interrupts = <0x42 0x8>;
15408 +               bus-range = <0 0>;
15409 +               ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
15410 +                         0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
15411 +                         0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
15412 +               clock-frequency = <0>;
15413 +               #interrupt-cells = <1>;
15414 +               #size-cells = <2>;
15415 +               #address-cells = <3>;
15416 +               reg = <0xe0008500 0x100>;
15417 +               compatible = "fsl,mpc8349-pci";
15418 +               device_type = "pci";
15419 +       };
15420 +};
15421 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8540ads.dts
15422 ===================================================================
15423 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8540ads.dts
15424 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8540ads.dts
15425 @@ -16,6 +16,15 @@
15426         #address-cells = <1>;
15427         #size-cells = <1>;
15428  
15429 +       aliases {
15430 +               ethernet0 = &enet0;
15431 +               ethernet1 = &enet1;
15432 +               ethernet2 = &enet2;
15433 +               serial0 = &serial0;
15434 +               serial1 = &serial1;
15435 +               pci0 = &pci0;
15436 +       };
15437 +
15438         cpus {
15439                 #address-cells = <1>;
15440                 #size-cells = <0>;
15441 @@ -63,7 +72,9 @@
15442                 };
15443  
15444                 i2c@3000 {
15445 -                       device_type = "i2c";
15446 +                       #address-cells = <1>;
15447 +                       #size-cells = <0>;
15448 +                       cell-index = <0>;
15449                         compatible = "fsl-i2c";
15450                         reg = <3000 100>;
15451                         interrupts = <2b 2>;
15452 @@ -74,9 +85,9 @@
15453                 mdio@24520 {
15454                         #address-cells = <1>;
15455                         #size-cells = <0>;
15456 -                       device_type = "mdio";
15457 -                       compatible = "gianfar";
15458 +                       compatible = "fsl,gianfar-mdio";
15459                         reg = <24520 20>;
15460 +
15461                         phy0: ethernet-phy@0 {
15462                                 interrupt-parent = <&mpic>;
15463                                 interrupts = <5 1>;
15464 @@ -97,64 +108,44 @@
15465                         };
15466                 };
15467  
15468 -               ethernet@24000 {
15469 -                       #address-cells = <1>;
15470 -                       #size-cells = <0>;
15471 +               enet0: ethernet@24000 {
15472 +                       cell-index = <0>;
15473                         device_type = "network";
15474                         model = "TSEC";
15475                         compatible = "gianfar";
15476                         reg = <24000 1000>;
15477 -                       /*
15478 -                        * address is deprecated and will be removed
15479 -                        * in 2.6.25.  Only recent versions of
15480 -                        * U-Boot support local-mac-address, however.
15481 -                        */
15482 -                       address = [ 00 00 00 00 00 00 ];
15483                         local-mac-address = [ 00 00 00 00 00 00 ];
15484                         interrupts = <1d 2 1e 2 22 2>;
15485                         interrupt-parent = <&mpic>;
15486                         phy-handle = <&phy0>;
15487                 };
15488  
15489 -               ethernet@25000 {
15490 -                       #address-cells = <1>;
15491 -                       #size-cells = <0>;
15492 +               enet1: ethernet@25000 {
15493 +                       cell-index = <1>;
15494                         device_type = "network";
15495                         model = "TSEC";
15496                         compatible = "gianfar";
15497                         reg = <25000 1000>;
15498 -                       /*
15499 -                        * address is deprecated and will be removed
15500 -                        * in 2.6.25.  Only recent versions of
15501 -                        * U-Boot support local-mac-address, however.
15502 -                        */
15503 -                       address = [ 00 00 00 00 00 00 ];
15504                         local-mac-address = [ 00 00 00 00 00 00 ];
15505                         interrupts = <23 2 24 2 28 2>;
15506                         interrupt-parent = <&mpic>;
15507                         phy-handle = <&phy1>;
15508                 };
15509  
15510 -               ethernet@26000 {
15511 -                       #address-cells = <1>;
15512 -                       #size-cells = <0>;
15513 +               enet2: ethernet@26000 {
15514 +                       cell-index = <2>;
15515                         device_type = "network";
15516                         model = "FEC";
15517                         compatible = "gianfar";
15518                         reg = <26000 1000>;
15519 -                       /*
15520 -                        * address is deprecated and will be removed
15521 -                        * in 2.6.25.  Only recent versions of
15522 -                        * U-Boot support local-mac-address, however.
15523 -                        */
15524 -                       address = [ 00 00 00 00 00 00 ];
15525                         local-mac-address = [ 00 00 00 00 00 00 ];
15526                         interrupts = <29 2>;
15527                         interrupt-parent = <&mpic>;
15528                         phy-handle = <&phy3>;
15529                 };
15530  
15531 -               serial@4500 {
15532 +               serial0: serial@4500 {
15533 +                       cell-index = <0>;
15534                         device_type = "serial";
15535                         compatible = "ns16550";
15536                         reg = <4500 100>;       // reg base, size
15537 @@ -163,7 +154,8 @@
15538                         interrupt-parent = <&mpic>;
15539                 };
15540  
15541 -               serial@4600 {
15542 +               serial1: serial@4600 {
15543 +                       cell-index = <1>;
15544                         device_type = "serial";
15545                         compatible = "ns16550";
15546                         reg = <4600 100>;       // reg base, size
15547 @@ -183,7 +175,8 @@
15548                 };
15549         };
15550  
15551 -       pci@e0008000 {
15552 +       pci0: pci@e0008000 {
15553 +               cell-index = <0>;
15554                 interrupt-map-mask = <f800 0 0 7>;
15555                 interrupt-map = <
15556  
15557 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8541cds.dts
15558 ===================================================================
15559 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8541cds.dts
15560 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8541cds.dts
15561 @@ -16,6 +16,15 @@
15562         #address-cells = <1>;
15563         #size-cells = <1>;
15564  
15565 +       aliases {
15566 +               ethernet0 = &enet0;
15567 +               ethernet1 = &enet1;
15568 +               serial0 = &serial0;
15569 +               serial1 = &serial1;
15570 +               pci0 = &pci0;
15571 +               pci1 = &pci1;
15572 +       };
15573 +
15574         cpus {
15575                 #address-cells = <1>;
15576                 #size-cells = <0>;
15577 @@ -63,7 +72,9 @@
15578                 };
15579  
15580                 i2c@3000 {
15581 -                       device_type = "i2c";
15582 +                       #address-cells = <1>;
15583 +                       #size-cells = <0>;
15584 +                       cell-index = <0>;
15585                         compatible = "fsl-i2c";
15586                         reg = <3000 100>;
15587                         interrupts = <2b 2>;
15588 @@ -74,9 +85,9 @@
15589                 mdio@24520 {
15590                         #address-cells = <1>;
15591                         #size-cells = <0>;
15592 -                       device_type = "mdio";
15593 -                       compatible = "gianfar";
15594 +                       compatible = "fsl,gianfar-mdio";
15595                         reg = <24520 20>;
15596 +
15597                         phy0: ethernet-phy@0 {
15598                                 interrupt-parent = <&mpic>;
15599                                 interrupts = <5 1>;
15600 @@ -91,9 +102,8 @@
15601                         };
15602                 };
15603  
15604 -               ethernet@24000 {
15605 -                       #address-cells = <1>;
15606 -                       #size-cells = <0>;
15607 +               enet0: ethernet@24000 {
15608 +                       cell-index = <0>;
15609                         device_type = "network";
15610                         model = "TSEC";
15611                         compatible = "gianfar";
15612 @@ -104,9 +114,8 @@
15613                         phy-handle = <&phy0>;
15614                 };
15615  
15616 -               ethernet@25000 {
15617 -                       #address-cells = <1>;
15618 -                       #size-cells = <0>;
15619 +               enet1: ethernet@25000 {
15620 +                       cell-index = <1>;
15621                         device_type = "network";
15622                         model = "TSEC";
15623                         compatible = "gianfar";
15624 @@ -117,7 +126,8 @@
15625                         phy-handle = <&phy1>;
15626                 };
15627  
15628 -               serial@4500 {
15629 +               serial0: serial@4500 {
15630 +                       cell-index = <0>;
15631                         device_type = "serial";
15632                         compatible = "ns16550";
15633                         reg = <4500 100>;       // reg base, size
15634 @@ -126,7 +136,8 @@
15635                         interrupt-parent = <&mpic>;
15636                 };
15637  
15638 -               serial@4600 {
15639 +               serial1: serial@4600 {
15640 +                       cell-index = <1>;
15641                         device_type = "serial";
15642                         compatible = "ns16550";
15643                         reg = <4600 100>;       // reg base, size
15644 @@ -183,7 +194,8 @@
15645                 };
15646         };
15647  
15648 -       pci1: pci@e0008000 {
15649 +       pci0: pci@e0008000 {
15650 +               cell-index = <0>;
15651                 interrupt-map-mask = <1f800 0 0 7>;
15652                 interrupt-map = <
15653  
15654 @@ -250,11 +262,12 @@
15655                         #interrupt-cells = <2>;
15656                         compatible = "chrp,iic";
15657                         interrupts = <1>;
15658 -                       interrupt-parent = <&pci1>;
15659 +                       interrupt-parent = <&pci0>;
15660                 };
15661         };
15662  
15663 -       pci@e0009000 {
15664 +       pci1: pci@e0009000 {
15665 +               cell-index = <1>;
15666                 interrupt-map-mask = <f800 0 0 7>;
15667                 interrupt-map = <
15668  
15669 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8544ds.dts
15670 ===================================================================
15671 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8544ds.dts
15672 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8544ds.dts
15673 @@ -15,6 +15,17 @@
15674         #address-cells = <1>;
15675         #size-cells = <1>;
15676  
15677 +       aliases {
15678 +               ethernet0 = &enet0;
15679 +               ethernet1 = &enet1;
15680 +               serial0 = &serial0;
15681 +               serial1 = &serial1;
15682 +               pci0 = &pci0;
15683 +               pci1 = &pci1;
15684 +               pci2 = &pci2;
15685 +               pci3 = &pci3;
15686 +       };
15687 +
15688         cpus {
15689                 #cpus = <1>;
15690                 #address-cells = <1>;
15691 @@ -64,7 +75,9 @@
15692                 };
15693  
15694                 i2c@3000 {
15695 -                       device_type = "i2c";
15696 +                       #address-cells = <1>;
15697 +                       #size-cells = <0>;
15698 +                       cell-index = <0>;
15699                         compatible = "fsl-i2c";
15700                         reg = <3000 100>;
15701                         interrupts = <2b 2>;
15702 @@ -72,12 +85,23 @@
15703                         dfsrr;
15704                 };
15705  
15706 +               i2c@3100 {
15707 +                       #address-cells = <1>;
15708 +                       #size-cells = <0>;
15709 +                       cell-index = <1>;
15710 +                       compatible = "fsl-i2c";
15711 +                       reg = <3100 100>;
15712 +                       interrupts = <2b 2>;
15713 +                       interrupt-parent = <&mpic>;
15714 +                       dfsrr;
15715 +               };
15716 +
15717                 mdio@24520 {
15718                         #address-cells = <1>;
15719                         #size-cells = <0>;
15720 -                       device_type = "mdio";
15721 -                       compatible = "gianfar";
15722 +                       compatible = "fsl,gianfar-mdio";
15723                         reg = <24520 20>;
15724 +
15725                         phy0: ethernet-phy@0 {
15726                                 interrupt-parent = <&mpic>;
15727                                 interrupts = <a 1>;
15728 @@ -92,9 +116,8 @@
15729                         };
15730                 };
15731  
15732 -               ethernet@24000 {
15733 -                       #address-cells = <1>;
15734 -                       #size-cells = <0>;
15735 +               enet0: ethernet@24000 {
15736 +                       cell-index = <0>;
15737                         device_type = "network";
15738                         model = "TSEC";
15739                         compatible = "gianfar";
15740 @@ -106,9 +129,8 @@
15741                         phy-connection-type = "rgmii-id";
15742                 };
15743  
15744 -               ethernet@26000 {
15745 -                       #address-cells = <1>;
15746 -                       #size-cells = <0>;
15747 +               enet1: ethernet@26000 {
15748 +                       cell-index = <1>;
15749                         device_type = "network";
15750                         model = "TSEC";
15751                         compatible = "gianfar";
15752 @@ -120,7 +142,8 @@
15753                         phy-connection-type = "rgmii-id";
15754                 };
15755  
15756 -               serial@4500 {
15757 +               serial0: serial@4500 {
15758 +                       cell-index = <0>;
15759                         device_type = "serial";
15760                         compatible = "ns16550";
15761                         reg = <4500 100>;
15762 @@ -129,7 +152,8 @@
15763                         interrupt-parent = <&mpic>;
15764                 };
15765  
15766 -               serial@4600 {
15767 +               serial1: serial@4600 {
15768 +                       cell-index = <1>;
15769                         device_type = "serial";
15770                         compatible = "ns16550";
15771                         reg = <4600 100>;
15772 @@ -156,7 +180,8 @@
15773                 };
15774         };
15775  
15776 -       pci@e0008000 {
15777 +       pci0: pci@e0008000 {
15778 +               cell-index = <0>;
15779                 compatible = "fsl,mpc8540-pci";
15780                 device_type = "pci";
15781                 interrupt-map-mask = <f800 0 0 7>;
15782 @@ -187,7 +212,8 @@
15783                 reg = <e0008000 1000>;
15784         };
15785  
15786 -       pcie@e0009000 {
15787 +       pci1: pcie@e0009000 {
15788 +               cell-index = <1>;
15789                 compatible = "fsl,mpc8548-pcie";
15790                 device_type = "pci";
15791                 #interrupt-cells = <1>;
15792 @@ -223,7 +249,8 @@
15793                 };
15794         };
15795  
15796 -       pcie@e000a000 {
15797 +       pci2: pcie@e000a000 {
15798 +               cell-index = <2>;
15799                 compatible = "fsl,mpc8548-pcie";
15800                 device_type = "pci";
15801                 #interrupt-cells = <1>;
15802 @@ -259,7 +286,8 @@
15803                 };
15804         };
15805  
15806 -       pcie@e000b000 {
15807 +       pci3: pcie@e000b000 {
15808 +               cell-index = <3>;
15809                 compatible = "fsl,mpc8548-pcie";
15810                 device_type = "pci";
15811                 #interrupt-cells = <1>;
15812 @@ -276,9 +304,9 @@
15813                 interrupt-map = <
15814                         // IDSEL 0x1c  USB
15815                         e000 0 0 1 &i8259 c 2
15816 -                       e100 0 0 1 &i8259 9 2
15817 -                       e200 0 0 1 &i8259 a 2
15818 -                       e300 0 0 1 &i8259 b 2
15819 +                       e100 0 0 2 &i8259 9 2
15820 +                       e200 0 0 3 &i8259 a 2
15821 +                       e300 0 0 4 &i8259 b 2
15822  
15823                         // IDSEL 0x1d  Audio
15824                         e800 0 0 1 &i8259 6 2
15825 @@ -369,6 +397,5 @@
15826                                 };
15827                         };
15828                 };
15829 -
15830         };
15831  };
15832 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8548cds.dts
15833 ===================================================================
15834 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8548cds.dts
15835 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8548cds.dts
15836 @@ -16,6 +16,20 @@
15837         #address-cells = <1>;
15838         #size-cells = <1>;
15839  
15840 +       aliases {
15841 +               ethernet0 = &enet0;
15842 +               ethernet1 = &enet1;
15843 +/*
15844 +               ethernet2 = &enet2;
15845 +               ethernet3 = &enet3;
15846 +*/
15847 +               serial0 = &serial0;
15848 +               serial1 = &serial1;
15849 +               pci0 = &pci0;
15850 +               pci1 = &pci1;
15851 +               pci2 = &pci2;
15852 +       };
15853 +
15854         cpus {
15855                 #address-cells = <1>;
15856                 #size-cells = <0>;
15857 @@ -63,7 +77,9 @@
15858                 };
15859  
15860                 i2c@3000 {
15861 -                       device_type = "i2c";
15862 +                       #address-cells = <1>;
15863 +                       #size-cells = <0>;
15864 +                       cell-index = <0>;
15865                         compatible = "fsl-i2c";
15866                         reg = <3000 100>;
15867                         interrupts = <2b 2>;
15868 @@ -71,12 +87,23 @@
15869                         dfsrr;
15870                 };
15871  
15872 +               i2c@3100 {
15873 +                       #address-cells = <1>;
15874 +                       #size-cells = <0>;
15875 +                       cell-index = <1>;
15876 +                       compatible = "fsl-i2c";
15877 +                       reg = <3100 100>;
15878 +                       interrupts = <2b 2>;
15879 +                       interrupt-parent = <&mpic>;
15880 +                       dfsrr;
15881 +               };
15882 +
15883                 mdio@24520 {
15884                         #address-cells = <1>;
15885                         #size-cells = <0>;
15886 -                       device_type = "mdio";
15887 -                       compatible = "gianfar";
15888 +                       compatible = "fsl,gianfar-mdio";
15889                         reg = <24520 20>;
15890 +
15891                         phy0: ethernet-phy@0 {
15892                                 interrupt-parent = <&mpic>;
15893                                 interrupts = <5 1>;
15894 @@ -103,9 +130,8 @@
15895                         };
15896                 };
15897  
15898 -               ethernet@24000 {
15899 -                       #address-cells = <1>;
15900 -                       #size-cells = <0>;
15901 +               enet0: ethernet@24000 {
15902 +                       cell-index = <0>;
15903                         device_type = "network";
15904                         model = "eTSEC";
15905                         compatible = "gianfar";
15906 @@ -116,9 +142,8 @@
15907                         phy-handle = <&phy0>;
15908                 };
15909  
15910 -               ethernet@25000 {
15911 -                       #address-cells = <1>;
15912 -                       #size-cells = <0>;
15913 +               enet1: ethernet@25000 {
15914 +                       cell-index = <1>;
15915                         device_type = "network";
15916                         model = "eTSEC";
15917                         compatible = "gianfar";
15918 @@ -130,9 +155,8 @@
15919                 };
15920  
15921  /* eTSEC 3/4 are currently broken
15922 -               ethernet@26000 {
15923 -                       #address-cells = <1>;
15924 -                       #size-cells = <0>;
15925 +               enet2: ethernet@26000 {
15926 +                       cell-index = <2>;
15927                         device_type = "network";
15928                         model = "eTSEC";
15929                         compatible = "gianfar";
15930 @@ -143,9 +167,8 @@
15931                         phy-handle = <&phy2>;
15932                 };
15933  
15934 -               ethernet@27000 {
15935 -                       #address-cells = <1>;
15936 -                       #size-cells = <0>;
15937 +               enet3: ethernet@27000 {
15938 +                       cell-index = <3>;
15939                         device_type = "network";
15940                         model = "eTSEC";
15941                         compatible = "gianfar";
15942 @@ -157,7 +180,8 @@
15943                 };
15944   */
15945  
15946 -               serial@4500 {
15947 +               serial0: serial@4500 {
15948 +                       cell-index = <0>;
15949                         device_type = "serial";
15950                         compatible = "ns16550";
15951                         reg = <4500 100>;       // reg base, size
15952 @@ -166,7 +190,8 @@
15953                         interrupt-parent = <&mpic>;
15954                 };
15955  
15956 -               serial@4600 {
15957 +               serial1: serial@4600 {
15958 +                       cell-index = <1>;
15959                         device_type = "serial";
15960                         compatible = "ns16550";
15961                         reg = <4600 100>;       // reg base, size
15962 @@ -193,7 +218,8 @@
15963                 };
15964         };
15965  
15966 -       pci@e0008000 {
15967 +       pci0: pci@e0008000 {
15968 +               cell-index = <0>;
15969                 interrupt-map-mask = <f800 0 0 7>;
15970                 interrupt-map = <
15971                         /* IDSEL 0x4 (PCIX Slot 2) */
15972 @@ -342,7 +368,8 @@
15973                 };
15974         };
15975  
15976 -       pci@e0009000 {
15977 +       pci1: pci@e0009000 {
15978 +               cell-index = <1>;
15979                 interrupt-map-mask = <f800 0 0 7>;
15980                 interrupt-map = <
15981  
15982 @@ -366,7 +393,8 @@
15983                 device_type = "pci";
15984         };
15985  
15986 -       pcie@e000a000 {
15987 +       pci2: pcie@e000a000 {
15988 +               cell-index = <2>;
15989                 interrupt-map-mask = <f800 0 0 7>;
15990                 interrupt-map = <
15991  
15992 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8555cds.dts
15993 ===================================================================
15994 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8555cds.dts
15995 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8555cds.dts
15996 @@ -16,6 +16,15 @@
15997         #address-cells = <1>;
15998         #size-cells = <1>;
15999  
16000 +       aliases {
16001 +               ethernet0 = &enet0;
16002 +               ethernet1 = &enet1;
16003 +               serial0 = &serial0;
16004 +               serial1 = &serial1;
16005 +               pci0 = &pci0;
16006 +               pci1 = &pci1;
16007 +       };
16008 +
16009         cpus {
16010                 #address-cells = <1>;
16011                 #size-cells = <0>;
16012 @@ -63,7 +72,9 @@
16013                 };
16014  
16015                 i2c@3000 {
16016 -                       device_type = "i2c";
16017 +                       #address-cells = <1>;
16018 +                       #size-cells = <0>;
16019 +                       cell-index = <0>;
16020                         compatible = "fsl-i2c";
16021                         reg = <3000 100>;
16022                         interrupts = <2b 2>;
16023 @@ -74,9 +85,9 @@
16024                 mdio@24520 {
16025                         #address-cells = <1>;
16026                         #size-cells = <0>;
16027 -                       device_type = "mdio";
16028 -                       compatible = "gianfar";
16029 +                       compatible = "fsl,gianfar-mdio";
16030                         reg = <24520 20>;
16031 +
16032                         phy0: ethernet-phy@0 {
16033                                 interrupt-parent = <&mpic>;
16034                                 interrupts = <5 1>;
16035 @@ -91,9 +102,8 @@
16036                         };
16037                 };
16038  
16039 -               ethernet@24000 {
16040 -                       #address-cells = <1>;
16041 -                       #size-cells = <0>;
16042 +               enet0: ethernet@24000 {
16043 +                       cell-index = <0>;
16044                         device_type = "network";
16045                         model = "TSEC";
16046                         compatible = "gianfar";
16047 @@ -104,9 +114,8 @@
16048                         phy-handle = <&phy0>;
16049                 };
16050  
16051 -               ethernet@25000 {
16052 -                       #address-cells = <1>;
16053 -                       #size-cells = <0>;
16054 +               enet1: ethernet@25000 {
16055 +                       cell-index = <1>;
16056                         device_type = "network";
16057                         model = "TSEC";
16058                         compatible = "gianfar";
16059 @@ -117,7 +126,8 @@
16060                         phy-handle = <&phy1>;
16061                 };
16062  
16063 -               serial@4500 {
16064 +               serial0: serial@4500 {
16065 +                       cell-index = <0>;
16066                         device_type = "serial";
16067                         compatible = "ns16550";
16068                         reg = <4500 100>;       // reg base, size
16069 @@ -126,7 +136,8 @@
16070                         interrupt-parent = <&mpic>;
16071                 };
16072  
16073 -               serial@4600 {
16074 +               serial1: serial@4600 {
16075 +                       cell-index = <1>;
16076                         device_type = "serial";
16077                         compatible = "ns16550";
16078                         reg = <4600 100>;       // reg base, size
16079 @@ -183,7 +194,8 @@
16080                 };
16081         };
16082  
16083 -       pci1: pci@e0008000 {
16084 +       pci0: pci@e0008000 {
16085 +               cell-index = <0>;
16086                 interrupt-map-mask = <1f800 0 0 7>;
16087                 interrupt-map = <
16088  
16089 @@ -250,11 +262,12 @@
16090                         #interrupt-cells = <2>;
16091                         compatible = "chrp,iic";
16092                         interrupts = <1>;
16093 -                       interrupt-parent = <&pci1>;
16094 +                       interrupt-parent = <&pci0>;
16095                 };
16096         };
16097  
16098 -       pci@e0009000 {
16099 +       pci1: pci@e0009000 {
16100 +               cell-index = <1>;
16101                 interrupt-map-mask = <f800 0 0 7>;
16102                 interrupt-map = <
16103  
16104 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8560ads.dts
16105 ===================================================================
16106 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8560ads.dts
16107 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8560ads.dts
16108 @@ -16,6 +16,16 @@
16109         #address-cells = <1>;
16110         #size-cells = <1>;
16111  
16112 +       aliases {
16113 +               ethernet0 = &enet0;
16114 +               ethernet1 = &enet1;
16115 +               ethernet2 = &enet2;
16116 +               ethernet3 = &enet3;
16117 +               serial0 = &serial0;
16118 +               serial1 = &serial1;
16119 +               pci0 = &pci0;
16120 +       };
16121 +
16122         cpus {
16123                 #address-cells = <1>;
16124                 #size-cells = <0>;
16125 @@ -63,11 +73,11 @@
16126                 };
16127  
16128                 mdio@24520 {
16129 -                       device_type = "mdio";
16130 -                       compatible = "gianfar";
16131 -                       reg = <24520 20>;
16132                         #address-cells = <1>;
16133                         #size-cells = <0>;
16134 +                       compatible = "fsl,gianfar-mdio";
16135 +                       reg = <24520 20>;
16136 +
16137                         phy0: ethernet-phy@0 {
16138                                 interrupt-parent = <&mpic>;
16139                                 interrupts = <5 1>;
16140 @@ -94,36 +104,24 @@
16141                         };
16142                 };
16143  
16144 -               ethernet@24000 {
16145 +               enet0: ethernet@24000 {
16146 +                       cell-index = <0>;
16147                         device_type = "network";
16148                         model = "TSEC";
16149                         compatible = "gianfar";
16150                         reg = <24000 1000>;
16151 -                       /*
16152 -                        * address is deprecated and will be removed
16153 -                        * in 2.6.25.  Only recent versions of
16154 -                        * U-Boot support local-mac-address, however.
16155 -                        */
16156 -                       address = [ 00 00 00 00 00 00 ];
16157                         local-mac-address = [ 00 00 00 00 00 00 ];
16158                         interrupts = <1d 2 1e 2 22 2>;
16159                         interrupt-parent = <&mpic>;
16160                         phy-handle = <&phy0>;
16161                 };
16162  
16163 -               ethernet@25000 {
16164 -                       #address-cells = <1>;
16165 -                       #size-cells = <0>;
16166 +               enet1: ethernet@25000 {
16167 +                       cell-index = <1>;
16168                         device_type = "network";
16169                         model = "TSEC";
16170                         compatible = "gianfar";
16171                         reg = <25000 1000>;
16172 -                       /*
16173 -                        * address is deprecated and will be removed
16174 -                        * in 2.6.25.  Only recent versions of
16175 -                        * U-Boot support local-mac-address, however.
16176 -                        */
16177 -                       address = [ 00 00 00 00 00 00 ];
16178                         local-mac-address = [ 00 00 00 00 00 00 ];
16179                         interrupts = <23 2 24 2 28 2>;
16180                         interrupt-parent = <&mpic>;
16181 @@ -174,7 +172,7 @@
16182                                 compatible = "fsl,mpc8560-cpm-pic", "fsl,cpm2-pic";
16183                         };
16184  
16185 -                       serial@91a00 {
16186 +                       serial0: serial@91a00 {
16187                                 device_type = "serial";
16188                                 compatible = "fsl,mpc8560-scc-uart",
16189                                              "fsl,cpm2-scc-uart";
16190 @@ -186,7 +184,7 @@
16191                                 interrupt-parent = <&cpmpic>;
16192                         };
16193  
16194 -                       serial@91a20 {
16195 +                       serial1: serial@91a20 {
16196                                 device_type = "serial";
16197                                 compatible = "fsl,mpc8560-scc-uart",
16198                                              "fsl,cpm2-scc-uart";
16199 @@ -198,17 +196,11 @@
16200                                 interrupt-parent = <&cpmpic>;
16201                         };
16202  
16203 -                       ethernet@91320 {
16204 +                       enet2: ethernet@91320 {
16205                                 device_type = "network";
16206                                 compatible = "fsl,mpc8560-fcc-enet",
16207                                              "fsl,cpm2-fcc-enet";
16208                                 reg = <91320 20 88500 100 913b0 1>;
16209 -                               /*
16210 -                                * mac-address is deprecated and will be removed
16211 -                                * in 2.6.25.  Only recent versions of
16212 -                                * U-Boot support local-mac-address, however.
16213 -                                */
16214 -                               mac-address = [ 00 00 00 00 00 00 ];
16215                                 local-mac-address = [ 00 00 00 00 00 00 ];
16216                                 fsl,cpm-command = <16200300>;
16217                                 interrupts = <21 8>;
16218 @@ -216,17 +208,11 @@
16219                                 phy-handle = <&phy2>;
16220                         };
16221  
16222 -                       ethernet@91340 {
16223 +                       enet3: ethernet@91340 {
16224                                 device_type = "network";
16225                                 compatible = "fsl,mpc8560-fcc-enet",
16226                                              "fsl,cpm2-fcc-enet";
16227                                 reg = <91340 20 88600 100 913d0 1>;
16228 -                               /*
16229 -                                * mac-address is deprecated and will be removed
16230 -                                * in 2.6.25.  Only recent versions of
16231 -                                * U-Boot support local-mac-address, however.
16232 -                                */
16233 -                               mac-address = [ 00 00 00 00 00 00 ];
16234                                 local-mac-address = [ 00 00 00 00 00 00 ];
16235                                 fsl,cpm-command = <1a400300>;
16236                                 interrupts = <22 8>;
16237 @@ -236,7 +222,8 @@
16238                 };
16239         };
16240  
16241 -       pci@e0008000 {
16242 +       pci0: pci@e0008000 {
16243 +               cell-index = <0>;
16244                 #interrupt-cells = <1>;
16245                 #size-cells = <2>;
16246                 #address-cells = <3>;
16247 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8568mds.dts
16248 ===================================================================
16249 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8568mds.dts
16250 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8568mds.dts
16251 @@ -20,6 +20,17 @@
16252         #address-cells = <1>;
16253         #size-cells = <1>;
16254  
16255 +       aliases {
16256 +               ethernet0 = &enet0;
16257 +               ethernet1 = &enet1;
16258 +               ethernet2 = &enet2;
16259 +               ethernet3 = &enet3;
16260 +               serial0 = &serial0;
16261 +               serial1 = &serial1;
16262 +               pci0 = &pci0;
16263 +               pci1 = &pci1;
16264 +       };
16265 +
16266         cpus {
16267                 #address-cells = <1>;
16268                 #size-cells = <0>;
16269 @@ -74,7 +85,7 @@
16270                 i2c@3000 {
16271                         #address-cells = <1>;
16272                         #size-cells = <0>;
16273 -                       device_type = "i2c";
16274 +                       cell-index = <0>;
16275                         compatible = "fsl-i2c";
16276                         reg = <3000 100>;
16277                         interrupts = <2b 2>;
16278 @@ -90,7 +101,7 @@
16279                 i2c@3100 {
16280                         #address-cells = <1>;
16281                         #size-cells = <0>;
16282 -                       device_type = "i2c";
16283 +                       cell-index = <1>;
16284                         compatible = "fsl-i2c";
16285                         reg = <3100 100>;
16286                         interrupts = <2b 2>;
16287 @@ -101,9 +112,9 @@
16288                 mdio@24520 {
16289                         #address-cells = <1>;
16290                         #size-cells = <0>;
16291 -                       device_type = "mdio";
16292 -                       compatible = "gianfar";
16293 +                       compatible = "fsl,gianfar-mdio";
16294                         reg = <24520 20>;
16295 +
16296                         phy0: ethernet-phy@7 {
16297                                 interrupt-parent = <&mpic>;
16298                                 interrupts = <1 1>;
16299 @@ -130,45 +141,32 @@
16300                         };
16301                 };
16302  
16303 -               ethernet@24000 {
16304 -                       #address-cells = <1>;
16305 -                       #size-cells = <0>;
16306 +               enet0: ethernet@24000 {
16307 +                       cell-index = <0>;
16308                         device_type = "network";
16309                         model = "eTSEC";
16310                         compatible = "gianfar";
16311                         reg = <24000 1000>;
16312 -                       /*
16313 -                        * mac-address is deprecated and will be removed
16314 -                        * in 2.6.25.  Only recent versions of
16315 -                        * U-Boot support local-mac-address, however.
16316 -                        */
16317 -                       mac-address = [ 00 00 00 00 00 00 ];
16318                         local-mac-address = [ 00 00 00 00 00 00 ];
16319                         interrupts = <1d 2 1e 2 22 2>;
16320                         interrupt-parent = <&mpic>;
16321                         phy-handle = <&phy2>;
16322                 };
16323  
16324 -               ethernet@25000 {
16325 -                       #address-cells = <1>;
16326 -                       #size-cells = <0>;
16327 +               enet1: ethernet@25000 {
16328 +                       cell-index = <1>;
16329                         device_type = "network";
16330                         model = "eTSEC";
16331                         compatible = "gianfar";
16332                         reg = <25000 1000>;
16333 -                       /*
16334 -                        * mac-address is deprecated and will be removed
16335 -                        * in 2.6.25.  Only recent versions of
16336 -                        * U-Boot support local-mac-address, however.
16337 -                        */
16338 -                       mac-address = [ 00 00 00 00 00 00 ];
16339                         local-mac-address = [ 00 00 00 00 00 00 ];
16340                         interrupts = <23 2 24 2 28 2>;
16341                         interrupt-parent = <&mpic>;
16342                         phy-handle = <&phy3>;
16343                 };
16344  
16345 -               serial@4500 {
16346 +               serial0: serial@4500 {
16347 +                       cell-index = <0>;
16348                         device_type = "serial";
16349                         compatible = "ns16550";
16350                         reg = <4500 100>;
16351 @@ -183,7 +181,8 @@
16352                         fsl,has-rstcr;
16353                 };
16354  
16355 -               serial@4600 {
16356 +               serial1: serial@4600 {
16357 +                       cell-index = <1>;
16358                         device_type = "serial";
16359                         compatible = "ns16550";
16360                         reg = <4600 100>;
16361 @@ -318,45 +317,35 @@
16362                         mode = "cpu";
16363                 };
16364  
16365 -               ucc@2000 {
16366 +               enet2: ucc@2000 {
16367                         device_type = "network";
16368                         compatible = "ucc_geth";
16369                         model = "UCC";
16370 +                       cell-index = <1>;
16371                         device-id = <1>;
16372                         reg = <2000 200>;
16373                         interrupts = <20>;
16374                         interrupt-parent = <&qeic>;
16375 -                       /*
16376 -                        * mac-address is deprecated and will be removed
16377 -                        * in 2.6.25.  Only recent versions of
16378 -                        * U-Boot support local-mac-address, however.
16379 -                        */
16380 -                       mac-address = [ 00 00 00 00 00 00 ];
16381                         local-mac-address = [ 00 00 00 00 00 00 ];
16382 -                       rx-clock = <0>;
16383 -                       tx-clock = <20>;
16384 +                       rx-clock-name = "none";
16385 +                       tx-clock-name = "clk16";
16386                         pio-handle = <&pio1>;
16387                         phy-handle = <&phy0>;
16388                         phy-connection-type = "rgmii-id";
16389                 };
16390  
16391 -               ucc@3000 {
16392 +               enet3: ucc@3000 {
16393                         device_type = "network";
16394                         compatible = "ucc_geth";
16395                         model = "UCC";
16396 +                       cell-index = <2>;
16397                         device-id = <2>;
16398                         reg = <3000 200>;
16399                         interrupts = <21>;
16400                         interrupt-parent = <&qeic>;
16401 -                       /*
16402 -                        * mac-address is deprecated and will be removed
16403 -                        * in 2.6.25.  Only recent versions of
16404 -                        * U-Boot support local-mac-address, however.
16405 -                        */
16406 -                       mac-address = [ 00 00 00 00 00 00 ];
16407                         local-mac-address = [ 00 00 00 00 00 00 ];
16408 -                       rx-clock = <0>;
16409 -                       tx-clock = <20>;
16410 +                       rx-clock-name = "none";
16411 +                       tx-clock-name = "clk16";
16412                         pio-handle = <&pio2>;
16413                         phy-handle = <&phy1>;
16414                         phy-connection-type = "rgmii-id";
16415 @@ -366,7 +355,6 @@
16416                         #address-cells = <1>;
16417                         #size-cells = <0>;
16418                         reg = <2120 18>;
16419 -                       device_type = "mdio";
16420                         compatible = "ucc_geth_phy";
16421  
16422                         /* These are the same PHYs as on
16423 @@ -410,7 +398,8 @@
16424  
16425         };
16426  
16427 -       pci@e0008000 {
16428 +       pci0: pci@e0008000 {
16429 +               cell-index = <0>;
16430                 interrupt-map-mask = <f800 0 0 7>;
16431                 interrupt-map = <
16432                         /* IDSEL 0x12 AD18 */
16433 @@ -440,7 +429,8 @@
16434         };
16435  
16436         /* PCI Express */
16437 -       pcie@e000a000 {
16438 +       pci1: pcie@e000a000 {
16439 +               cell-index = <2>;
16440                 interrupt-map-mask = <f800 0 0 7>;
16441                 interrupt-map = <
16442  
16443 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8572ds.dts
16444 ===================================================================
16445 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8572ds.dts
16446 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8572ds.dts
16447 @@ -15,6 +15,18 @@
16448         #address-cells = <1>;
16449         #size-cells = <1>;
16450  
16451 +       aliases {
16452 +               ethernet0 = &enet0;
16453 +               ethernet1 = &enet1;
16454 +               ethernet2 = &enet2;
16455 +               ethernet3 = &enet3;
16456 +               serial0 = &serial0;
16457 +               serial1 = &serial1;
16458 +               pci0 = &pci0;
16459 +               pci1 = &pci1;
16460 +               pci2 = &pci2;
16461 +       };
16462 +
16463         cpus {
16464                 #address-cells = <1>;
16465                 #size-cells = <0>;
16466 @@ -69,7 +81,9 @@
16467                 };
16468  
16469                 i2c@3000 {
16470 -                       device_type = "i2c";
16471 +                       #address-cells = <1>;
16472 +                       #size-cells = <0>;
16473 +                       cell-index = <0>;
16474                         compatible = "fsl-i2c";
16475                         reg = <3000 100>;
16476                         interrupts = <2b 2>;
16477 @@ -78,7 +92,9 @@
16478                 };
16479  
16480                 i2c@3100 {
16481 -                       device_type = "i2c";
16482 +                       #address-cells = <1>;
16483 +                       #size-cells = <0>;
16484 +                       cell-index = <1>;
16485                         compatible = "fsl-i2c";
16486                         reg = <3100 100>;
16487                         interrupts = <2b 2>;
16488 @@ -89,9 +105,9 @@
16489                 mdio@24520 {
16490                         #address-cells = <1>;
16491                         #size-cells = <0>;
16492 -                       device_type = "mdio";
16493 -                       compatible = "gianfar";
16494 +                       compatible = "fsl,gianfar-mdio";
16495                         reg = <24520 20>;
16496 +
16497                         phy0: ethernet-phy@0 {
16498                                 interrupt-parent = <&mpic>;
16499                                 interrupts = <a 1>;
16500 @@ -114,9 +130,8 @@
16501                         };
16502                 };
16503  
16504 -               ethernet@24000 {
16505 -                       #address-cells = <1>;
16506 -                       #size-cells = <0>;
16507 +               enet0: ethernet@24000 {
16508 +                       cell-index = <0>;
16509                         device_type = "network";
16510                         model = "eTSEC";
16511                         compatible = "gianfar";
16512 @@ -128,9 +143,8 @@
16513                         phy-connection-type = "rgmii-id";
16514                 };
16515  
16516 -               ethernet@25000 {
16517 -                       #address-cells = <1>;
16518 -                       #size-cells = <0>;
16519 +               enet1: ethernet@25000 {
16520 +                       cell-index = <1>;
16521                         device_type = "network";
16522                         model = "eTSEC";
16523                         compatible = "gianfar";
16524 @@ -142,9 +156,8 @@
16525                         phy-connection-type = "rgmii-id";
16526                 };
16527  
16528 -               ethernet@26000 {
16529 -                       #address-cells = <1>;
16530 -                       #size-cells = <0>;
16531 +               enet2: ethernet@26000 {
16532 +                       cell-index = <2>;
16533                         device_type = "network";
16534                         model = "eTSEC";
16535                         compatible = "gianfar";
16536 @@ -156,9 +169,8 @@
16537                         phy-connection-type = "rgmii-id";
16538                 };
16539  
16540 -               ethernet@27000 {
16541 -                       #address-cells = <1>;
16542 -                       #size-cells = <0>;
16543 +               enet3: ethernet@27000 {
16544 +                       cell-index = <3>;
16545                         device_type = "network";
16546                         model = "eTSEC";
16547                         compatible = "gianfar";
16548 @@ -170,7 +182,8 @@
16549                         phy-connection-type = "rgmii-id";
16550                 };
16551  
16552 -               serial@4500 {
16553 +               serial0: serial@4500 {
16554 +                       cell-index = <0>;
16555                         device_type = "serial";
16556                         compatible = "ns16550";
16557                         reg = <4500 100>;
16558 @@ -179,7 +192,8 @@
16559                         interrupt-parent = <&mpic>;
16560                 };
16561  
16562 -               serial@4600 {
16563 +               serial1: serial@4600 {
16564 +                       cell-index = <1>;
16565                         device_type = "serial";
16566                         compatible = "ns16550";
16567                         reg = <4600 100>;
16568 @@ -206,7 +220,8 @@
16569                 };
16570         };
16571  
16572 -       pcie@ffe08000 {
16573 +       pci0: pcie@ffe08000 {
16574 +               cell-index = <0>;
16575                 compatible = "fsl,mpc8548-pcie";
16576                 device_type = "pci";
16577                 #interrupt-cells = <1>;
16578 @@ -319,9 +334,9 @@
16579  
16580                         // IDSEL 0x1c  USB
16581                         e000 0 0 1 &i8259 c 2
16582 -                       e100 0 0 1 &i8259 9 2
16583 -                       e200 0 0 1 &i8259 a 2
16584 -                       e300 0 0 1 &i8259 b 2
16585 +                       e100 0 0 2 &i8259 9 2
16586 +                       e200 0 0 3 &i8259 a 2
16587 +                       e300 0 0 4 &i8259 b 2
16588  
16589                         // IDSEL 0x1d  Audio
16590                         e800 0 0 1 &i8259 6 2
16591 @@ -415,7 +430,8 @@
16592  
16593         };
16594  
16595 -       pcie@ffe09000 {
16596 +       pci1: pcie@ffe09000 {
16597 +               cell-index = <1>;
16598                 compatible = "fsl,mpc8548-pcie";
16599                 device_type = "pci";
16600                 #interrupt-cells = <1>;
16601 @@ -451,7 +467,8 @@
16602                 };
16603         };
16604  
16605 -       pcie@ffe0a000 {
16606 +       pci2: pcie@ffe0a000 {
16607 +               cell-index = <2>;
16608                 compatible = "fsl,mpc8548-pcie";
16609                 device_type = "pci";
16610                 #interrupt-cells = <1>;
16611 @@ -464,6 +481,7 @@
16612                 clock-frequency = <1fca055>;
16613                 interrupt-parent = <&mpic>;
16614                 interrupts = <1b 2>;
16615 +               interrupt-map-mask = <f800 0 0 7>;
16616                 interrupt-map = <
16617                         /* IDSEL 0x0 */
16618                         0000 0 0 1 &mpic 0 1
16619 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8610_hpcd.dts
16620 ===================================================================
16621 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8610_hpcd.dts
16622 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8610_hpcd.dts
16623 @@ -1,7 +1,7 @@
16624  /*
16625   * MPC8610 HPCD Device Tree Source
16626   *
16627 - * Copyright 2007 Freescale Semiconductor Inc.
16628 + * Copyright 2007-2008 Freescale Semiconductor Inc.
16629   *
16630   * This program is free software; you can redistribute  it and/or modify it
16631   * under the terms of the GNU General Public License Version 2 as published
16632 @@ -15,6 +15,13 @@
16633         #address-cells = <1>;
16634         #size-cells = <1>;
16635  
16636 +       aliases {
16637 +               serial0 = &serial0;
16638 +               serial1 = &serial1;
16639 +               pci0 = &pci0;
16640 +               pci1 = &pci1;
16641 +       };
16642 +
16643         cpus {
16644                 #address-cells = <1>;
16645                 #size-cells = <0>;
16646 @@ -42,33 +49,42 @@
16647                 #size-cells = <1>;
16648                 #interrupt-cells = <2>;
16649                 device_type = "soc";
16650 +               compatible = "fsl,mpc8610-immr", "simple-bus";
16651                 ranges = <0 e0000000 00100000>;
16652                 reg = <e0000000 1000>;
16653                 bus-frequency = <0>;
16654  
16655                 i2c@3000 {
16656 -                       device_type = "i2c";
16657 -                       compatible = "fsl-i2c";
16658                         #address-cells = <1>;
16659                         #size-cells = <0>;
16660 +                       cell-index = <0>;
16661 +                       compatible = "fsl-i2c";
16662                         reg = <3000 100>;
16663                         interrupts = <2b 2>;
16664                         interrupt-parent = <&mpic>;
16665                         dfsrr;
16666 +
16667 +                        cs4270:codec@4f {
16668 +                               compatible = "cirrus,cs4270";
16669 +                                reg = <4f>;
16670 +                               /* MCLK source is a stand-alone oscillator */
16671 +                               clock-frequency = <bb8000>;
16672 +                        };
16673                 };
16674  
16675                 i2c@3100 {
16676 -                       device_type = "i2c";
16677 -                       compatible = "fsl-i2c";
16678                         #address-cells = <1>;
16679                         #size-cells = <0>;
16680 +                       cell-index = <1>;
16681 +                       compatible = "fsl-i2c";
16682                         reg = <3100 100>;
16683                         interrupts = <2b 2>;
16684                         interrupt-parent = <&mpic>;
16685                         dfsrr;
16686                 };
16687  
16688 -               serial@4500 {
16689 +               serial0: serial@4500 {
16690 +                       cell-index = <0>;
16691                         device_type = "serial";
16692                         compatible = "ns16550";
16693                         reg = <4500 100>;
16694 @@ -77,7 +93,8 @@
16695                         interrupt-parent = <&mpic>;
16696                 };
16697  
16698 -               serial@4600 {
16699 +               serial1: serial@4600 {
16700 +                       cell-index = <1>;
16701                         device_type = "serial";
16702                         compatible = "ns16550";
16703                         reg = <4600 100>;
16704 @@ -86,7 +103,6 @@
16705                         interrupt-parent = <&mpic>;
16706                 };
16707  
16708 -
16709                 mpic: interrupt-controller@40000 {
16710                         clock-frequency = <0>;
16711                         interrupt-controller;
16712 @@ -103,9 +119,113 @@
16713                         reg = <e0000 1000>;
16714                         fsl,has-rstcr;
16715                 };
16716 +
16717 +               i2s@16000 {
16718 +                       compatible = "fsl,mpc8610-ssi";
16719 +                       cell-index = <0>;
16720 +                       reg = <16000 100>;
16721 +                       interrupt-parent = <&mpic>;
16722 +                       interrupts = <3e 2>;
16723 +                       fsl,mode = "i2s-slave";
16724 +                       codec-handle = <&cs4270>;
16725 +               };
16726 +
16727 +               ssi@16100 {
16728 +                       compatible = "fsl,mpc8610-ssi";
16729 +                       cell-index = <1>;
16730 +                       reg = <16100 100>;
16731 +                       interrupt-parent = <&mpic>;
16732 +                       interrupts = <3f 2>;
16733 +               };
16734 +
16735 +                dma@21300 {
16736 +                        #address-cells = <1>;
16737 +                        #size-cells = <1>;
16738 +                        compatible = "fsl,mpc8610-dma", "fsl,eloplus-dma";
16739 +                        cell-index = <0>;
16740 +                        reg = <21300 4>; /* DMA general status register */
16741 +                        ranges = <0 21100 200>;
16742 +
16743 +                        dma-channel@0 {
16744 +                               compatible = "fsl,mpc8610-dma-channel",
16745 +                                       "fsl,eloplus-dma-channel";
16746 +                               cell-index = <0>;
16747 +                               reg = <0 80>;
16748 +                               interrupt-parent = <&mpic>;
16749 +                               interrupts = <14 2>;
16750 +                        };
16751 +                        dma-channel@1 {
16752 +                               compatible = "fsl,mpc8610-dma-channel",
16753 +                                       "fsl,eloplus-dma-channel";
16754 +                               cell-index = <1>;
16755 +                               reg = <80 80>;
16756 +                               interrupt-parent = <&mpic>;
16757 +                               interrupts = <15 2>;
16758 +                        };
16759 +                        dma-channel@2 {
16760 +                               compatible = "fsl,mpc8610-dma-channel",
16761 +                                       "fsl,eloplus-dma-channel";
16762 +                               cell-index = <2>;
16763 +                               reg = <100 80>;
16764 +                               interrupt-parent = <&mpic>;
16765 +                               interrupts = <16 2>;
16766 +                        };
16767 +                        dma-channel@3 {
16768 +                               compatible = "fsl,mpc8610-dma-channel",
16769 +                                       "fsl,eloplus-dma-channel";
16770 +                               cell-index = <3>;
16771 +                               reg = <180 80>;
16772 +                               interrupt-parent = <&mpic>;
16773 +                               interrupts = <17 2>;
16774 +                        };
16775 +                };
16776 +
16777 +                dma@c300 {
16778 +                        #address-cells = <1>;
16779 +                        #size-cells = <1>;
16780 +                        compatible = "fsl,mpc8610-dma", "fsl,mpc8540-dma";
16781 +                        cell-index = <1>;
16782 +                        reg = <c300 4>; /* DMA general status register */
16783 +                        ranges = <0 c100 200>;
16784 +
16785 +                        dma-channel@0 {
16786 +                               compatible = "fsl,mpc8610-dma-channel",
16787 +                                       "fsl,mpc8540-dma-channel";
16788 +                               cell-index = <0>;
16789 +                               reg = <0 80>;
16790 +                               interrupt-parent = <&mpic>;
16791 +                               interrupts = <3c 2>;
16792 +                        };
16793 +                        dma-channel@1 {
16794 +                               compatible = "fsl,mpc8610-dma-channel",
16795 +                                       "fsl,mpc8540-dma-channel";
16796 +                               cell-index = <1>;
16797 +                               reg = <80 80>;
16798 +                               interrupt-parent = <&mpic>;
16799 +                               interrupts = <3d 2>;
16800 +                        };
16801 +                        dma-channel@2 {
16802 +                               compatible = "fsl,mpc8610-dma-channel",
16803 +                                       "fsl,mpc8540-dma-channel";
16804 +                               cell-index = <2>;
16805 +                               reg = <100 80>;
16806 +                               interrupt-parent = <&mpic>;
16807 +                               interrupts = <3e 2>;
16808 +                        };
16809 +                        dma-channel@3 {
16810 +                               compatible = "fsl,mpc8610-dma-channel",
16811 +                                       "fsl,mpc8540-dma-channel";
16812 +                               cell-index = <3>;
16813 +                               reg = <180 80>;
16814 +                               interrupt-parent = <&mpic>;
16815 +                               interrupts = <3f 2>;
16816 +                        };
16817 +                };
16818 +
16819         };
16820  
16821 -       pci@e0008000 {
16822 +       pci0: pci@e0008000 {
16823 +               cell-index = <0>;
16824                 compatible = "fsl,mpc8610-pci";
16825                 device_type = "pci";
16826                 #interrupt-cells = <1>;
16827 @@ -134,7 +254,8 @@
16828                         >;
16829         };
16830  
16831 -       pcie@e000a000 {
16832 +       pci1: pcie@e000a000 {
16833 +               cell-index = <1>;
16834                 compatible = "fsl,mpc8641-pcie";
16835                 device_type = "pci";
16836                 #interrupt-cells = <1>;
16837 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc8641_hpcn.dts
16838 ===================================================================
16839 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc8641_hpcn.dts
16840 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc8641_hpcn.dts
16841 @@ -16,6 +16,17 @@
16842         #address-cells = <1>;
16843         #size-cells = <1>;
16844  
16845 +       aliases {
16846 +               ethernet0 = &enet0;
16847 +               ethernet1 = &enet1;
16848 +               ethernet2 = &enet2;
16849 +               ethernet3 = &enet3;
16850 +               serial0 = &serial0;
16851 +               serial1 = &serial1;
16852 +               pci0 = &pci0;
16853 +               pci1 = &pci1;
16854 +       };
16855 +
16856         cpus {
16857                 #address-cells = <1>;
16858                 #size-cells = <0>;
16859 @@ -49,16 +60,60 @@
16860                 reg = <00000000 40000000>;      // 1G at 0x0
16861         };
16862  
16863 +       localbus@f8005000 {
16864 +               #address-cells = <2>;
16865 +               #size-cells = <1>;
16866 +               compatible = "fsl,mpc8641-localbus", "simple-bus";
16867 +               reg = <f8005000 1000>;
16868 +               interrupts = <13 2>;
16869 +               interrupt-parent = <&mpic>;
16870 +
16871 +               ranges = <0 0 ff800000 00800000
16872 +                         1 0 fe000000 01000000
16873 +                         2 0 f8200000 00100000
16874 +                         3 0 f8100000 00100000>;
16875 +
16876 +               flash@0,0 {
16877 +                       compatible = "cfi-flash";
16878 +                       reg = <0 0 00800000>;
16879 +                       bank-width = <2>;
16880 +                       device-width = <2>;
16881 +                       #address-cells = <1>;
16882 +                       #size-cells = <1>;
16883 +                       partition@0 {
16884 +                               label = "kernel";
16885 +                               reg = <00000000 00300000>;
16886 +                       };
16887 +                       partition@300000 {
16888 +                               label = "firmware b";
16889 +                               reg = <00300000 00100000>;
16890 +                               read-only;
16891 +                       };
16892 +                       partition@400000 {
16893 +                               label = "fs";
16894 +                               reg = <00400000 00300000>;
16895 +                       };
16896 +                       partition@700000 {
16897 +                               label = "firmware a";
16898 +                               reg = <00700000 00100000>;
16899 +                               read-only;
16900 +                       };
16901 +               };
16902 +       };
16903 +
16904         soc8641@f8000000 {
16905                 #address-cells = <1>;
16906                 #size-cells = <1>;
16907                 device_type = "soc";
16908 +               compatible = "simple-bus";
16909                 ranges = <00000000 f8000000 00100000>;
16910                 reg = <f8000000 00001000>;      // CCSRBAR
16911                 bus-frequency = <0>;
16912  
16913                 i2c@3000 {
16914 -                       device_type = "i2c";
16915 +                       #address-cells = <1>;
16916 +                       #size-cells = <0>;
16917 +                       cell-index = <0>;
16918                         compatible = "fsl-i2c";
16919                         reg = <3000 100>;
16920                         interrupts = <2b 2>;
16921 @@ -67,7 +122,9 @@
16922                 };
16923  
16924                 i2c@3100 {
16925 -                       device_type = "i2c";
16926 +                       #address-cells = <1>;
16927 +                       #size-cells = <0>;
16928 +                       cell-index = <1>;
16929                         compatible = "fsl-i2c";
16930                         reg = <3100 100>;
16931                         interrupts = <2b 2>;
16932 @@ -78,9 +135,9 @@
16933                 mdio@24520 {
16934                         #address-cells = <1>;
16935                         #size-cells = <0>;
16936 -                       device_type = "mdio";
16937 -                       compatible = "gianfar";
16938 +                       compatible = "fsl,gianfar-mdio";
16939                         reg = <24520 20>;
16940 +
16941                         phy0: ethernet-phy@0 {
16942                                 interrupt-parent = <&mpic>;
16943                                 interrupts = <a 1>;
16944 @@ -107,19 +164,12 @@
16945                         };
16946                 };
16947  
16948 -               ethernet@24000 {
16949 -                       #address-cells = <1>;
16950 -                       #size-cells = <0>;
16951 +               enet0: ethernet@24000 {
16952 +                       cell-index = <0>;
16953                         device_type = "network";
16954                         model = "TSEC";
16955                         compatible = "gianfar";
16956                         reg = <24000 1000>;
16957 -                       /*
16958 -                        * mac-address is deprecated and will be removed
16959 -                        * in 2.6.25.  Only recent versions of
16960 -                        * U-Boot support local-mac-address, however.
16961 -                        */
16962 -                       mac-address = [ 00 00 00 00 00 00 ];
16963                         local-mac-address = [ 00 00 00 00 00 00 ];
16964                         interrupts = <1d 2 1e 2 22 2>;
16965                         interrupt-parent = <&mpic>;
16966 @@ -127,19 +177,12 @@
16967                         phy-connection-type = "rgmii-id";
16968                 };
16969  
16970 -               ethernet@25000 {
16971 -                       #address-cells = <1>;
16972 -                       #size-cells = <0>;
16973 +               enet1: ethernet@25000 {
16974 +                       cell-index = <1>;
16975                         device_type = "network";
16976                         model = "TSEC";
16977                         compatible = "gianfar";
16978                         reg = <25000 1000>;
16979 -                       /*
16980 -                        * mac-address is deprecated and will be removed
16981 -                        * in 2.6.25.  Only recent versions of
16982 -                        * U-Boot support local-mac-address, however.
16983 -                        */
16984 -                       mac-address = [ 00 00 00 00 00 00 ];
16985                         local-mac-address = [ 00 00 00 00 00 00 ];
16986                         interrupts = <23 2 24 2 28 2>;
16987                         interrupt-parent = <&mpic>;
16988 @@ -147,19 +190,12 @@
16989                         phy-connection-type = "rgmii-id";
16990                 };
16991                 
16992 -               ethernet@26000 {
16993 -                       #address-cells = <1>;
16994 -                       #size-cells = <0>;
16995 +               enet2: ethernet@26000 {
16996 +                       cell-index = <2>;
16997                         device_type = "network";
16998                         model = "TSEC";
16999                         compatible = "gianfar";
17000                         reg = <26000 1000>;
17001 -                       /*
17002 -                        * mac-address is deprecated and will be removed
17003 -                        * in 2.6.25.  Only recent versions of
17004 -                        * U-Boot support local-mac-address, however.
17005 -                        */
17006 -                       mac-address = [ 00 00 00 00 00 00 ];
17007                         local-mac-address = [ 00 00 00 00 00 00 ];
17008                         interrupts = <1F 2 20 2 21 2>;
17009                         interrupt-parent = <&mpic>;
17010 @@ -167,26 +203,21 @@
17011                         phy-connection-type = "rgmii-id";
17012                 };
17013  
17014 -               ethernet@27000 {
17015 -                       #address-cells = <1>;
17016 -                       #size-cells = <0>;
17017 +               enet3: ethernet@27000 {
17018 +                       cell-index = <3>;
17019                         device_type = "network";
17020                         model = "TSEC";
17021                         compatible = "gianfar";
17022                         reg = <27000 1000>;
17023 -                       /*
17024 -                        * mac-address is deprecated and will be removed
17025 -                        * in 2.6.25.  Only recent versions of
17026 -                        * U-Boot support local-mac-address, however.
17027 -                        */
17028 -                       mac-address = [ 00 00 00 00 00 00 ];
17029                         local-mac-address = [ 00 00 00 00 00 00 ];
17030                         interrupts = <25 2 26 2 27 2>;
17031                         interrupt-parent = <&mpic>;
17032                         phy-handle = <&phy3>;
17033                         phy-connection-type = "rgmii-id";
17034                 };
17035 -               serial@4500 {
17036 +
17037 +               serial0: serial@4500 {
17038 +                       cell-index = <0>;
17039                         device_type = "serial";
17040                         compatible = "ns16550";
17041                         reg = <4500 100>;
17042 @@ -195,7 +226,8 @@
17043                         interrupt-parent = <&mpic>;
17044                 };
17045  
17046 -               serial@4600 {
17047 +               serial1: serial@4600 {
17048 +                       cell-index = <1>;
17049                         device_type = "serial";
17050                         compatible = "ns16550";
17051                         reg = <4600 100>;
17052 @@ -222,7 +254,8 @@
17053                 };
17054         };
17055  
17056 -       pcie@f8008000 {
17057 +       pci0: pcie@f8008000 {
17058 +               cell-index = <0>;
17059                 compatible = "fsl,mpc8641-pcie";
17060                 device_type = "pci";
17061                 #interrupt-cells = <1>;
17062 @@ -335,9 +368,9 @@
17063  
17064                         // IDSEL 0x1c  USB
17065                         e000 0 0 1 &i8259 c 2
17066 -                       e100 0 0 1 &i8259 9 2
17067 -                       e200 0 0 1 &i8259 a 2
17068 -                       e300 0 0 1 &i8259 b 2
17069 +                       e100 0 0 2 &i8259 9 2
17070 +                       e200 0 0 3 &i8259 a 2
17071 +                       e300 0 0 4 &i8259 b 2
17072  
17073                         // IDSEL 0x1d  Audio
17074                         e800 0 0 1 &i8259 6 2
17075 @@ -430,7 +463,8 @@
17076  
17077         };
17078  
17079 -       pcie@f8009000 {
17080 +       pci1: pcie@f8009000 {
17081 +               cell-index = <1>;
17082                 compatible = "fsl,mpc8641-pcie";
17083                 device_type = "pci";
17084                 #interrupt-cells = <1>;
17085 Index: linux-2.6.24.7/arch/powerpc/boot/dts/mpc866ads.dts
17086 ===================================================================
17087 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/mpc866ads.dts
17088 +++ linux-2.6.24.7/arch/powerpc/boot/dts/mpc866ads.dts
17089 @@ -12,7 +12,7 @@
17090  
17091  / {
17092         model = "MPC866ADS";
17093 -       compatible = "mpc8xx";
17094 +       compatible = "fsl,mpc866ads";
17095         #address-cells = <1>;
17096         #size-cells = <1>;
17097  
17098 @@ -23,15 +23,15 @@
17099                 PowerPC,866@0 {
17100                         device_type = "cpu";
17101                         reg = <0>;
17102 -                       d-cache-line-size = <20>;       // 32 bytes
17103 -                       i-cache-line-size = <20>;       // 32 bytes
17104 +                       d-cache-line-size = <10>;       // 16 bytes
17105 +                       i-cache-line-size = <10>;       // 16 bytes
17106                         d-cache-size = <2000>;          // L1, 8K
17107                         i-cache-size = <4000>;          // L1, 16K
17108                         timebase-frequency = <0>;
17109                         bus-frequency = <0>;
17110                         clock-frequency = <0>;
17111                         interrupts = <f 2>;     // decrementer interrupt
17112 -                       interrupt-parent = <&Mpc8xx_pic>;
17113 +                       interrupt-parent = <&PIC>;
17114                 };
17115         };
17116  
17117 @@ -40,107 +40,139 @@
17118                 reg = <00000000 800000>;
17119         };
17120  
17121 -       soc866@ff000000 {
17122 +       localbus@ff000100 {
17123 +               compatible = "fsl,mpc866-localbus", "fsl,pq1-localbus";
17124 +               #address-cells = <2>;
17125 +               #size-cells = <1>;
17126 +               reg = <ff000100 40>;
17127 +
17128 +               ranges = <
17129 +                       1 0 ff080000 00008000
17130 +                       5 0 ff0a0000 00008000
17131 +               >;
17132 +
17133 +               board-control@1,0 {
17134 +                       reg = <1 0 20 5 300 4>;
17135 +                       compatible = "fsl,mpc866ads-bcsr";
17136 +               };
17137 +       };
17138 +
17139 +       soc@ff000000 {
17140                 #address-cells = <1>;
17141                 #size-cells = <1>;
17142                 device_type = "soc";
17143                 ranges = <0 ff000000 00100000>;
17144                 reg = <ff000000 00000200>;
17145                 bus-frequency = <0>;
17146 -               mdio@e80 {
17147 -                       device_type = "mdio";
17148 -                       compatible = "fs_enet";
17149 -                       reg = <e80 8>;
17150 +
17151 +               mdio@e00 {
17152 +                       compatible = "fsl,mpc866-fec-mdio", "fsl,pq1-fec-mdio";
17153 +                       reg = <e00 188>;
17154                         #address-cells = <1>;
17155                         #size-cells = <0>;
17156 -                       phy: ethernet-phy@f {
17157 +                       PHY: ethernet-phy@f {
17158                                 reg = <f>;
17159                                 device_type = "ethernet-phy";
17160                         };
17161                 };
17162  
17163 -               fec@e00 {
17164 +               ethernet@e00 {
17165                         device_type = "network";
17166 -                       compatible = "fs_enet";
17167 -                       model = "FEC";
17168 -                       device-id = <1>;
17169 +                       compatible = "fsl,mpc866-fec-enet",
17170 +                                    "fsl,pq1-fec-enet";
17171                         reg = <e00 188>;
17172 -                       mac-address = [ 00 00 0C 00 01 FD ];
17173 +                       local-mac-address = [ 00 00 00 00 00 00 ];
17174                         interrupts = <3 1>;
17175 -                       interrupt-parent = <&Mpc8xx_pic>;
17176 -                       phy-handle = <&Phy>;
17177 +                       interrupt-parent = <&PIC>;
17178 +                       phy-handle = <&PHY>;
17179 +                       linux,network-index = <0>;
17180                 };
17181  
17182 -               mpc8xx_pic: pic@ff000000 {
17183 +               PIC: pic@0 {
17184                         interrupt-controller;
17185 -                       #address-cells = <0>;
17186                         #interrupt-cells = <2>;
17187                         reg = <0 24>;
17188 -                       device_type = "mpc8xx-pic";
17189 -                       compatible = "CPM";
17190 +                       compatible = "fsl,mpc866-pic", "fsl,pq1-pic";
17191                 };
17192  
17193 -               cpm@ff000000 {
17194 +               cpm@9c0 {
17195                         #address-cells = <1>;
17196                         #size-cells = <1>;
17197 -                       device_type = "cpm";
17198 -                       model = "CPM";
17199 -                       ranges = <0 0 4000>;
17200 -                       reg = <860 f0>;
17201 -                       command-proc = <9c0>;
17202 +                       compatible = "fsl,mpc866-cpm", "fsl,cpm1";
17203 +                       ranges;
17204 +                       reg = <9c0 40>;
17205                         brg-frequency = <0>;
17206                         interrupts = <0 2>;     // cpm error interrupt
17207 -                       interrupt-parent = <&Cpm_pic>;
17208 +                       interrupt-parent = <&CPM_PIC>;
17209  
17210 -                       cpm_pic: pic@930 {
17211 +                       muram@2000 {
17212 +                               #address-cells = <1>;
17213 +                               #size-cells = <1>;
17214 +                               ranges = <0 2000 2000>;
17215 +
17216 +                               data@0 {
17217 +                                       compatible = "fsl,cpm-muram-data";
17218 +                                       reg = <0 1c00>;
17219 +                               };
17220 +                       };
17221 +
17222 +                       brg@9f0 {
17223 +                               compatible = "fsl,mpc866-brg",
17224 +                                            "fsl,cpm1-brg",
17225 +                                            "fsl,cpm-brg";
17226 +                               reg = <9f0 10>;
17227 +                               clock-frequency = <0>;
17228 +                       };
17229 +
17230 +                       CPM_PIC: pic@930 {
17231                                 interrupt-controller;
17232                                 #address-cells = <0>;
17233 -                               #interrupt-cells = <2>;
17234 +                               #interrupt-cells = <1>;
17235                                 interrupts = <5 2 0 2>;
17236 -                               interrupt-parent = <&Mpc8xx_pic>;
17237 +                               interrupt-parent = <&PIC>;
17238                                 reg = <930 20>;
17239 -                               device_type = "cpm-pic";
17240 -                               compatible = "CPM";
17241 +                               compatible = "fsl,mpc866-cpm-pic",
17242 +                                            "fsl,cpm1-pic";
17243                         };
17244  
17245 -                       smc@a80 {
17246 +
17247 +                       serial@a80 {
17248                                 device_type = "serial";
17249 -                               compatible = "cpm_uart";
17250 -                               model = "SMC";
17251 -                               device-id = <1>;
17252 +                               compatible = "fsl,mpc866-smc-uart",
17253 +                                            "fsl,cpm1-smc-uart";
17254                                 reg = <a80 10 3e80 40>;
17255 -                               clock-setup = <00ffffff 0>;
17256 -                               rx-clock = <1>;
17257 -                               tx-clock = <1>;
17258 -                               current-speed = <0>;
17259 -                               interrupts = <4 3>;
17260 -                               interrupt-parent = <&Cpm_pic>;
17261 +                               interrupts = <4>;
17262 +                               interrupt-parent = <&CPM_PIC>;
17263 +                               fsl,cpm-brg = <1>;
17264 +                               fsl,cpm-command = <0090>;
17265                         };
17266  
17267 -                       smc@a90 {
17268 +                       serial@a90 {
17269                                 device_type = "serial";
17270 -                               compatible = "cpm_uart";
17271 -                               model = "SMC";
17272 -                               device-id = <2>;
17273 -                               reg = <a90 20 3f80 40>;
17274 -                               clock-setup = <ff00ffff 90000>;
17275 -                               rx-clock = <2>;
17276 -                               tx-clock = <2>;
17277 -                               current-speed = <0>;
17278 -                               interrupts = <3 3>;
17279 -                               interrupt-parent = <&Cpm_pic>;
17280 +                               compatible = "fsl,mpc866-smc-uart",
17281 +                                            "fsl,cpm1-smc-uart";
17282 +                               reg = <a90 10 3f80 40>;
17283 +                               interrupts = <3>;
17284 +                               interrupt-parent = <&CPM_PIC>;
17285 +                               fsl,cpm-brg = <2>;
17286 +                               fsl,cpm-command = <00d0>;
17287                         };
17288  
17289 -                       scc@a00 {
17290 +                       ethernet@a00 {
17291                                 device_type = "network";
17292 -                               compatible = "fs_enet";
17293 -                               model = "SCC";
17294 -                               device-id = <1>;
17295 -                               reg = <a00 18 3c00 80>;
17296 -                               mac-address = [ 00 00 0C 00 03 FD ];
17297 -                               interrupts = <1e 3>;
17298 -                               interrupt-parent = <&Cpm_pic>;
17299 +                               compatible = "fsl,mpc866-scc-enet",
17300 +                                            "fsl,cpm1-scc-enet";
17301 +                               reg = <a00 18 3c00 100>;
17302 +                               local-mac-address = [ 00 00 00 00 00 00 ];
17303 +                               interrupts = <1e>;
17304 +                               interrupt-parent = <&CPM_PIC>;
17305 +                               fsl,cpm-command = <0000>;
17306 +                               linux,network-index = <1>;
17307                         };
17308                 };
17309         };
17310 +
17311 +       chosen {
17312 +               linux,stdout-path = "/soc/cpm/serial@a80";
17313 +       };
17314  };
17315 Index: linux-2.6.24.7/arch/powerpc/boot/dts/rainier.dts
17316 ===================================================================
17317 --- /dev/null
17318 +++ linux-2.6.24.7/arch/powerpc/boot/dts/rainier.dts
17319 @@ -0,0 +1,353 @@
17320 +/*
17321 + * Device Tree Source for AMCC Rainier
17322 + *
17323 + * Based on Sequoia code
17324 + * Copyright (c) 2007 MontaVista Software, Inc.
17325 + *
17326 + * FIXME: Draft only!
17327 + *
17328 + * This file is licensed under the terms of the GNU General Public
17329 + * License version 2.  This program is licensed "as is" without
17330 + * any warranty of any kind, whether express or implied.
17331 + *
17332 + */
17333 +
17334 +/ {
17335 +       #address-cells = <2>;
17336 +       #size-cells = <1>;
17337 +       model = "amcc,rainier";
17338 +       compatible = "amcc,rainier";
17339 +       dcr-parent = <&/cpus/cpu@0>;
17340 +
17341 +       aliases {
17342 +               ethernet0 = &EMAC0;
17343 +               ethernet1 = &EMAC1;
17344 +               serial0 = &UART0;
17345 +               serial1 = &UART1;
17346 +               serial2 = &UART2;
17347 +               serial3 = &UART3;
17348 +       };
17349 +
17350 +       cpus {
17351 +               #address-cells = <1>;
17352 +               #size-cells = <0>;
17353 +
17354 +               cpu@0 {
17355 +                       device_type = "cpu";
17356 +                       model = "PowerPC,440GRx";
17357 +                       reg = <0>;
17358 +                       clock-frequency = <0>; /* Filled in by zImage */
17359 +                       timebase-frequency = <0>; /* Filled in by zImage */
17360 +                       i-cache-line-size = <20>;
17361 +                       d-cache-line-size = <20>;
17362 +                       i-cache-size = <8000>;
17363 +                       d-cache-size = <8000>;
17364 +                       dcr-controller;
17365 +                       dcr-access-method = "native";
17366 +               };
17367 +       };
17368 +
17369 +       memory {
17370 +               device_type = "memory";
17371 +               reg = <0 0 0>; /* Filled in by zImage */
17372 +       };
17373 +
17374 +       UIC0: interrupt-controller0 {
17375 +               compatible = "ibm,uic-440grx","ibm,uic";
17376 +               interrupt-controller;
17377 +               cell-index = <0>;
17378 +               dcr-reg = <0c0 009>;
17379 +               #address-cells = <0>;
17380 +               #size-cells = <0>;
17381 +               #interrupt-cells = <2>;
17382 +       };
17383 +
17384 +       UIC1: interrupt-controller1 {
17385 +               compatible = "ibm,uic-440grx","ibm,uic";
17386 +               interrupt-controller;
17387 +               cell-index = <1>;
17388 +               dcr-reg = <0d0 009>;
17389 +               #address-cells = <0>;
17390 +               #size-cells = <0>;
17391 +               #interrupt-cells = <2>;
17392 +               interrupts = <1e 4 1f 4>; /* cascade */
17393 +               interrupt-parent = <&UIC0>;
17394 +       };
17395 +
17396 +       UIC2: interrupt-controller2 {
17397 +               compatible = "ibm,uic-440grx","ibm,uic";
17398 +               interrupt-controller;
17399 +               cell-index = <2>;
17400 +               dcr-reg = <0e0 009>;
17401 +               #address-cells = <0>;
17402 +               #size-cells = <0>;
17403 +               #interrupt-cells = <2>;
17404 +               interrupts = <1c 4 1d 4>; /* cascade */
17405 +               interrupt-parent = <&UIC0>;
17406 +       };
17407 +
17408 +       SDR0: sdr {
17409 +               compatible = "ibm,sdr-440grx", "ibm,sdr-440ep";
17410 +               dcr-reg = <00e 002>;
17411 +       };
17412 +
17413 +       CPR0: cpr {
17414 +               compatible = "ibm,cpr-440grx", "ibm,cpr-440ep";
17415 +               dcr-reg = <00c 002>;
17416 +       };
17417 +
17418 +       plb {
17419 +               compatible = "ibm,plb-440grx", "ibm,plb4";
17420 +               #address-cells = <2>;
17421 +               #size-cells = <1>;
17422 +               ranges;
17423 +               clock-frequency = <0>; /* Filled in by zImage */
17424 +
17425 +               SDRAM0: sdram {
17426 +                       compatible = "ibm,sdram-440grx", "ibm,sdram-44x-ddr2denali";
17427 +                       dcr-reg = <010 2>;
17428 +               };
17429 +
17430 +               DMA0: dma {
17431 +                       compatible = "ibm,dma-440grx", "ibm,dma-4xx";
17432 +                       dcr-reg = <100 027>;
17433 +               };
17434 +
17435 +               MAL0: mcmal {
17436 +                       compatible = "ibm,mcmal-440grx", "ibm,mcmal2";
17437 +                       dcr-reg = <180 62>;
17438 +                       num-tx-chans = <2>;
17439 +                       num-rx-chans = <2>;
17440 +                       interrupt-parent = <&MAL0>;
17441 +                       interrupts = <0 1 2 3 4>;
17442 +                       #interrupt-cells = <1>;
17443 +                       #address-cells = <0>;
17444 +                       #size-cells = <0>;
17445 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
17446 +                                       /*RXEOB*/ 1 &UIC0 b 4
17447 +                                       /*SERR*/  2 &UIC1 0 4
17448 +                                       /*TXDE*/  3 &UIC1 1 4
17449 +                                       /*RXDE*/  4 &UIC1 2 4>;
17450 +                       interrupt-map-mask = <ffffffff>;
17451 +               };
17452 +
17453 +               POB0: opb {
17454 +                       compatible = "ibm,opb-440grx", "ibm,opb";
17455 +                       #address-cells = <1>;
17456 +                       #size-cells = <1>;
17457 +                       ranges = <00000000 1 00000000 80000000
17458 +                                 80000000 1 80000000 80000000>;
17459 +                       interrupt-parent = <&UIC1>;
17460 +                       interrupts = <7 4>;
17461 +                       clock-frequency = <0>; /* Filled in by zImage */
17462 +
17463 +                       EBC0: ebc {
17464 +                               compatible = "ibm,ebc-440grx", "ibm,ebc";
17465 +                               dcr-reg = <012 2>;
17466 +                               #address-cells = <2>;
17467 +                               #size-cells = <1>;
17468 +                               clock-frequency = <0>; /* Filled in by zImage */
17469 +                               interrupts = <5 1>;
17470 +                               interrupt-parent = <&UIC1>;
17471 +
17472 +                               nor_flash@0,0 {
17473 +                                       compatible = "amd,s29gl256n", "cfi-flash";
17474 +                                       bank-width = <2>;
17475 +                                       reg = <0 000000 4000000>;
17476 +                                       #address-cells = <1>;
17477 +                                       #size-cells = <1>;
17478 +                                       partition@0 {
17479 +                                               label = "Kernel";
17480 +                                               reg = <0 180000>;
17481 +                                       };
17482 +                                       partition@180000 {
17483 +                                               label = "ramdisk";
17484 +                                               reg = <180000 200000>;
17485 +                                       };
17486 +                                       partition@380000 {
17487 +                                               label = "file system";
17488 +                                               reg = <380000 3aa0000>;
17489 +                                       };
17490 +                                       partition@3e20000 {
17491 +                                               label = "kozio";
17492 +                                               reg = <3e20000 140000>;
17493 +                                       };
17494 +                                       partition@3f60000 {
17495 +                                               label = "env";
17496 +                                               reg = <3f60000 40000>;
17497 +                                       };
17498 +                                       partition@3fa0000 {
17499 +                                               label = "u-boot";
17500 +                                               reg = <3fa0000 60000>;
17501 +                                       };
17502 +                               };
17503 +
17504 +                       };
17505 +
17506 +                       UART0: serial@ef600300 {
17507 +                               device_type = "serial";
17508 +                               compatible = "ns16550";
17509 +                               reg = <ef600300 8>;
17510 +                               virtual-reg = <ef600300>;
17511 +                               clock-frequency = <0>; /* Filled in by zImage */
17512 +                               current-speed = <1c200>;
17513 +                               interrupt-parent = <&UIC0>;
17514 +                               interrupts = <0 4>;
17515 +                       };
17516 +
17517 +                       UART1: serial@ef600400 {
17518 +                               device_type = "serial";
17519 +                               compatible = "ns16550";
17520 +                               reg = <ef600400 8>;
17521 +                               virtual-reg = <ef600400>;
17522 +                               clock-frequency = <0>;
17523 +                               current-speed = <0>;
17524 +                               interrupt-parent = <&UIC0>;
17525 +                               interrupts = <1 4>;
17526 +                       };
17527 +
17528 +                       UART2: serial@ef600500 {
17529 +                               device_type = "serial";
17530 +                               compatible = "ns16550";
17531 +                               reg = <ef600500 8>;
17532 +                               virtual-reg = <ef600500>;
17533 +                               clock-frequency = <0>;
17534 +                               current-speed = <0>;
17535 +                               interrupt-parent = <&UIC1>;
17536 +                               interrupts = <3 4>;
17537 +                       };
17538 +
17539 +                       UART3: serial@ef600600 {
17540 +                               device_type = "serial";
17541 +                               compatible = "ns16550";
17542 +                               reg = <ef600600 8>;
17543 +                               virtual-reg = <ef600600>;
17544 +                               clock-frequency = <0>;
17545 +                               current-speed = <0>;
17546 +                               interrupt-parent = <&UIC1>;
17547 +                               interrupts = <4 4>;
17548 +                       };
17549 +
17550 +                       IIC0: i2c@ef600700 {
17551 +                               device_type = "i2c";
17552 +                               compatible = "ibm,iic-440grx", "ibm,iic";
17553 +                               reg = <ef600700 14>;
17554 +                               interrupt-parent = <&UIC0>;
17555 +                               interrupts = <2 4>;
17556 +                       };
17557 +
17558 +                       IIC1: i2c@ef600800 {
17559 +                               device_type = "i2c";
17560 +                               compatible = "ibm,iic-440grx", "ibm,iic";
17561 +                               reg = <ef600800 14>;
17562 +                               interrupt-parent = <&UIC0>;
17563 +                               interrupts = <7 4>;
17564 +                       };
17565 +
17566 +                       ZMII0: emac-zmii@ef600d00 {
17567 +                               device_type = "zmii-interface";
17568 +                               compatible = "ibm,zmii-440grx", "ibm,zmii";
17569 +                               reg = <ef600d00 c>;
17570 +                       };
17571 +
17572 +                       RGMII0: emac-rgmii@ef601000 {
17573 +                               device_type = "rgmii-interface";
17574 +                               compatible = "ibm,rgmii-440grx", "ibm,rgmii";
17575 +                               reg = <ef601000 8>;
17576 +                               has-mdio;
17577 +                       };
17578 +
17579 +                       EMAC0: ethernet@ef600e00 {
17580 +                               linux,network-index = <0>;
17581 +                               device_type = "network";
17582 +                               compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4";
17583 +                               interrupt-parent = <&EMAC0>;
17584 +                               interrupts = <0 1>;
17585 +                               #interrupt-cells = <1>;
17586 +                               #address-cells = <0>;
17587 +                               #size-cells = <0>;
17588 +                               interrupt-map = </*Status*/ 0 &UIC0 18 4
17589 +                                               /*Wake*/  1 &UIC1 1d 4>;
17590 +                               reg = <ef600e00 70>;
17591 +                               local-mac-address = [000000000000];
17592 +                               mal-device = <&MAL0>;
17593 +                               mal-tx-channel = <0>;
17594 +                               mal-rx-channel = <0>;
17595 +                               cell-index = <0>;
17596 +                               max-frame-size = <5dc>;
17597 +                               rx-fifo-size = <1000>;
17598 +                               tx-fifo-size = <800>;
17599 +                               phy-mode = "rgmii";
17600 +                               phy-map = <00000000>;
17601 +                               zmii-device = <&ZMII0>;
17602 +                               zmii-channel = <0>;
17603 +                               rgmii-device = <&RGMII0>;
17604 +                               rgmii-channel = <0>;
17605 +                               has-inverted-stacr-oc;
17606 +                               has-new-stacr-staopc;
17607 +                       };
17608 +
17609 +                       EMAC1: ethernet@ef600f00 {
17610 +                               linux,network-index = <1>;
17611 +                               device_type = "network";
17612 +                               compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4";
17613 +                               interrupt-parent = <&EMAC1>;
17614 +                               interrupts = <0 1>;
17615 +                               #interrupt-cells = <1>;
17616 +                               #address-cells = <0>;
17617 +                               #size-cells = <0>;
17618 +                               interrupt-map = </*Status*/ 0 &UIC0 19 4
17619 +                                               /*Wake*/  1 &UIC1 1f 4>;
17620 +                               reg = <ef600f00 70>;
17621 +                               local-mac-address = [000000000000];
17622 +                               mal-device = <&MAL0>;
17623 +                               mal-tx-channel = <1>;
17624 +                               mal-rx-channel = <1>;
17625 +                               cell-index = <1>;
17626 +                               max-frame-size = <5dc>;
17627 +                               rx-fifo-size = <1000>;
17628 +                               tx-fifo-size = <800>;
17629 +                               phy-mode = "rgmii";
17630 +                               phy-map = <00000000>;
17631 +                               zmii-device = <&ZMII0>;
17632 +                               zmii-channel = <1>;
17633 +                               rgmii-device = <&RGMII0>;
17634 +                               rgmii-channel = <1>;
17635 +                               has-inverted-stacr-oc;
17636 +                               has-new-stacr-staopc;
17637 +                       };
17638 +               };
17639 +
17640 +               PCI0: pci@1ec000000 {
17641 +                       device_type = "pci";
17642 +                       #interrupt-cells = <1>;
17643 +                       #size-cells = <2>;
17644 +                       #address-cells = <3>;
17645 +                       compatible = "ibm,plb440grx-pci", "ibm,plb-pci";
17646 +                       primary;
17647 +                       reg = <1 eec00000 8     /* Config space access */
17648 +                              1 eed00000 4     /* IACK */
17649 +                              1 eed00000 4     /* Special cycle */
17650 +                              1 ef400000 40>;  /* Internal registers */
17651 +
17652 +                       /* Outbound ranges, one memory and one IO,
17653 +                        * later cannot be changed. Chip supports a second
17654 +                        * IO range but we don't use it for now
17655 +                        */
17656 +                       ranges = <02000000 0 80000000 1 80000000 0 10000000
17657 +                               01000000 0 00000000 1 e8000000 0 00100000>;
17658 +
17659 +                       /* Inbound 2GB range starting at 0 */
17660 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
17661 +
17662 +                       /* All PCI interrupts are routed to IRQ 67 */
17663 +                       interrupt-map-mask = <0000 0 0 0>;
17664 +                       interrupt-map = < 0000 0 0 0 &UIC2 3 8 >;
17665 +               };
17666 +       };
17667 +
17668 +       chosen {
17669 +               linux,stdout-path = "/plb/opb/serial@ef600300";
17670 +               bootargs = "console=ttyS0,115200";
17671 +       };
17672 +};
17673 Index: linux-2.6.24.7/arch/powerpc/boot/dts/sequoia.dts
17674 ===================================================================
17675 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/sequoia.dts
17676 +++ linux-2.6.24.7/arch/powerpc/boot/dts/sequoia.dts
17677 @@ -17,14 +17,24 @@
17678         #size-cells = <1>;
17679         model = "amcc,sequoia";
17680         compatible = "amcc,sequoia";
17681 -       dcr-parent = <&/cpus/PowerPC,440EPx@0>;
17682 +       dcr-parent = <&/cpus/cpu@0>;
17683 +
17684 +       aliases {
17685 +               ethernet0 = &EMAC0;
17686 +               ethernet1 = &EMAC1;
17687 +               serial0 = &UART0;
17688 +               serial1 = &UART1;
17689 +               serial2 = &UART2;
17690 +               serial3 = &UART3;
17691 +       };
17692  
17693         cpus {
17694                 #address-cells = <1>;
17695                 #size-cells = <0>;
17696  
17697 -               PowerPC,440EPx@0 {
17698 +               cpu@0 {
17699                         device_type = "cpu";
17700 +                       model = "PowerPC,440EPx";
17701                         reg = <0>;
17702                         clock-frequency = <0>; /* Filled in by zImage */
17703                         timebase-frequency = <0>; /* Filled in by zImage */
17704 @@ -94,7 +104,6 @@
17705                 clock-frequency = <0>; /* Filled in by zImage */
17706  
17707                 SDRAM0: sdram {
17708 -                       device_type = "memory-controller";
17709                         compatible = "ibm,sdram-440epx", "ibm,sdram-44x-ddr2denali";
17710                         dcr-reg = <010 2>;
17711                 };
17712 @@ -122,6 +131,13 @@
17713                         interrupt-map-mask = <ffffffff>;
17714                 };
17715  
17716 +               USB1: usb@e0000400 {
17717 +                       compatible = "ohci-be";
17718 +                       reg = <0 e0000400 60>;
17719 +                       interrupt-parent = <&UIC0>;
17720 +                       interrupts = <15 8>;
17721 +               };
17722 +
17723                 POB0: opb {
17724                         compatible = "ibm,opb-440epx", "ibm,opb";
17725                         #address-cells = <1>;
17726 @@ -308,6 +324,33 @@
17727                                 has-new-stacr-staopc;
17728                         };
17729                 };
17730 +
17731 +               PCI0: pci@1ec000000 {
17732 +                       device_type = "pci";
17733 +                       #interrupt-cells = <1>;
17734 +                       #size-cells = <2>;
17735 +                       #address-cells = <3>;
17736 +                       compatible = "ibm,plb440epx-pci", "ibm,plb-pci";
17737 +                       primary;
17738 +                       reg = <1 eec00000 8     /* Config space access */
17739 +                              1 eed00000 4     /* IACK */
17740 +                              1 eed00000 4     /* Special cycle */
17741 +                              1 ef400000 40>;  /* Internal registers */
17742 +
17743 +                       /* Outbound ranges, one memory and one IO,
17744 +                        * later cannot be changed. Chip supports a second
17745 +                        * IO range but we don't use it for now
17746 +                        */
17747 +                       ranges = <02000000 0 80000000 1 80000000 0 10000000
17748 +                               01000000 0 00000000 1 e8000000 0 00100000>;
17749 +
17750 +                       /* Inbound 2GB range starting at 0 */
17751 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
17752 +
17753 +                       /* All PCI interrupts are routed to IRQ 67 */
17754 +                       interrupt-map-mask = <0000 0 0 0>;
17755 +                       interrupt-map = < 0000 0 0 0 &UIC2 3 8 >;
17756 +               };
17757         };
17758  
17759         chosen {
17760 Index: linux-2.6.24.7/arch/powerpc/boot/dts/storcenter.dts
17761 ===================================================================
17762 --- /dev/null
17763 +++ linux-2.6.24.7/arch/powerpc/boot/dts/storcenter.dts
17764 @@ -0,0 +1,138 @@
17765 +/*
17766 + * Device Tree Source for IOMEGA StorCenter
17767 + *
17768 + * Copyright 2007 Oyvind Repvik
17769 + * Copyright 2007 Jon Loeliger
17770 + *
17771 + * Based on the Kurobox DTS by G. Liakhovetski <g.liakhovetski@gmx.de>
17772 + *
17773 + * This file is licensed under the terms of the GNU General Public
17774 + * License version 2.  This program is licensed "as is" without any
17775 + * warranty of any kind, whether express or implied.
17776 + */
17777 +
17778 +/ {
17779 +       model = "StorCenter";
17780 +       compatible = "storcenter";
17781 +       #address-cells = <1>;
17782 +       #size-cells = <1>;
17783 +
17784 +       aliases {
17785 +               serial0 = &serial0;
17786 +               serial1 = &serial1;
17787 +               pci0 = &pci0;
17788 +       };
17789 +
17790 +       cpus {
17791 +               #address-cells = <1>;
17792 +               #size-cells = <0>;
17793 +
17794 +               PowerPC,8241@0 {
17795 +                       device_type = "cpu";
17796 +                       reg = <0>;
17797 +                       clock-frequency = <d# 200000000>;       /* Hz */
17798 +                       timebase-frequency = <d# 25000000>;     /* Hz */
17799 +                       bus-frequency = <0>;    /* from bootwrapper */
17800 +                       i-cache-line-size = <d# 32>;    /* bytes */
17801 +                       d-cache-line-size = <d# 32>;    /* bytes */
17802 +                       i-cache-size = <4000>;
17803 +                       d-cache-size = <4000>;
17804 +               };
17805 +       };
17806 +
17807 +       memory {
17808 +               device_type = "memory";
17809 +               reg = <00000000 04000000>;      /* 64MB @ 0x0 */
17810 +       };
17811 +
17812 +       soc@fc000000 {
17813 +               #address-cells = <1>;
17814 +               #size-cells = <1>;
17815 +               device_type = "soc";
17816 +               compatible = "fsl,mpc8241", "mpc10x";
17817 +               store-gathering = <0>; /* 0 == off, !0 == on */
17818 +               ranges = <0 fc000000 100000>;
17819 +               reg = <fc000000 100000>;        /* EUMB */
17820 +               bus-frequency = <0>;            /* fixed by loader */
17821 +
17822 +               i2c@3000 {
17823 +                       #address-cells = <1>;
17824 +                       #size-cells = <0>;
17825 +                       compatible = "fsl-i2c";
17826 +                       reg = <3000 100>;
17827 +                       interrupts = <5 2>;
17828 +                       interrupt-parent = <&mpic>;
17829 +
17830 +                       rtc@68 {
17831 +                               compatible = "dallas,ds1337";
17832 +                               reg = <68>;
17833 +                       };
17834 +               };
17835 +
17836 +               serial0: serial@4500 {
17837 +                       cell-index = <0>;
17838 +                       device_type = "serial";
17839 +                       compatible = "ns16550";
17840 +                       reg = <4500 20>;
17841 +                       clock-frequency = <d# 97553800>; /* Hz */
17842 +                       current-speed = <d# 115200>;
17843 +                       interrupts = <9 2>;
17844 +                       interrupt-parent = <&mpic>;
17845 +               };
17846 +
17847 +               serial1: serial@4600 {
17848 +                       cell-index = <1>;
17849 +                       device_type = "serial";
17850 +                       compatible = "ns16550";
17851 +                       reg = <4600 20>;
17852 +                       clock-frequency = <d# 97553800>; /* Hz */
17853 +                       current-speed = <d# 9600>;
17854 +                       interrupts = <a 2>;
17855 +                       interrupt-parent = <&mpic>;
17856 +               };
17857 +
17858 +               mpic: interrupt-controller@40000 {
17859 +                       #interrupt-cells = <2>;
17860 +                       device_type = "open-pic";
17861 +                       compatible = "chrp,open-pic";
17862 +                       interrupt-controller;
17863 +                       reg = <40000 40000>;
17864 +               };
17865 +
17866 +       };
17867 +
17868 +       pci0: pci@fe800000 {
17869 +               #address-cells = <3>;
17870 +               #size-cells = <2>;
17871 +               #interrupt-cells = <1>;
17872 +               device_type = "pci";
17873 +               compatible = "mpc10x-pci";
17874 +               reg = <fe800000 1000>;
17875 +               ranges = <01000000 0        0 fe000000 0 00c00000
17876 +                         02000000 0 80000000 80000000 0 70000000>;
17877 +               bus-range = <0 ff>;
17878 +               clock-frequency = <d# 97553800>; /* Hz */
17879 +               interrupt-parent = <&mpic>;
17880 +               interrupt-map-mask = <f800 0 0 7>;
17881 +               interrupt-map = <
17882 +                       /* IDSEL 13 - IDE */
17883 +                       6800 0 0 1 &mpic 0 1
17884 +                       6800 0 0 2 &mpic 0 1
17885 +                       6800 0 0 3 &mpic 0 1
17886 +                       /* IDSEL 14 - USB */
17887 +                       7000 0 0 1 &mpic 0 1
17888 +                       7000 0 0 2 &mpic 0 1
17889 +                       7000 0 0 3 &mpic 0 1
17890 +                       7000 0 0 4 &mpic 0 1
17891 +                       /* IDSEL 15 - ETH */
17892 +                       7800 0 0 1 &mpic 0 1
17893 +                       7800 0 0 2 &mpic 0 1
17894 +                       7800 0 0 3 &mpic 0 1
17895 +                       7800 0 0 4 &mpic 0 1
17896 +               >;
17897 +       };
17898 +
17899 +       chosen {
17900 +               linux,stdout-path = "/soc/serial@4500";
17901 +       };
17902 +};
17903 Index: linux-2.6.24.7/arch/powerpc/boot/dts/taishan.dts
17904 ===================================================================
17905 --- /dev/null
17906 +++ linux-2.6.24.7/arch/powerpc/boot/dts/taishan.dts
17907 @@ -0,0 +1,383 @@
17908 +/*
17909 + * Device Tree Source for IBM/AMCC Taishan
17910 + *
17911 + * Copyright 2007 IBM Corp.
17912 + * Hugh Blemings <hugh@au.ibm.com> based off code by
17913 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>, David Gibson <dwg@au1.ibm.com>
17914 + *
17915 + * This file is licensed under the terms of the GNU General Public
17916 + * License version 2.  This program is licensed "as is" without
17917 + * any warranty of any kind, whether express or implied.
17918 + */
17919 +
17920 +/ {
17921 +       #address-cells = <2>;
17922 +       #size-cells = <1>;
17923 +       model = "amcc,taishan";
17924 +       compatible = "amcc,taishan";
17925 +       dcr-parent = <&/cpus/cpu@0>;
17926 +
17927 +       aliases {
17928 +               ethernet0 = &EMAC2;
17929 +               ethernet1 = &EMAC3;
17930 +               serial0 = &UART0;
17931 +               serial1 = &UART1;
17932 +       };
17933 +
17934 +       cpus {
17935 +               #address-cells = <1>;
17936 +               #size-cells = <0>;
17937 +
17938 +               cpu@0 {
17939 +                       device_type = "cpu";
17940 +                       model = "PowerPC,440GX";
17941 +                       reg = <0>;
17942 +                       clock-frequency = <2FAF0800>; // 800MHz
17943 +                       timebase-frequency = <0>; // Filled in by zImage
17944 +                       i-cache-line-size = <32>;
17945 +                       d-cache-line-size = <32>;
17946 +                       i-cache-size = <8000>; /* 32 kB */
17947 +                       d-cache-size = <8000>; /* 32 kB */
17948 +                       dcr-controller;
17949 +                       dcr-access-method = "native";
17950 +               };
17951 +       };
17952 +
17953 +       memory {
17954 +               device_type = "memory";
17955 +               reg = <0 0 0>; // Filled in by zImage
17956 +       };
17957 +
17958 +
17959 +       UICB0: interrupt-controller-base {
17960 +               compatible = "ibm,uic-440gx", "ibm,uic";
17961 +               interrupt-controller;
17962 +               cell-index = <3>;
17963 +               dcr-reg = <200 009>;
17964 +               #address-cells = <0>;
17965 +               #size-cells = <0>;
17966 +               #interrupt-cells = <2>;
17967 +       };
17968 +
17969 +
17970 +       UIC0: interrupt-controller0 {
17971 +               compatible = "ibm,uic-440gx", "ibm,uic";
17972 +               interrupt-controller;
17973 +               cell-index = <0>;
17974 +               dcr-reg = <0c0 009>;
17975 +               #address-cells = <0>;
17976 +               #size-cells = <0>;
17977 +               #interrupt-cells = <2>;
17978 +               interrupts = <01 4 00 4>; /* cascade - first non-critical */
17979 +               interrupt-parent = <&UICB0>;
17980 +
17981 +       };
17982 +
17983 +       UIC1: interrupt-controller1 {
17984 +               compatible = "ibm,uic-440gx", "ibm,uic";
17985 +               interrupt-controller;
17986 +               cell-index = <1>;
17987 +               dcr-reg = <0d0 009>;
17988 +               #address-cells = <0>;
17989 +               #size-cells = <0>;
17990 +               #interrupt-cells = <2>;
17991 +               interrupts = <03 4 02 4>; /* cascade */
17992 +               interrupt-parent = <&UICB0>;
17993 +       };
17994 +
17995 +       UIC2: interrupt-controller2 {
17996 +               compatible = "ibm,uic-440gx", "ibm,uic";
17997 +               interrupt-controller;
17998 +               cell-index = <2>; /* was 1 */
17999 +               dcr-reg = <210 009>;
18000 +               #address-cells = <0>;
18001 +               #size-cells = <0>;
18002 +               #interrupt-cells = <2>;
18003 +               interrupts = <05 4 04 4>; /* cascade */
18004 +               interrupt-parent = <&UICB0>;
18005 +       };
18006 +
18007 +
18008 +       CPC0: cpc {
18009 +               compatible = "ibm,cpc-440gp";
18010 +               dcr-reg = <0b0 003 0e0 010>;
18011 +               // FIXME: anything else?
18012 +       };
18013 +
18014 +       plb {
18015 +               compatible = "ibm,plb-440gx", "ibm,plb4";
18016 +               #address-cells = <2>;
18017 +               #size-cells = <1>;
18018 +               ranges;
18019 +               clock-frequency = <9896800>; // 160MHz
18020 +
18021 +               SDRAM0: memory-controller {
18022 +                       compatible = "ibm,sdram-440gp";
18023 +                       dcr-reg = <010 2>;
18024 +                       // FIXME: anything else?
18025 +               };
18026 +
18027 +               SRAM0: sram {
18028 +                       compatible = "ibm,sram-440gp";
18029 +                       dcr-reg = <020 8 00a 1>;
18030 +               };
18031 +
18032 +               DMA0: dma {
18033 +                       // FIXME: ???
18034 +                       compatible = "ibm,dma-440gp";
18035 +                       dcr-reg = <100 027>;
18036 +               };
18037 +
18038 +               MAL0: mcmal {
18039 +                       compatible = "ibm,mcmal-440gx", "ibm,mcmal2";
18040 +                       dcr-reg = <180 62>;
18041 +                       num-tx-chans = <4>;
18042 +                       num-rx-chans = <4>;
18043 +                       interrupt-parent = <&MAL0>;
18044 +                       interrupts = <0 1 2 3 4>;
18045 +                       #interrupt-cells = <1>;
18046 +                       #address-cells = <0>;
18047 +                       #size-cells = <0>;
18048 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
18049 +                                        /*RXEOB*/ 1 &UIC0 b 4
18050 +                                        /*SERR*/  2 &UIC1 0 4
18051 +                                        /*TXDE*/  3 &UIC1 1 4
18052 +                                        /*RXDE*/  4 &UIC1 2 4>;
18053 +                       interrupt-map-mask = <ffffffff>;
18054 +               };
18055 +
18056 +               POB0: opb {
18057 +                       compatible = "ibm,opb-440gx", "ibm,opb";
18058 +                       #address-cells = <1>;
18059 +                       #size-cells = <1>;
18060 +                       /* Wish there was a nicer way of specifying a full 32-bit
18061 +                          range */
18062 +                       ranges = <00000000 1 00000000 80000000
18063 +                                 80000000 1 80000000 80000000>;
18064 +                       dcr-reg = <090 00b>;
18065 +                       interrupt-parent = <&UIC1>;
18066 +                       interrupts = <7 4>;
18067 +                       clock-frequency = <4C4B400>; // 80MHz
18068 +
18069 +
18070 +                       EBC0: ebc {
18071 +                               compatible = "ibm,ebc-440gx", "ibm,ebc";
18072 +                               dcr-reg = <012 2>;
18073 +                               #address-cells = <2>;
18074 +                               #size-cells = <1>;
18075 +                               clock-frequency = <4C4B400>; // 80MHz
18076 +
18077 +                               /* ranges property is supplied by zImage
18078 +                                * based on firmware's configuration of the
18079 +                                * EBC bridge */
18080 +
18081 +                               interrupts = <5 4>;
18082 +                               interrupt-parent = <&UIC1>;
18083 +
18084 +                               /* TODO: Add other EBC devices */
18085 +                       };
18086 +
18087 +
18088 +
18089 +                       UART0: serial@40000200 {
18090 +                               device_type = "serial";
18091 +                               compatible = "ns16550";
18092 +                               reg = <40000200 8>;
18093 +                               virtual-reg = <e0000200>;
18094 +                               clock-frequency = <A8C000>;
18095 +                               current-speed = <1C200>; /* 115200 */
18096 +                               interrupt-parent = <&UIC0>;
18097 +                               interrupts = <0 4>;
18098 +                       };
18099 +
18100 +                       UART1: serial@40000300 {
18101 +                               device_type = "serial";
18102 +                               compatible = "ns16550";
18103 +                               reg = <40000300 8>;
18104 +                               virtual-reg = <e0000300>;
18105 +                               clock-frequency = <A8C000>;
18106 +                               current-speed = <1C200>; /* 115200 */
18107 +                               interrupt-parent = <&UIC0>;
18108 +                               interrupts = <1 4>;
18109 +                       };
18110 +
18111 +                       IIC0: i2c@40000400 {
18112 +                               /* FIXME */
18113 +                               device_type = "i2c";
18114 +                               compatible = "ibm,iic-440gp", "ibm,iic";
18115 +                               reg = <40000400 14>;
18116 +                               interrupt-parent = <&UIC0>;
18117 +                               interrupts = <2 4>;
18118 +                       };
18119 +                       IIC1: i2c@40000500 {
18120 +                               /* FIXME */
18121 +                               device_type = "i2c";
18122 +                               compatible = "ibm,iic-440gp", "ibm,iic";
18123 +                               reg = <40000500 14>;
18124 +                               interrupt-parent = <&UIC0>;
18125 +                               interrupts = <3 4>;
18126 +                       };
18127 +
18128 +                       GPIO0: gpio@40000700 {
18129 +                               /* FIXME */
18130 +                               compatible = "ibm,gpio-440gp";
18131 +                               reg = <40000700 20>;
18132 +                       };
18133 +
18134 +                       ZMII0: emac-zmii@40000780 {
18135 +                               device_type = "zgmii-interface";
18136 +                               compatible = "ibm,zmii-440gx", "ibm,zmii";
18137 +                               reg = <40000780 c>;
18138 +                       };
18139 +
18140 +                       RGMII0: emac-rgmii@40000790 {
18141 +                               device_type = "rgmii-interface";
18142 +                               compatible = "ibm,rgmii";
18143 +                               reg = <40000790 8>;
18144 +                       };
18145 +
18146 +
18147 +                       EMAC0: ethernet@40000800 {
18148 +                               unused = <1>;
18149 +                               linux,network-index = <2>;
18150 +                               device_type = "network";
18151 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18152 +                               interrupt-parent = <&UIC1>;
18153 +                               interrupts = <1c 4 1d 4>;
18154 +                               reg = <40000800 70>;
18155 +                               local-mac-address = [000000000000]; // Filled in by zImage
18156 +                               mal-device = <&MAL0>;
18157 +                               mal-tx-channel = <0>;
18158 +                               mal-rx-channel = <0>;
18159 +                               cell-index = <0>;
18160 +                               max-frame-size = <5dc>;
18161 +                               rx-fifo-size = <1000>;
18162 +                               tx-fifo-size = <800>;
18163 +                               phy-mode = "rmii";
18164 +                               phy-map = <00000001>;
18165 +                               zmii-device = <&ZMII0>;
18166 +                               zmii-channel = <0>;
18167 +                       };
18168 +                       EMAC1: ethernet@40000900 {
18169 +                               unused = <1>;
18170 +                               linux,network-index = <3>;
18171 +                               device_type = "network";
18172 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18173 +                               interrupt-parent = <&UIC1>;
18174 +                               interrupts = <1e 4 1f 4>;
18175 +                               reg = <40000900 70>;
18176 +                               local-mac-address = [000000000000]; // Filled in by zImage
18177 +                               mal-device = <&MAL0>;
18178 +                               mal-tx-channel = <1>;
18179 +                               mal-rx-channel = <1>;
18180 +                               cell-index = <1>;
18181 +                               max-frame-size = <5dc>;
18182 +                               rx-fifo-size = <1000>;
18183 +                               tx-fifo-size = <800>;
18184 +                               phy-mode = "rmii";
18185 +                               phy-map = <00000001>;
18186 +                               zmii-device = <&ZMII0>;
18187 +                               zmii-channel = <1>;
18188 +                       };
18189 +
18190 +                       EMAC2: ethernet@40000c00 {
18191 +                               linux,network-index = <0>;
18192 +                               device_type = "network";
18193 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18194 +                               interrupt-parent = <&UIC2>;
18195 +                               interrupts = <0 4 1 4>;
18196 +                               reg = <40000c00 70>;
18197 +                               local-mac-address = [000000000000]; // Filled in by zImage
18198 +                               mal-device = <&MAL0>;
18199 +                               mal-tx-channel = <2>;
18200 +                               mal-rx-channel = <2>;
18201 +                               cell-index = <2>;
18202 +                               max-frame-size = <5dc>;
18203 +                               rx-fifo-size = <1000>;
18204 +                               tx-fifo-size = <800>;
18205 +                               phy-mode = "rgmii";
18206 +                               phy-map = <00000001>;
18207 +                               rgmii-device = <&RGMII0>;
18208 +                               rgmii-channel = <0>;
18209 +                               zmii-device = <&ZMII0>;
18210 +                               zmii-channel = <2>;
18211 +                       };
18212 +
18213 +                       EMAC3: ethernet@40000e00 {
18214 +                               linux,network-index = <1>;
18215 +                               device_type = "network";
18216 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18217 +                               interrupt-parent = <&UIC2>;
18218 +                               interrupts = <2 4 3 4>;
18219 +                               reg = <40000e00 70>;
18220 +                               local-mac-address = [000000000000]; // Filled in by zImage
18221 +                               mal-device = <&MAL0>;
18222 +                               mal-tx-channel = <3>;
18223 +                               mal-rx-channel = <3>;
18224 +                               cell-index = <3>;
18225 +                               max-frame-size = <5dc>;
18226 +                               rx-fifo-size = <1000>;
18227 +                               tx-fifo-size = <800>;
18228 +                               phy-mode = "rgmii";
18229 +                               phy-map = <00000003>;
18230 +                               rgmii-device = <&RGMII0>;
18231 +                               rgmii-channel = <1>;
18232 +                               zmii-device = <&ZMII0>;
18233 +                               zmii-channel = <3>;
18234 +                       };
18235 +
18236 +
18237 +                       GPT0: gpt@40000a00 {
18238 +                               /* FIXME */
18239 +                               reg = <40000a00 d4>;
18240 +                               interrupt-parent = <&UIC0>;
18241 +                               interrupts = <12 4 13 4 14 4 15 4 16 4>;
18242 +                       };
18243 +
18244 +               };
18245 +
18246 +               PCIX0: pci@20ec00000 {
18247 +                       device_type = "pci";
18248 +                       #interrupt-cells = <1>;
18249 +                       #size-cells = <2>;
18250 +                       #address-cells = <3>;
18251 +                       compatible = "ibm,plb440gp-pcix", "ibm,plb-pcix";
18252 +                       primary;
18253 +                       large-inbound-windows;
18254 +                       enable-msi-hole;
18255 +                       reg = <2 0ec00000   8   /* Config space access */
18256 +                              0 0 0            /* no IACK cycles */
18257 +                              2 0ed00000   4   /* Special cycles */
18258 +                              2 0ec80000 100   /* Internal registers */
18259 +                              2 0ec80100  fc>; /* Internal messaging registers */
18260 +
18261 +                       /* Outbound ranges, one memory and one IO,
18262 +                        * later cannot be changed
18263 +                        */
18264 +                       ranges = <02000000 0 80000000 00000003 80000000 0 80000000
18265 +                                 01000000 0 00000000 00000002 08000000 0 00010000>;
18266 +
18267 +                       /* Inbound 2GB range starting at 0 */
18268 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
18269 +
18270 +                       interrupt-map-mask = <f800 0 0 7>;
18271 +                       interrupt-map = <
18272 +                               /* IDSEL 1 */
18273 +                               0800 0 0 1 &UIC0 17 8
18274 +                               0800 0 0 2 &UIC0 18 8
18275 +                               0800 0 0 3 &UIC0 19 8
18276 +                               0800 0 0 4 &UIC0 1a 8
18277 +
18278 +                               /* IDSEL 2 */
18279 +                               1000 0 0 1 &UIC0 18 8
18280 +                               1000 0 0 2 &UIC0 19 8
18281 +                               1000 0 0 3 &UIC0 1a 8
18282 +                               1000 0 0 4 &UIC0 17 8
18283 +                       >;
18284 +               };
18285 +       };
18286 +
18287 +       chosen {
18288 +               linux,stdout-path = "/plb/opb/serial@40000300";
18289 +       };
18290 +};
18291 Index: linux-2.6.24.7/arch/powerpc/boot/dts/tqm5200.dts
18292 ===================================================================
18293 --- /dev/null
18294 +++ linux-2.6.24.7/arch/powerpc/boot/dts/tqm5200.dts
18295 @@ -0,0 +1,184 @@
18296 +/*
18297 + * TQM5200 board Device Tree Source
18298 + *
18299 + * Copyright (C) 2007 Semihalf
18300 + * Marian Balakowicz <m8@semihalf.com>
18301 + *
18302 + * This program is free software; you can redistribute  it and/or modify it
18303 + * under  the terms of  the GNU General  Public License as published by the
18304 + * Free Software Foundation;  either version 2 of the  License, or (at your
18305 + * option) any later version.
18306 + */
18307 +
18308 +/*
18309 + * WARNING: Do not depend on this tree layout remaining static just yet.
18310 + * The MPC5200 device tree conventions are still in flux
18311 + * Keep an eye on the linuxppc-dev mailing list for more details
18312 + */
18313 +
18314 +/ {
18315 +       model = "tqc,tqm5200";
18316 +       compatible = "tqc,tqm5200";
18317 +       #address-cells = <1>;
18318 +       #size-cells = <1>;
18319 +
18320 +       cpus {
18321 +               #address-cells = <1>;
18322 +               #size-cells = <0>;
18323 +
18324 +               PowerPC,5200@0 {
18325 +                       device_type = "cpu";
18326 +                       reg = <0>;
18327 +                       d-cache-line-size = <20>;
18328 +                       i-cache-line-size = <20>;
18329 +                       d-cache-size = <4000>;          // L1, 16K
18330 +                       i-cache-size = <4000>;          // L1, 16K
18331 +                       timebase-frequency = <0>;       // from bootloader
18332 +                       bus-frequency = <0>;            // from bootloader
18333 +                       clock-frequency = <0>;          // from bootloader
18334 +               };
18335 +       };
18336 +
18337 +       memory {
18338 +               device_type = "memory";
18339 +               reg = <00000000 04000000>;      // 64MB
18340 +       };
18341 +
18342 +       soc5200@f0000000 {
18343 +               model = "fsl,mpc5200";
18344 +               compatible = "fsl,mpc5200";
18345 +               revision = "";                  // from bootloader
18346 +               device_type = "soc";
18347 +               ranges = <0 f0000000 0000c000>;
18348 +               reg = <f0000000 00000100>;
18349 +               bus-frequency = <0>;            // from bootloader
18350 +               system-frequency = <0>;         // from bootloader
18351 +
18352 +               cdm@200 {
18353 +                       compatible = "mpc5200-cdm";
18354 +                       reg = <200 38>;
18355 +               };
18356 +
18357 +               mpc5200_pic: pic@500 {
18358 +                       // 5200 interrupts are encoded into two levels;
18359 +                       interrupt-controller;
18360 +                       #interrupt-cells = <3>;
18361 +                       compatible = "mpc5200-pic";
18362 +                       reg = <500 80>;
18363 +               };
18364 +
18365 +               gpt@600 {       // General Purpose Timer
18366 +                       compatible = "fsl,mpc5200-gpt";
18367 +                       reg = <600 10>;
18368 +                       interrupts = <1 9 0>;
18369 +                       interrupt-parent = <&mpc5200_pic>;
18370 +                       fsl,has-wdt;
18371 +               };
18372 +
18373 +               gpio@b00 {
18374 +                       compatible = "mpc5200-gpio";
18375 +                       reg = <b00 40>;
18376 +                       interrupts = <1 7 0>;
18377 +                       interrupt-parent = <&mpc5200_pic>;
18378 +               };
18379 +
18380 +               usb@1000 {
18381 +                       compatible = "mpc5200-ohci","ohci-be";
18382 +                       reg = <1000 ff>;
18383 +                       interrupts = <2 6 0>;
18384 +                       interrupt-parent = <&mpc5200_pic>;
18385 +               };
18386 +
18387 +               dma-controller@1200 {
18388 +                       compatible = "mpc5200-bestcomm";
18389 +                       reg = <1200 80>;
18390 +                       interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
18391 +                                     3 4 0  3 5 0  3 6 0  3 7 0
18392 +                                     3 8 0  3 9 0  3 a 0  3 b 0
18393 +                                     3 c 0  3 d 0  3 e 0  3 f 0>;
18394 +                       interrupt-parent = <&mpc5200_pic>;
18395 +               };
18396 +
18397 +               xlb@1f00 {
18398 +                       compatible = "mpc5200-xlb";
18399 +                       reg = <1f00 100>;
18400 +               };
18401 +
18402 +               serial@2000 {           // PSC1
18403 +                       device_type = "serial";
18404 +                       compatible = "mpc5200-psc-uart";
18405 +                       port-number = <0>;  // Logical port assignment
18406 +                       reg = <2000 100>;
18407 +                       interrupts = <2 1 0>;
18408 +                       interrupt-parent = <&mpc5200_pic>;
18409 +               };
18410 +
18411 +               serial@2200 {           // PSC2
18412 +                       device_type = "serial";
18413 +                       compatible = "mpc5200-psc-uart";
18414 +                       port-number = <1>;  // Logical port assignment
18415 +                       reg = <2200 100>;
18416 +                       interrupts = <2 2 0>;
18417 +                       interrupt-parent = <&mpc5200_pic>;
18418 +               };
18419 +
18420 +               serial@2400 {           // PSC3
18421 +                       device_type = "serial";
18422 +                       compatible = "mpc5200-psc-uart";
18423 +                       port-number = <2>;  // Logical port assignment
18424 +                       reg = <2400 100>;
18425 +                       interrupts = <2 3 0>;
18426 +                       interrupt-parent = <&mpc5200_pic>;
18427 +               };
18428 +
18429 +               ethernet@3000 {
18430 +                       device_type = "network";
18431 +                       compatible = "mpc5200-fec";
18432 +                       reg = <3000 800>;
18433 +                       local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
18434 +                       interrupts = <2 5 0>;
18435 +                       interrupt-parent = <&mpc5200_pic>;
18436 +               };
18437 +
18438 +               ata@3a00 {
18439 +                       compatible = "mpc5200-ata";
18440 +                       reg = <3a00 100>;
18441 +                       interrupts = <2 7 0>;
18442 +                       interrupt-parent = <&mpc5200_pic>;
18443 +               };
18444 +
18445 +               i2c@3d40 {
18446 +                       compatible = "mpc5200-i2c","fsl-i2c";
18447 +                       reg = <3d40 40>;
18448 +                       interrupts = <2 10 0>;
18449 +                       interrupt-parent = <&mpc5200_pic>;
18450 +                       fsl5200-clocking;
18451 +               };
18452 +
18453 +               sram@8000 {
18454 +                       compatible = "mpc5200-sram";
18455 +                       reg = <8000 4000>;
18456 +               };
18457 +       };
18458 +
18459 +       pci@f0000d00 {
18460 +               #interrupt-cells = <1>;
18461 +               #size-cells = <2>;
18462 +               #address-cells = <3>;
18463 +               device_type = "pci";
18464 +               compatible = "fsl,mpc5200-pci";
18465 +               reg = <f0000d00 100>;
18466 +               interrupt-map-mask = <f800 0 0 7>;
18467 +               interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3
18468 +                                c000 0 0 2 &mpc5200_pic 0 0 3
18469 +                                c000 0 0 3 &mpc5200_pic 0 0 3
18470 +                                c000 0 0 4 &mpc5200_pic 0 0 3>;
18471 +               clock-frequency = <0>; // From boot loader
18472 +               interrupts = <2 8 0 2 9 0 2 a 0>;
18473 +               interrupt-parent = <&mpc5200_pic>;
18474 +               bus-range = <0 0>;
18475 +               ranges = <42000000 0 80000000 80000000 0 10000000
18476 +                         02000000 0 90000000 90000000 0 10000000
18477 +                         01000000 0 00000000 a0000000 0 01000000>;
18478 +       };
18479 +};
18480 Index: linux-2.6.24.7/arch/powerpc/boot/dts/walnut.dts
18481 ===================================================================
18482 --- linux-2.6.24.7.orig/arch/powerpc/boot/dts/walnut.dts
18483 +++ linux-2.6.24.7/arch/powerpc/boot/dts/walnut.dts
18484 @@ -14,14 +14,21 @@
18485         #size-cells = <1>;
18486         model = "ibm,walnut";
18487         compatible = "ibm,walnut";
18488 -       dcr-parent = <&/cpus/PowerPC,405GP@0>;
18489 +       dcr-parent = <&/cpus/cpu@0>;
18490 +
18491 +       aliases {
18492 +               ethernet0 = &EMAC;
18493 +               serial0 = &UART0;
18494 +               serial1 = &UART1;
18495 +       };
18496  
18497         cpus {
18498                 #address-cells = <1>;
18499                 #size-cells = <0>;
18500  
18501 -               PowerPC,405GP@0 {
18502 +               cpu@0 {
18503                         device_type = "cpu";
18504 +                       model = "PowerPC,405GP";
18505                         reg = <0>;
18506                         clock-frequency = <bebc200>; /* Filled in by zImage */
18507                         timebase-frequency = <0>; /* Filled in by zImage */
18508 @@ -168,9 +175,10 @@
18509                                 };
18510                         };
18511  
18512 -                       ds1743@1,0 {
18513 +                       nvram@1,0 {
18514                                 /* NVRAM and RTC */
18515 -                               compatible = "ds1743";
18516 +                               compatible = "ds1743-nvram";
18517 +                               #bytes = <2000>;
18518                                 reg = <1 0 2000>;
18519                         };
18520  
18521 @@ -190,6 +198,45 @@
18522                                 virtual-reg = <f0300005>;
18523                         };
18524                 };
18525 +
18526 +               PCI0: pci@ec000000 {
18527 +                       device_type = "pci";
18528 +                       #interrupt-cells = <1>;
18529 +                       #size-cells = <2>;
18530 +                       #address-cells = <3>;
18531 +                       compatible = "ibm,plb405gp-pci", "ibm,plb-pci";
18532 +                       primary;
18533 +                       reg = <eec00000 8       /* Config space access */
18534 +                              eed80000 4       /* IACK */
18535 +                              eed80000 4       /* Special cycle */
18536 +                              ef480000 40>;    /* Internal registers */
18537 +
18538 +                       /* Outbound ranges, one memory and one IO,
18539 +                        * later cannot be changed. Chip supports a second
18540 +                        * IO range but we don't use it for now
18541 +                        */
18542 +                       ranges = <02000000 0 80000000 80000000 0 20000000
18543 +                                 01000000 0 00000000 e8000000 0 00010000>;
18544 +
18545 +                       /* Inbound 2GB range starting at 0 */
18546 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
18547 +
18548 +                       /* Walnut has all 4 IRQ pins tied together per slot */
18549 +                       interrupt-map-mask = <f800 0 0 0>;
18550 +                       interrupt-map = <
18551 +                               /* IDSEL 1 */
18552 +                               0800 0 0 0 &UIC0 1c 8
18553 +
18554 +                               /* IDSEL 2 */
18555 +                               1000 0 0 0 &UIC0 1d 8
18556 +
18557 +                               /* IDSEL 3 */
18558 +                               1800 0 0 0 &UIC0 1e 8
18559 +
18560 +                               /* IDSEL 4 */
18561 +                               2000 0 0 0 &UIC0 1f 8
18562 +                       >;
18563 +               };
18564         };
18565  
18566         chosen {
18567 Index: linux-2.6.24.7/arch/powerpc/boot/dts/warp.dts
18568 ===================================================================
18569 --- /dev/null
18570 +++ linux-2.6.24.7/arch/powerpc/boot/dts/warp.dts
18571 @@ -0,0 +1,239 @@
18572 +/*
18573 + * Device Tree Source for PIKA Warp
18574 + *
18575 + * Copyright (c) 2008 PIKA Technologies
18576 + *   Sean MacLennan <smaclennan@pikatech.com>
18577 + *
18578 + * This file is licensed under the terms of the GNU General Public
18579 + * License version 2.  This program is licensed "as is" without
18580 + * any warranty of any kind, whether express or implied.
18581 + */
18582 +
18583 +/ {
18584 +       #address-cells = <2>;
18585 +       #size-cells = <1>;
18586 +       model = "pika,warp";
18587 +       compatible = "pika,warp";
18588 +       dcr-parent = <&/cpus/cpu@0>;
18589 +
18590 +       aliases {
18591 +               ethernet0 = &EMAC0;
18592 +               serial0 = &UART0;
18593 +       };
18594 +
18595 +       cpus {
18596 +               #address-cells = <1>;
18597 +               #size-cells = <0>;
18598 +
18599 +               cpu@0 {
18600 +                       device_type = "cpu";
18601 +                       model = "PowerPC,440EP";
18602 +                       reg = <0>;
18603 +                       clock-frequency = <0>; /* Filled in by zImage */
18604 +                       timebase-frequency = <0>; /* Filled in by zImage */
18605 +                       i-cache-line-size = <20>;
18606 +                       d-cache-line-size = <20>;
18607 +                       i-cache-size = <8000>;
18608 +                       d-cache-size = <8000>;
18609 +                       dcr-controller;
18610 +                       dcr-access-method = "native";
18611 +               };
18612 +       };
18613 +
18614 +       memory {
18615 +               device_type = "memory";
18616 +               reg = <0 0 0>; /* Filled in by zImage */
18617 +       };
18618 +
18619 +       UIC0: interrupt-controller0 {
18620 +               compatible = "ibm,uic-440ep","ibm,uic";
18621 +               interrupt-controller;
18622 +               cell-index = <0>;
18623 +               dcr-reg = <0c0 009>;
18624 +               #address-cells = <0>;
18625 +               #size-cells = <0>;
18626 +               #interrupt-cells = <2>;
18627 +       };
18628 +
18629 +       UIC1: interrupt-controller1 {
18630 +               compatible = "ibm,uic-440ep","ibm,uic";
18631 +               interrupt-controller;
18632 +               cell-index = <1>;
18633 +               dcr-reg = <0d0 009>;
18634 +               #address-cells = <0>;
18635 +               #size-cells = <0>;
18636 +               #interrupt-cells = <2>;
18637 +               interrupts = <1e 4 1f 4>; /* cascade */
18638 +               interrupt-parent = <&UIC0>;
18639 +       };
18640 +
18641 +       SDR0: sdr {
18642 +               compatible = "ibm,sdr-440ep";
18643 +               dcr-reg = <00e 002>;
18644 +       };
18645 +
18646 +       CPR0: cpr {
18647 +               compatible = "ibm,cpr-440ep";
18648 +               dcr-reg = <00c 002>;
18649 +       };
18650 +
18651 +       plb {
18652 +               compatible = "ibm,plb-440ep", "ibm,plb-440gp", "ibm,plb4";
18653 +               #address-cells = <2>;
18654 +               #size-cells = <1>;
18655 +               ranges;
18656 +               clock-frequency = <0>; /* Filled in by zImage */
18657 +
18658 +               SDRAM0: sdram {
18659 +                       compatible = "ibm,sdram-440ep", "ibm,sdram-405gp";
18660 +                       dcr-reg = <010 2>;
18661 +               };
18662 +
18663 +               DMA0: dma {
18664 +                       compatible = "ibm,dma-440ep", "ibm,dma-440gp";
18665 +                       dcr-reg = <100 027>;
18666 +               };
18667 +
18668 +               MAL0: mcmal {
18669 +                       compatible = "ibm,mcmal-440ep", "ibm,mcmal-440gp", "ibm,mcmal";
18670 +                       dcr-reg = <180 62>;
18671 +                       num-tx-chans = <4>;
18672 +                       num-rx-chans = <2>;
18673 +                       interrupt-parent = <&MAL0>;
18674 +                       interrupts = <0 1 2 3 4>;
18675 +                       #interrupt-cells = <1>;
18676 +                       #address-cells = <0>;
18677 +                       #size-cells = <0>;
18678 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
18679 +                                       /*RXEOB*/ 1 &UIC0 b 4
18680 +                                       /*SERR*/  2 &UIC1 0 4
18681 +                                       /*TXDE*/  3 &UIC1 1 4
18682 +                                       /*RXDE*/  4 &UIC1 2 4>;
18683 +               };
18684 +
18685 +               POB0: opb {
18686 +                       compatible = "ibm,opb-440ep", "ibm,opb-440gp", "ibm,opb";
18687 +                       #address-cells = <1>;
18688 +                       #size-cells = <1>;
18689 +                       ranges = <00000000 0 00000000 80000000
18690 +                                 80000000 0 80000000 80000000>;
18691 +                       interrupt-parent = <&UIC1>;
18692 +                       interrupts = <7 4>;
18693 +                       clock-frequency = <0>; /* Filled in by zImage */
18694 +
18695 +                       EBC0: ebc {
18696 +                               compatible = "ibm,ebc-440ep", "ibm,ebc-440gp", "ibm,ebc";
18697 +                               dcr-reg = <012 2>;
18698 +                               #address-cells = <2>;
18699 +                               #size-cells = <1>;
18700 +                               clock-frequency = <0>; /* Filled in by zImage */
18701 +                               interrupts = <5 1>;
18702 +                               interrupt-parent = <&UIC1>;
18703 +
18704 +                               fpga@2,0 {
18705 +                                       compatible = "pika,fpga";
18706 +                                       reg = <2 0 2200>;
18707 +                                       interrupts = <18 8>;
18708 +                                       interrupt-parent = <&UIC0>;
18709 +                               };
18710 +
18711 +                               nor_flash@0,0 {
18712 +                                       compatible = "amd,s29gl512n", "cfi-flash";
18713 +                                       bank-width = <2>;
18714 +                                       reg = <0 0 4000000>;
18715 +                                       #address-cells = <1>;
18716 +                                       #size-cells = <1>;
18717 +                                       partition@0 {
18718 +                                               label = "kernel";
18719 +                                               reg = <0 180000>;
18720 +                                       };
18721 +                                       partition@180000 {
18722 +                                               label = "root";
18723 +                                               reg = <180000 3480000>;
18724 +                                       };
18725 +                                       partition@3600000 {
18726 +                                               label = "user";
18727 +                                               reg = <3600000 900000>;
18728 +                                       };
18729 +                                       partition@3f00000 {
18730 +                                               label = "fpga";
18731 +                                               reg = <3f00000 40000>;
18732 +                                       };
18733 +                                       partition@3f40000 {
18734 +                                               label = "env";
18735 +                                               reg = <3f40000 40000>;
18736 +                                       };
18737 +                                       partition@3f80000 {
18738 +                                               label = "u-boot";
18739 +                                               reg = <3f80000 80000>;
18740 +                                       };
18741 +                               };
18742 +                       };
18743 +
18744 +                       UART0: serial@ef600300 {
18745 +                               device_type = "serial";
18746 +                               compatible = "ns16550";
18747 +                               reg = <ef600300 8>;
18748 +                               virtual-reg = <ef600300>;
18749 +                               clock-frequency = <0>; /* Filled in by zImage */
18750 +                               current-speed = <1c200>;
18751 +                               interrupt-parent = <&UIC0>;
18752 +                               interrupts = <0 4>;
18753 +                       };
18754 +
18755 +                       IIC0: i2c@ef600700 {
18756 +                               compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
18757 +                               reg = <ef600700 14>;
18758 +                               interrupt-parent = <&UIC0>;
18759 +                               interrupts = <2 4>;
18760 +                       };
18761 +
18762 +                       GPIO0: gpio@ef600b00 {
18763 +                               compatible = "ibm,gpio-440ep";
18764 +                               reg = <ef600b00 48>;
18765 +                       };
18766 +
18767 +                       GPIO1: gpio@ef600c00 {
18768 +                               compatible = "ibm,gpio-440ep";
18769 +                               reg = <ef600c00 48>;
18770 +                       };
18771 +
18772 +                       ZMII0: emac-zmii@ef600d00 {
18773 +                               compatible = "ibm,zmii-440ep", "ibm,zmii-440gp", "ibm,zmii";
18774 +                               reg = <ef600d00 c>;
18775 +                       };
18776 +
18777 +                       EMAC0: ethernet@ef600e00 {
18778 +                               linux,network-index = <0>;
18779 +                               device_type = "network";
18780 +                               compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
18781 +                               interrupt-parent = <&UIC1>;
18782 +                               interrupts = <1c 4 1d 4>;
18783 +                               reg = <ef600e00 70>;
18784 +                               local-mac-address = [000000000000];
18785 +                               mal-device = <&MAL0>;
18786 +                               mal-tx-channel = <0 1>;
18787 +                               mal-rx-channel = <0>;
18788 +                               cell-index = <0>;
18789 +                               max-frame-size = <5dc>;
18790 +                               rx-fifo-size = <1000>;
18791 +                               tx-fifo-size = <800>;
18792 +                               phy-mode = "rmii";
18793 +                               phy-map = <00000000>;
18794 +                               zmii-device = <&ZMII0>;
18795 +                               zmii-channel = <0>;
18796 +                       };
18797 +
18798 +                       usb@ef601000 {
18799 +                               compatible = "ohci-be";
18800 +                               reg = <ef601000 80>;
18801 +                               interrupts = <8 1 9 1>;
18802 +                               interrupt-parent = < &UIC1 >;
18803 +                       };
18804 +               };
18805 +       };
18806 +
18807 +       chosen {
18808 +               linux,stdout-path = "/plb/opb/serial@ef600300";
18809 +       };
18810 +};
18811 Index: linux-2.6.24.7/arch/powerpc/boot/ebony.c
18812 ===================================================================
18813 --- linux-2.6.24.7.orig/arch/powerpc/boot/ebony.c
18814 +++ linux-2.6.24.7/arch/powerpc/boot/ebony.c
18815 @@ -31,66 +31,6 @@
18816  
18817  static u8 *ebony_mac0, *ebony_mac1;
18818  
18819 -/* Calculate 440GP clocks */
18820 -void ibm440gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
18821 -{
18822 -       u32 sys0 = mfdcr(DCRN_CPC0_SYS0);
18823 -       u32 cr0 = mfdcr(DCRN_CPC0_CR0);
18824 -       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
18825 -       u32 opdv = CPC0_SYS0_OPDV(sys0);
18826 -       u32 epdv = CPC0_SYS0_EPDV(sys0);
18827 -
18828 -       if (sys0 & CPC0_SYS0_BYPASS) {
18829 -               /* Bypass system PLL */
18830 -               cpu = plb = sysclk;
18831 -       } else {
18832 -               if (sys0 & CPC0_SYS0_EXTSL)
18833 -                       /* PerClk */
18834 -                       m = CPC0_SYS0_FWDVB(sys0) * opdv * epdv;
18835 -               else
18836 -                       /* CPU clock */
18837 -                       m = CPC0_SYS0_FBDV(sys0) * CPC0_SYS0_FWDVA(sys0);
18838 -               cpu = sysclk * m / CPC0_SYS0_FWDVA(sys0);
18839 -               plb = sysclk * m / CPC0_SYS0_FWDVB(sys0);
18840 -       }
18841 -
18842 -       opb = plb / opdv;
18843 -       ebc = opb / epdv;
18844 -
18845 -       /* FIXME: Check if this is for all 440GP, or just Ebony */
18846 -       if ((mfpvr() & 0xf0000fff) == 0x40000440)
18847 -               /* Rev. B 440GP, use external system clock */
18848 -               tb = sysclk;
18849 -       else
18850 -               /* Rev. C 440GP, errata force us to use internal clock */
18851 -               tb = cpu;
18852 -
18853 -       if (cr0 & CPC0_CR0_U0EC)
18854 -               /* External UART clock */
18855 -               uart0 = ser_clk;
18856 -       else
18857 -               /* Internal UART clock */
18858 -               uart0 = plb / CPC0_CR0_UDIV(cr0);
18859 -
18860 -       if (cr0 & CPC0_CR0_U1EC)
18861 -               /* External UART clock */
18862 -               uart1 = ser_clk;
18863 -       else
18864 -               /* Internal UART clock */
18865 -               uart1 = plb / CPC0_CR0_UDIV(cr0);
18866 -
18867 -       printf("PPC440GP: SysClk = %dMHz (%x)\n\r",
18868 -              (sysclk + 500000) / 1000000, sysclk);
18869 -
18870 -       dt_fixup_cpu_clocks(cpu, tb, 0);
18871 -
18872 -       dt_fixup_clock("/plb", plb);
18873 -       dt_fixup_clock("/plb/opb", opb);
18874 -       dt_fixup_clock("/plb/opb/ebc", ebc);
18875 -       dt_fixup_clock("/plb/opb/serial@40000200", uart0);
18876 -       dt_fixup_clock("/plb/opb/serial@40000300", uart1);
18877 -}
18878 -
18879  #define EBONY_FPGA_PATH                "/plb/opb/ebc/fpga"
18880  #define        EBONY_FPGA_FLASH_SEL    0x01
18881  #define EBONY_SMALL_FLASH_PATH "/plb/opb/ebc/small-flash"
18882 @@ -134,7 +74,7 @@ static void ebony_fixups(void)
18883         unsigned long sysclk = 33000000;
18884  
18885         ibm440gp_fixup_clocks(sysclk, 6 * 1843200);
18886 -       ibm4xx_fixup_memsize();
18887 +       ibm4xx_sdram_fixup_memsize();
18888         dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
18889         ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
18890         ebony_flashsel_fixup();
18891 @@ -146,6 +86,6 @@ void ebony_init(void *mac0, void *mac1)
18892         platform_ops.exit = ibm44x_dbcr_reset;
18893         ebony_mac0 = mac0;
18894         ebony_mac1 = mac1;
18895 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
18896 +       fdt_init(_dtb_start);
18897         serial_console_init();
18898  }
18899 Index: linux-2.6.24.7/arch/powerpc/boot/ep405.c
18900 ===================================================================
18901 --- /dev/null
18902 +++ linux-2.6.24.7/arch/powerpc/boot/ep405.c
18903 @@ -0,0 +1,74 @@
18904 +/*
18905 + * Embedded Planet EP405 with PlanetCore firmware
18906 + *
18907 + * (c) Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp,\
18908 + *
18909 + * Based on ep88xc.c by
18910 + *
18911 + * Scott Wood <scottwood@freescale.com>
18912 + *
18913 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
18914 + *
18915 + * This program is free software; you can redistribute it and/or modify it
18916 + * under the terms of the GNU General Public License version 2 as published
18917 + * by the Free Software Foundation.
18918 + */
18919 +
18920 +#include "ops.h"
18921 +#include "stdio.h"
18922 +#include "planetcore.h"
18923 +#include "dcr.h"
18924 +#include "4xx.h"
18925 +#include "io.h"
18926 +
18927 +static char *table;
18928 +static u64 mem_size;
18929 +
18930 +static void platform_fixups(void)
18931 +{
18932 +       u64 val;
18933 +       void *nvrtc;
18934 +
18935 +       dt_fixup_memory(0, mem_size);
18936 +       planetcore_set_mac_addrs(table);
18937 +
18938 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
18939 +               printf("No PlanetCore crystal frequency key.\r\n");
18940 +               return;
18941 +       }
18942 +       ibm405gp_fixup_clocks(val, 0xa8c000);
18943 +       ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
18944 +       ibm4xx_fixup_ebc_ranges("/plb/ebc");
18945 +
18946 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_KB_NVRAM, &val)) {
18947 +               printf("No PlanetCore NVRAM size key.\r\n");
18948 +               return;
18949 +       }
18950 +       nvrtc = finddevice("/plb/ebc/nvrtc@4,200000");
18951 +       if (nvrtc != NULL) {
18952 +               u32 reg[3] = { 4, 0x200000, 0};
18953 +               getprop(nvrtc, "reg", reg, 3);
18954 +               reg[2] = (val << 10) & 0xffffffff;
18955 +               setprop(nvrtc, "reg", reg, 3);
18956 +       }
18957 +}
18958 +
18959 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
18960 +                  unsigned long r6, unsigned long r7)
18961 +{
18962 +       table = (char *)r3;
18963 +       planetcore_prepare_table(table);
18964 +
18965 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_MB_RAM, &mem_size))
18966 +               return;
18967 +
18968 +       mem_size *= 1024 * 1024;
18969 +       simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
18970 +
18971 +       fdt_init(_dtb_start);
18972 +
18973 +       planetcore_set_stdout_path(table);
18974 +
18975 +       serial_console_init();
18976 +       platform_ops.fixups = platform_fixups;
18977 +}
18978 Index: linux-2.6.24.7/arch/powerpc/boot/ep8248e.c
18979 ===================================================================
18980 --- /dev/null
18981 +++ linux-2.6.24.7/arch/powerpc/boot/ep8248e.c
18982 @@ -0,0 +1,55 @@
18983 +/*
18984 + * Embedded Planet EP8248E with PlanetCore firmware
18985 + *
18986 + * Author: Scott Wood <scottwood@freescale.com>
18987 + *
18988 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
18989 + *
18990 + * This program is free software; you can redistribute it and/or modify it
18991 + * under the terms of the GNU General Public License version 2 as published
18992 + * by the Free Software Foundation.
18993 + */
18994 +
18995 +#include "ops.h"
18996 +#include "stdio.h"
18997 +#include "planetcore.h"
18998 +#include "pq2.h"
18999 +
19000 +static char *table;
19001 +static u64 mem_size;
19002 +
19003 +#include <io.h>
19004 +
19005 +static void platform_fixups(void)
19006 +{
19007 +       u64 val;
19008 +
19009 +       dt_fixup_memory(0, mem_size);
19010 +       planetcore_set_mac_addrs(table);
19011 +
19012 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
19013 +               printf("No PlanetCore crystal frequency key.\r\n");
19014 +               return;
19015 +       }
19016 +
19017 +       pq2_fixup_clocks(val);
19018 +}
19019 +
19020 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
19021 +                   unsigned long r6, unsigned long r7)
19022 +{
19023 +       table = (char *)r3;
19024 +       planetcore_prepare_table(table);
19025 +
19026 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_MB_RAM, &mem_size))
19027 +               return;
19028 +
19029 +       mem_size *= 1024 * 1024;
19030 +       simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
19031 +
19032 +       fdt_init(_dtb_start);
19033 +
19034 +       planetcore_set_stdout_path(table);
19035 +       serial_console_init();
19036 +       platform_ops.fixups = platform_fixups;
19037 +}
19038 Index: linux-2.6.24.7/arch/powerpc/boot/ep88xc.c
19039 ===================================================================
19040 --- linux-2.6.24.7.orig/arch/powerpc/boot/ep88xc.c
19041 +++ linux-2.6.24.7/arch/powerpc/boot/ep88xc.c
19042 @@ -45,7 +45,7 @@ void platform_init(unsigned long r3, uns
19043         mem_size *= 1024 * 1024;
19044         simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
19045  
19046 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
19047 +       fdt_init(_dtb_start);
19048  
19049         planetcore_set_stdout_path(table);
19050  
19051 Index: linux-2.6.24.7/arch/powerpc/boot/flatdevtree.c
19052 ===================================================================
19053 --- linux-2.6.24.7.orig/arch/powerpc/boot/flatdevtree.c
19054 +++ /dev/null
19055 @@ -1,1036 +0,0 @@
19056 -/*
19057 - * This program is free software; you can redistribute it and/or modify
19058 - * it under the terms of the GNU General Public License as published by
19059 - * the Free Software Foundation; either version 2 of the License, or
19060 - * (at your option) any later version.
19061 - *
19062 - * This program is distributed in the hope that it will be useful,
19063 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
19064 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19065 - * GNU General Public License for more details.
19066 - *
19067 - * You should have received a copy of the GNU General Public License
19068 - * along with this program; if not, write to the Free Software
19069 - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19070 - *
19071 - * Copyright Pantelis Antoniou 2006
19072 - * Copyright (C) IBM Corporation 2006
19073 - *
19074 - * Authors: Pantelis Antoniou <pantelis@embeddedalley.com>
19075 - *         Hollis Blanchard <hollisb@us.ibm.com>
19076 - *         Mark A. Greer <mgreer@mvista.com>
19077 - *         Paul Mackerras <paulus@samba.org>
19078 - */
19079 -
19080 -#include <string.h>
19081 -#include <stddef.h>
19082 -#include "flatdevtree.h"
19083 -#include "flatdevtree_env.h"
19084 -
19085 -#define _ALIGN(x, al)  (((x) + (al) - 1) & ~((al) - 1))
19086 -
19087 -static char *ft_root_node(struct ft_cxt *cxt)
19088 -{
19089 -       return cxt->rgn[FT_STRUCT].start;
19090 -}
19091 -
19092 -/* Routines for keeping node ptrs returned by ft_find_device current */
19093 -/* First entry not used b/c it would return 0 and be taken as NULL/error */
19094 -static void *ft_get_phandle(struct ft_cxt *cxt, char *node)
19095 -{
19096 -       unsigned int i;
19097 -
19098 -       if (!node)
19099 -               return NULL;
19100 -
19101 -       for (i = 1; i < cxt->nodes_used; i++)   /* already there? */
19102 -               if (cxt->node_tbl[i] == node)
19103 -                       return (void *)i;
19104 -
19105 -       if (cxt->nodes_used < cxt->node_max) {
19106 -               cxt->node_tbl[cxt->nodes_used] = node;
19107 -               return (void *)cxt->nodes_used++;
19108 -       }
19109 -
19110 -       return NULL;
19111 -}
19112 -
19113 -static char *ft_node_ph2node(struct ft_cxt *cxt, const void *phandle)
19114 -{
19115 -       unsigned int i = (unsigned int)phandle;
19116 -
19117 -       if (i < cxt->nodes_used)
19118 -               return cxt->node_tbl[i];
19119 -       return NULL;
19120 -}
19121 -
19122 -static void ft_node_update_before(struct ft_cxt *cxt, char *addr, int shift)
19123 -{
19124 -       unsigned int i;
19125 -
19126 -       if (shift == 0)
19127 -               return;
19128 -
19129 -       for (i = 1; i < cxt->nodes_used; i++)
19130 -               if (cxt->node_tbl[i] < addr)
19131 -                       cxt->node_tbl[i] += shift;
19132 -}
19133 -
19134 -static void ft_node_update_after(struct ft_cxt *cxt, char *addr, int shift)
19135 -{
19136 -       unsigned int i;
19137 -
19138 -       if (shift == 0)
19139 -               return;
19140 -
19141 -       for (i = 1; i < cxt->nodes_used; i++)
19142 -               if (cxt->node_tbl[i] >= addr)
19143 -                       cxt->node_tbl[i] += shift;
19144 -}
19145 -
19146 -/* Struct used to return info from ft_next() */
19147 -struct ft_atom {
19148 -       u32 tag;
19149 -       const char *name;
19150 -       void *data;
19151 -       u32 size;
19152 -};
19153 -
19154 -/* Set ptrs to current one's info; return addr of next one */
19155 -static char *ft_next(struct ft_cxt *cxt, char *p, struct ft_atom *ret)
19156 -{
19157 -       u32 sz;
19158 -
19159 -       if (p >= cxt->rgn[FT_STRUCT].start + cxt->rgn[FT_STRUCT].size)
19160 -               return NULL;
19161 -
19162 -       ret->tag = be32_to_cpu(*(u32 *) p);
19163 -       p += 4;
19164 -
19165 -       switch (ret->tag) {     /* Tag */
19166 -       case OF_DT_BEGIN_NODE:
19167 -               ret->name = p;
19168 -               ret->data = (void *)(p - 4);    /* start of node */
19169 -               p += _ALIGN(strlen(p) + 1, 4);
19170 -               break;
19171 -       case OF_DT_PROP:
19172 -               ret->size = sz = be32_to_cpu(*(u32 *) p);
19173 -               ret->name = cxt->str_anchor + be32_to_cpu(*(u32 *) (p + 4));
19174 -               ret->data = (void *)(p + 8);
19175 -               p += 8 + _ALIGN(sz, 4);
19176 -               break;
19177 -       case OF_DT_END_NODE:
19178 -       case OF_DT_NOP:
19179 -               break;
19180 -       case OF_DT_END:
19181 -       default:
19182 -               p = NULL;
19183 -               break;
19184 -       }
19185 -
19186 -       return p;
19187 -}
19188 -
19189 -#define HDR_SIZE       _ALIGN(sizeof(struct boot_param_header), 8)
19190 -#define EXPAND_INCR    1024    /* alloc this much extra when expanding */
19191 -
19192 -/* Copy the tree to a newly-allocated region and put things in order */
19193 -static int ft_reorder(struct ft_cxt *cxt, int nextra)
19194 -{
19195 -       unsigned long tot;
19196 -       enum ft_rgn_id r;
19197 -       char *p, *pend;
19198 -       int stroff;
19199 -
19200 -       tot = HDR_SIZE + EXPAND_INCR;
19201 -       for (r = FT_RSVMAP; r <= FT_STRINGS; ++r)
19202 -               tot += cxt->rgn[r].size;
19203 -       if (nextra > 0)
19204 -               tot += nextra;
19205 -       tot = _ALIGN(tot, 8);
19206 -
19207 -       if (!cxt->realloc)
19208 -               return 0;
19209 -       p = cxt->realloc(NULL, tot);
19210 -       if (!p)
19211 -               return 0;
19212 -
19213 -       memcpy(p, cxt->bph, sizeof(struct boot_param_header));
19214 -       /* offsets get fixed up later */
19215 -
19216 -       cxt->bph = (struct boot_param_header *)p;
19217 -       cxt->max_size = tot;
19218 -       pend = p + tot;
19219 -       p += HDR_SIZE;
19220 -
19221 -       memcpy(p, cxt->rgn[FT_RSVMAP].start, cxt->rgn[FT_RSVMAP].size);
19222 -       cxt->rgn[FT_RSVMAP].start = p;
19223 -       p += cxt->rgn[FT_RSVMAP].size;
19224 -
19225 -       memcpy(p, cxt->rgn[FT_STRUCT].start, cxt->rgn[FT_STRUCT].size);
19226 -       ft_node_update_after(cxt, cxt->rgn[FT_STRUCT].start,
19227 -                       p - cxt->rgn[FT_STRUCT].start);
19228 -       cxt->p += p - cxt->rgn[FT_STRUCT].start;
19229 -       cxt->rgn[FT_STRUCT].start = p;
19230 -
19231 -       p = pend - cxt->rgn[FT_STRINGS].size;
19232 -       memcpy(p, cxt->rgn[FT_STRINGS].start, cxt->rgn[FT_STRINGS].size);
19233 -       stroff = cxt->str_anchor - cxt->rgn[FT_STRINGS].start;
19234 -       cxt->rgn[FT_STRINGS].start = p;
19235 -       cxt->str_anchor = p + stroff;
19236 -
19237 -       cxt->isordered = 1;
19238 -       return 1;
19239 -}
19240 -
19241 -static inline char *prev_end(struct ft_cxt *cxt, enum ft_rgn_id r)
19242 -{
19243 -       if (r > FT_RSVMAP)
19244 -               return cxt->rgn[r - 1].start + cxt->rgn[r - 1].size;
19245 -       return (char *)cxt->bph + HDR_SIZE;
19246 -}
19247 -
19248 -static inline char *next_start(struct ft_cxt *cxt, enum ft_rgn_id r)
19249 -{
19250 -       if (r < FT_STRINGS)
19251 -               return cxt->rgn[r + 1].start;
19252 -       return (char *)cxt->bph + cxt->max_size;
19253 -}
19254 -
19255 -/*
19256 - * See if we can expand region rgn by nextra bytes by using up
19257 - * free space after or before the region.
19258 - */
19259 -static int ft_shuffle(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
19260 -               int nextra)
19261 -{
19262 -       char *p = *pp;
19263 -       char *rgn_start, *rgn_end;
19264 -
19265 -       rgn_start = cxt->rgn[rgn].start;
19266 -       rgn_end = rgn_start + cxt->rgn[rgn].size;
19267 -       if (nextra <= 0 || rgn_end + nextra <= next_start(cxt, rgn)) {
19268 -               /* move following stuff */
19269 -               if (p < rgn_end) {
19270 -                       if (nextra < 0)
19271 -                               memmove(p, p - nextra, rgn_end - p + nextra);
19272 -                       else
19273 -                               memmove(p + nextra, p, rgn_end - p);
19274 -                       if (rgn == FT_STRUCT)
19275 -                               ft_node_update_after(cxt, p, nextra);
19276 -               }
19277 -               cxt->rgn[rgn].size += nextra;
19278 -               if (rgn == FT_STRINGS)
19279 -                       /* assumes strings only added at beginning */
19280 -                       cxt->str_anchor += nextra;
19281 -               return 1;
19282 -       }
19283 -       if (prev_end(cxt, rgn) <= rgn_start - nextra) {
19284 -               /* move preceding stuff */
19285 -               if (p > rgn_start) {
19286 -                       memmove(rgn_start - nextra, rgn_start, p - rgn_start);
19287 -                       if (rgn == FT_STRUCT)
19288 -                               ft_node_update_before(cxt, p, -nextra);
19289 -               }
19290 -               *pp -= nextra;
19291 -               cxt->rgn[rgn].start -= nextra;
19292 -               cxt->rgn[rgn].size += nextra;
19293 -               return 1;
19294 -       }
19295 -       return 0;
19296 -}
19297 -
19298 -static int ft_make_space(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
19299 -                        int nextra)
19300 -{
19301 -       unsigned long size, ssize, tot;
19302 -       char *str, *next;
19303 -       enum ft_rgn_id r;
19304 -
19305 -       if (!cxt->isordered) {
19306 -               unsigned long rgn_off = *pp - cxt->rgn[rgn].start;
19307 -
19308 -               if (!ft_reorder(cxt, nextra))
19309 -                       return 0;
19310 -
19311 -               *pp = cxt->rgn[rgn].start + rgn_off;
19312 -       }
19313 -       if (ft_shuffle(cxt, pp, rgn, nextra))
19314 -               return 1;
19315 -
19316 -       /* See if there is space after the strings section */
19317 -       ssize = cxt->rgn[FT_STRINGS].size;
19318 -       if (cxt->rgn[FT_STRINGS].start + ssize
19319 -                       < (char *)cxt->bph + cxt->max_size) {
19320 -               /* move strings up as far as possible */
19321 -               str = (char *)cxt->bph + cxt->max_size - ssize;
19322 -               cxt->str_anchor += str - cxt->rgn[FT_STRINGS].start;
19323 -               memmove(str, cxt->rgn[FT_STRINGS].start, ssize);
19324 -               cxt->rgn[FT_STRINGS].start = str;
19325 -               /* enough space now? */
19326 -               if (rgn >= FT_STRUCT && ft_shuffle(cxt, pp, rgn, nextra))
19327 -                       return 1;
19328 -       }
19329 -
19330 -       /* how much total free space is there following this region? */
19331 -       tot = 0;
19332 -       for (r = rgn; r < FT_STRINGS; ++r) {
19333 -               char *r_end = cxt->rgn[r].start + cxt->rgn[r].size;
19334 -               tot += next_start(cxt, rgn) - r_end;
19335 -       }
19336 -
19337 -       /* cast is to shut gcc up; we know nextra >= 0 */
19338 -       if (tot < (unsigned int)nextra) {
19339 -               /* have to reallocate */
19340 -               char *newp, *new_start;
19341 -               int shift;
19342 -
19343 -               if (!cxt->realloc)
19344 -                       return 0;
19345 -               size = _ALIGN(cxt->max_size + (nextra - tot) + EXPAND_INCR, 8);
19346 -               newp = cxt->realloc(cxt->bph, size);
19347 -               if (!newp)
19348 -                       return 0;
19349 -               cxt->max_size = size;
19350 -               shift = newp - (char *)cxt->bph;
19351 -
19352 -               if (shift) { /* realloc can return same addr */
19353 -                       cxt->bph = (struct boot_param_header *)newp;
19354 -                       ft_node_update_after(cxt, cxt->rgn[FT_STRUCT].start,
19355 -                                       shift);
19356 -                       for (r = FT_RSVMAP; r <= FT_STRINGS; ++r) {
19357 -                               new_start = cxt->rgn[r].start + shift;
19358 -                               cxt->rgn[r].start = new_start;
19359 -                       }
19360 -                       *pp += shift;
19361 -                       cxt->str_anchor += shift;
19362 -               }
19363 -
19364 -               /* move strings up to the end */
19365 -               str = newp + size - ssize;
19366 -               cxt->str_anchor += str - cxt->rgn[FT_STRINGS].start;
19367 -               memmove(str, cxt->rgn[FT_STRINGS].start, ssize);
19368 -               cxt->rgn[FT_STRINGS].start = str;
19369 -
19370 -               if (ft_shuffle(cxt, pp, rgn, nextra))
19371 -                       return 1;
19372 -       }
19373 -
19374 -       /* must be FT_RSVMAP and we need to move FT_STRUCT up */
19375 -       if (rgn == FT_RSVMAP) {
19376 -               next = cxt->rgn[FT_RSVMAP].start + cxt->rgn[FT_RSVMAP].size
19377 -                       + nextra;
19378 -               ssize = cxt->rgn[FT_STRUCT].size;
19379 -               if (next + ssize >= cxt->rgn[FT_STRINGS].start)
19380 -                       return 0;       /* "can't happen" */
19381 -               memmove(next, cxt->rgn[FT_STRUCT].start, ssize);
19382 -               ft_node_update_after(cxt, cxt->rgn[FT_STRUCT].start, nextra);
19383 -               cxt->rgn[FT_STRUCT].start = next;
19384 -
19385 -               if (ft_shuffle(cxt, pp, rgn, nextra))
19386 -                       return 1;
19387 -       }
19388 -
19389 -       return 0;               /* "can't happen" */
19390 -}
19391 -
19392 -static void ft_put_word(struct ft_cxt *cxt, u32 v)
19393 -{
19394 -       *(u32 *) cxt->p = cpu_to_be32(v);
19395 -       cxt->p += 4;
19396 -}
19397 -
19398 -static void ft_put_bin(struct ft_cxt *cxt, const void *data, unsigned int sz)
19399 -{
19400 -       unsigned long sza = _ALIGN(sz, 4);
19401 -
19402 -       /* zero out the alignment gap if necessary */
19403 -       if (sz < sza)
19404 -               *(u32 *) (cxt->p + sza - 4) = 0;
19405 -
19406 -       /* copy in the data */
19407 -       memcpy(cxt->p, data, sz);
19408 -
19409 -       cxt->p += sza;
19410 -}
19411 -
19412 -char *ft_begin_node(struct ft_cxt *cxt, const char *name)
19413 -{
19414 -       unsigned long nlen = strlen(name) + 1;
19415 -       unsigned long len = 8 + _ALIGN(nlen, 4);
19416 -       char *ret;
19417 -
19418 -       if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, len))
19419 -               return NULL;
19420 -
19421 -       ret = cxt->p;
19422 -
19423 -       ft_put_word(cxt, OF_DT_BEGIN_NODE);
19424 -       ft_put_bin(cxt, name, strlen(name) + 1);
19425 -
19426 -       return ret;
19427 -}
19428 -
19429 -void ft_end_node(struct ft_cxt *cxt)
19430 -{
19431 -       ft_put_word(cxt, OF_DT_END_NODE);
19432 -}
19433 -
19434 -void ft_nop(struct ft_cxt *cxt)
19435 -{
19436 -       if (ft_make_space(cxt, &cxt->p, FT_STRUCT, 4))
19437 -               ft_put_word(cxt, OF_DT_NOP);
19438 -}
19439 -
19440 -#define NO_STRING      0x7fffffff
19441 -
19442 -static int lookup_string(struct ft_cxt *cxt, const char *name)
19443 -{
19444 -       char *p, *end;
19445 -
19446 -       p = cxt->rgn[FT_STRINGS].start;
19447 -       end = p + cxt->rgn[FT_STRINGS].size;
19448 -       while (p < end) {
19449 -               if (strcmp(p, (char *)name) == 0)
19450 -                       return p - cxt->str_anchor;
19451 -               p += strlen(p) + 1;
19452 -       }
19453 -
19454 -       return NO_STRING;
19455 -}
19456 -
19457 -/* lookup string and insert if not found */
19458 -static int map_string(struct ft_cxt *cxt, const char *name)
19459 -{
19460 -       int off;
19461 -       char *p;
19462 -
19463 -       off = lookup_string(cxt, name);
19464 -       if (off != NO_STRING)
19465 -               return off;
19466 -       p = cxt->rgn[FT_STRINGS].start;
19467 -       if (!ft_make_space(cxt, &p, FT_STRINGS, strlen(name) + 1))
19468 -               return NO_STRING;
19469 -       strcpy(p, name);
19470 -       return p - cxt->str_anchor;
19471 -}
19472 -
19473 -int ft_prop(struct ft_cxt *cxt, const char *name, const void *data,
19474 -               unsigned int sz)
19475 -{
19476 -       int off, len;
19477 -
19478 -       off = map_string(cxt, name);
19479 -       if (off == NO_STRING)
19480 -               return -1;
19481 -
19482 -       len = 12 + _ALIGN(sz, 4);
19483 -       if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, len))
19484 -               return -1;
19485 -
19486 -       ft_put_word(cxt, OF_DT_PROP);
19487 -       ft_put_word(cxt, sz);
19488 -       ft_put_word(cxt, off);
19489 -       ft_put_bin(cxt, data, sz);
19490 -       return 0;
19491 -}
19492 -
19493 -int ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str)
19494 -{
19495 -       return ft_prop(cxt, name, str, strlen(str) + 1);
19496 -}
19497 -
19498 -int ft_prop_int(struct ft_cxt *cxt, const char *name, unsigned int val)
19499 -{
19500 -       u32 v = cpu_to_be32((u32) val);
19501 -
19502 -       return ft_prop(cxt, name, &v, 4);
19503 -}
19504 -
19505 -/* Calculate the size of the reserved map */
19506 -static unsigned long rsvmap_size(struct ft_cxt *cxt)
19507 -{
19508 -       struct ft_reserve *res;
19509 -
19510 -       res = (struct ft_reserve *)cxt->rgn[FT_RSVMAP].start;
19511 -       while (res->start || res->len)
19512 -               ++res;
19513 -       return (char *)(res + 1) - cxt->rgn[FT_RSVMAP].start;
19514 -}
19515 -
19516 -/* Calculate the size of the struct region by stepping through it */
19517 -static unsigned long struct_size(struct ft_cxt *cxt)
19518 -{
19519 -       char *p = cxt->rgn[FT_STRUCT].start;
19520 -       char *next;
19521 -       struct ft_atom atom;
19522 -
19523 -       /* make check in ft_next happy */
19524 -       if (cxt->rgn[FT_STRUCT].size == 0)
19525 -               cxt->rgn[FT_STRUCT].size = 0xfffffffful - (unsigned long)p;
19526 -
19527 -       while ((next = ft_next(cxt, p, &atom)) != NULL)
19528 -               p = next;
19529 -       return p + 4 - cxt->rgn[FT_STRUCT].start;
19530 -}
19531 -
19532 -/* add `adj' on to all string offset values in the struct area */
19533 -static void adjust_string_offsets(struct ft_cxt *cxt, int adj)
19534 -{
19535 -       char *p = cxt->rgn[FT_STRUCT].start;
19536 -       char *next;
19537 -       struct ft_atom atom;
19538 -       int off;
19539 -
19540 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19541 -               if (atom.tag == OF_DT_PROP) {
19542 -                       off = be32_to_cpu(*(u32 *) (p + 8));
19543 -                       *(u32 *) (p + 8) = cpu_to_be32(off + adj);
19544 -               }
19545 -               p = next;
19546 -       }
19547 -}
19548 -
19549 -/* start construction of the flat OF tree from scratch */
19550 -void ft_begin(struct ft_cxt *cxt, void *blob, unsigned int max_size,
19551 -               void *(*realloc_fn) (void *, unsigned long))
19552 -{
19553 -       struct boot_param_header *bph = blob;
19554 -       char *p;
19555 -       struct ft_reserve *pres;
19556 -
19557 -       /* clear the cxt */
19558 -       memset(cxt, 0, sizeof(*cxt));
19559 -
19560 -       cxt->bph = bph;
19561 -       cxt->max_size = max_size;
19562 -       cxt->realloc = realloc_fn;
19563 -       cxt->isordered = 1;
19564 -
19565 -       /* zero everything in the header area */
19566 -       memset(bph, 0, sizeof(*bph));
19567 -
19568 -       bph->magic = cpu_to_be32(OF_DT_HEADER);
19569 -       bph->version = cpu_to_be32(0x10);
19570 -       bph->last_comp_version = cpu_to_be32(0x10);
19571 -
19572 -       /* start pointers */
19573 -       cxt->rgn[FT_RSVMAP].start = p = blob + HDR_SIZE;
19574 -       cxt->rgn[FT_RSVMAP].size = sizeof(struct ft_reserve);
19575 -       pres = (struct ft_reserve *)p;
19576 -       cxt->rgn[FT_STRUCT].start = p += sizeof(struct ft_reserve);
19577 -       cxt->rgn[FT_STRUCT].size = 4;
19578 -       cxt->rgn[FT_STRINGS].start = blob + max_size;
19579 -       cxt->rgn[FT_STRINGS].size = 0;
19580 -
19581 -       /* init rsvmap and struct */
19582 -       pres->start = 0;
19583 -       pres->len = 0;
19584 -       *(u32 *) p = cpu_to_be32(OF_DT_END);
19585 -
19586 -       cxt->str_anchor = blob;
19587 -}
19588 -
19589 -/* open up an existing blob to be examined or modified */
19590 -int ft_open(struct ft_cxt *cxt, void *blob, unsigned int max_size,
19591 -               unsigned int max_find_device,
19592 -               void *(*realloc_fn) (void *, unsigned long))
19593 -{
19594 -       struct boot_param_header *bph = blob;
19595 -
19596 -       /* can't cope with version < 16 */
19597 -       if (be32_to_cpu(bph->version) < 16)
19598 -               return -1;
19599 -
19600 -       /* clear the cxt */
19601 -       memset(cxt, 0, sizeof(*cxt));
19602 -
19603 -       /* alloc node_tbl to track node ptrs returned by ft_find_device */
19604 -       ++max_find_device;
19605 -       cxt->node_tbl = realloc_fn(NULL, max_find_device * sizeof(char *));
19606 -       if (!cxt->node_tbl)
19607 -               return -1;
19608 -       memset(cxt->node_tbl, 0, max_find_device * sizeof(char *));
19609 -       cxt->node_max = max_find_device;
19610 -       cxt->nodes_used = 1;    /* don't use idx 0 b/c looks like NULL */
19611 -
19612 -       cxt->bph = bph;
19613 -       cxt->max_size = max_size;
19614 -       cxt->realloc = realloc_fn;
19615 -
19616 -       cxt->rgn[FT_RSVMAP].start = blob + be32_to_cpu(bph->off_mem_rsvmap);
19617 -       cxt->rgn[FT_RSVMAP].size = rsvmap_size(cxt);
19618 -       cxt->rgn[FT_STRUCT].start = blob + be32_to_cpu(bph->off_dt_struct);
19619 -       cxt->rgn[FT_STRUCT].size = struct_size(cxt);
19620 -       cxt->rgn[FT_STRINGS].start = blob + be32_to_cpu(bph->off_dt_strings);
19621 -       cxt->rgn[FT_STRINGS].size = be32_to_cpu(bph->dt_strings_size);
19622 -
19623 -       cxt->p = cxt->rgn[FT_STRUCT].start;
19624 -       cxt->str_anchor = cxt->rgn[FT_STRINGS].start;
19625 -
19626 -       return 0;
19627 -}
19628 -
19629 -/* add a reserver physical area to the rsvmap */
19630 -int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size)
19631 -{
19632 -       char *p;
19633 -       struct ft_reserve *pres;
19634 -
19635 -       p = cxt->rgn[FT_RSVMAP].start + cxt->rgn[FT_RSVMAP].size
19636 -               - sizeof(struct ft_reserve);
19637 -       if (!ft_make_space(cxt, &p, FT_RSVMAP, sizeof(struct ft_reserve)))
19638 -               return -1;
19639 -
19640 -       pres = (struct ft_reserve *)p;
19641 -       pres->start = cpu_to_be64(physaddr);
19642 -       pres->len = cpu_to_be64(size);
19643 -
19644 -       return 0;
19645 -}
19646 -
19647 -void ft_begin_tree(struct ft_cxt *cxt)
19648 -{
19649 -       cxt->p = ft_root_node(cxt);
19650 -}
19651 -
19652 -void ft_end_tree(struct ft_cxt *cxt)
19653 -{
19654 -       struct boot_param_header *bph = cxt->bph;
19655 -       char *p, *oldstr, *str, *endp;
19656 -       unsigned long ssize;
19657 -       int adj;
19658 -
19659 -       if (!cxt->isordered)
19660 -               return;         /* we haven't touched anything */
19661 -
19662 -       /* adjust string offsets */
19663 -       oldstr = cxt->rgn[FT_STRINGS].start;
19664 -       adj = cxt->str_anchor - oldstr;
19665 -       if (adj)
19666 -               adjust_string_offsets(cxt, adj);
19667 -
19668 -       /* make strings end on 8-byte boundary */
19669 -       ssize = cxt->rgn[FT_STRINGS].size;
19670 -       endp = (char *)_ALIGN((unsigned long)cxt->rgn[FT_STRUCT].start
19671 -                       + cxt->rgn[FT_STRUCT].size + ssize, 8);
19672 -       str = endp - ssize;
19673 -
19674 -       /* move strings down to end of structs */
19675 -       memmove(str, oldstr, ssize);
19676 -       cxt->str_anchor = str;
19677 -       cxt->rgn[FT_STRINGS].start = str;
19678 -
19679 -       /* fill in header fields */
19680 -       p = (char *)bph;
19681 -       bph->totalsize = cpu_to_be32(endp - p);
19682 -       bph->off_mem_rsvmap = cpu_to_be32(cxt->rgn[FT_RSVMAP].start - p);
19683 -       bph->off_dt_struct = cpu_to_be32(cxt->rgn[FT_STRUCT].start - p);
19684 -       bph->off_dt_strings = cpu_to_be32(cxt->rgn[FT_STRINGS].start - p);
19685 -       bph->dt_strings_size = cpu_to_be32(ssize);
19686 -}
19687 -
19688 -void *ft_find_device(struct ft_cxt *cxt, const void *top, const char *srch_path)
19689 -{
19690 -       char *node;
19691 -
19692 -       if (top) {
19693 -               node = ft_node_ph2node(cxt, top);
19694 -               if (node == NULL)
19695 -                       return NULL;
19696 -       } else {
19697 -               node = ft_root_node(cxt);
19698 -       }
19699 -
19700 -       node = ft_find_descendent(cxt, node, srch_path);
19701 -       return ft_get_phandle(cxt, node);
19702 -}
19703 -
19704 -void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path)
19705 -{
19706 -       struct ft_atom atom;
19707 -       char *p;
19708 -       const char *cp, *q;
19709 -       int cl;
19710 -       int depth = -1;
19711 -       int dmatch = 0;
19712 -       const char *path_comp[FT_MAX_DEPTH];
19713 -
19714 -       cp = srch_path;
19715 -       cl = 0;
19716 -       p = top;
19717 -
19718 -       while ((p = ft_next(cxt, p, &atom)) != NULL) {
19719 -               switch (atom.tag) {
19720 -               case OF_DT_BEGIN_NODE:
19721 -                       ++depth;
19722 -                       if (depth != dmatch)
19723 -                               break;
19724 -                       cxt->genealogy[depth] = atom.data;
19725 -                       cxt->genealogy[depth + 1] = NULL;
19726 -                       if (depth && !(strncmp(atom.name, cp, cl) == 0
19727 -                                       && (atom.name[cl] == '/'
19728 -                                               || atom.name[cl] == '\0'
19729 -                                               || atom.name[cl] == '@')))
19730 -                               break;
19731 -                       path_comp[dmatch] = cp;
19732 -                       /* it matches so far, advance to next path component */
19733 -                       cp += cl;
19734 -                       /* skip slashes */
19735 -                       while (*cp == '/')
19736 -                               ++cp;
19737 -                       /* we're done if this is the end of the string */
19738 -                       if (*cp == 0)
19739 -                               return atom.data;
19740 -                       /* look for end of this component */
19741 -                       q = strchr(cp, '/');
19742 -                       if (q)
19743 -                               cl = q - cp;
19744 -                       else
19745 -                               cl = strlen(cp);
19746 -                       ++dmatch;
19747 -                       break;
19748 -               case OF_DT_END_NODE:
19749 -                       if (depth == 0)
19750 -                               return NULL;
19751 -                       if (dmatch > depth) {
19752 -                               --dmatch;
19753 -                               cl = cp - path_comp[dmatch] - 1;
19754 -                               cp = path_comp[dmatch];
19755 -                               while (cl > 0 && cp[cl - 1] == '/')
19756 -                                       --cl;
19757 -                       }
19758 -                       --depth;
19759 -                       break;
19760 -               }
19761 -       }
19762 -       return NULL;
19763 -}
19764 -
19765 -void *__ft_get_parent(struct ft_cxt *cxt, void *node)
19766 -{
19767 -       int d;
19768 -       struct ft_atom atom;
19769 -       char *p;
19770 -
19771 -       for (d = 0; cxt->genealogy[d] != NULL; ++d)
19772 -               if (cxt->genealogy[d] == node)
19773 -                       return d > 0 ? cxt->genealogy[d - 1] : NULL;
19774 -
19775 -       /* have to do it the hard way... */
19776 -       p = ft_root_node(cxt);
19777 -       d = 0;
19778 -       while ((p = ft_next(cxt, p, &atom)) != NULL) {
19779 -               switch (atom.tag) {
19780 -               case OF_DT_BEGIN_NODE:
19781 -                       cxt->genealogy[d] = atom.data;
19782 -                       if (node == atom.data) {
19783 -                               /* found it */
19784 -                               cxt->genealogy[d + 1] = NULL;
19785 -                               return d > 0 ? cxt->genealogy[d - 1] : NULL;
19786 -                       }
19787 -                       ++d;
19788 -                       break;
19789 -               case OF_DT_END_NODE:
19790 -                       --d;
19791 -                       break;
19792 -               }
19793 -       }
19794 -       return NULL;
19795 -}
19796 -
19797 -void *ft_get_parent(struct ft_cxt *cxt, const void *phandle)
19798 -{
19799 -       void *node = ft_node_ph2node(cxt, phandle);
19800 -       if (node == NULL)
19801 -               return NULL;
19802 -
19803 -       node = __ft_get_parent(cxt, node);
19804 -       return ft_get_phandle(cxt, node);
19805 -}
19806 -
19807 -static const void *__ft_get_prop(struct ft_cxt *cxt, void *node,
19808 -                                 const char *propname, unsigned int *len)
19809 -{
19810 -       struct ft_atom atom;
19811 -       int depth = 0;
19812 -
19813 -       while ((node = ft_next(cxt, node, &atom)) != NULL) {
19814 -               switch (atom.tag) {
19815 -               case OF_DT_BEGIN_NODE:
19816 -                       ++depth;
19817 -                       break;
19818 -
19819 -               case OF_DT_PROP:
19820 -                       if (depth != 1 || strcmp(atom.name, propname))
19821 -                               break;
19822 -
19823 -                       if (len)
19824 -                               *len = atom.size;
19825 -
19826 -                       return atom.data;
19827 -
19828 -               case OF_DT_END_NODE:
19829 -                       if (--depth <= 0)
19830 -                               return NULL;
19831 -               }
19832 -       }
19833 -
19834 -       return NULL;
19835 -}
19836 -
19837 -int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
19838 -               void *buf, const unsigned int buflen)
19839 -{
19840 -       const void *data;
19841 -       unsigned int size;
19842 -
19843 -       void *node = ft_node_ph2node(cxt, phandle);
19844 -       if (!node)
19845 -               return -1;
19846 -
19847 -       data = __ft_get_prop(cxt, node, propname, &size);
19848 -       if (data) {
19849 -               unsigned int clipped_size = min(size, buflen);
19850 -               memcpy(buf, data, clipped_size);
19851 -               return size;
19852 -       }
19853 -
19854 -       return -1;
19855 -}
19856 -
19857 -void *__ft_find_node_by_prop_value(struct ft_cxt *cxt, void *prev,
19858 -                                   const char *propname, const char *propval,
19859 -                                   unsigned int proplen)
19860 -{
19861 -       struct ft_atom atom;
19862 -       char *p = ft_root_node(cxt);
19863 -       char *next;
19864 -       int past_prev = prev ? 0 : 1;
19865 -       int depth = -1;
19866 -
19867 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19868 -               const void *data;
19869 -               unsigned int size;
19870 -
19871 -               switch (atom.tag) {
19872 -               case OF_DT_BEGIN_NODE:
19873 -                       depth++;
19874 -
19875 -                       if (prev == p) {
19876 -                               past_prev = 1;
19877 -                               break;
19878 -                       }
19879 -
19880 -                       if (!past_prev || depth < 1)
19881 -                               break;
19882 -
19883 -                       data = __ft_get_prop(cxt, p, propname, &size);
19884 -                       if (!data || size != proplen)
19885 -                               break;
19886 -                       if (memcmp(data, propval, size))
19887 -                               break;
19888 -
19889 -                       return p;
19890 -
19891 -               case OF_DT_END_NODE:
19892 -                       if (depth-- == 0)
19893 -                               return NULL;
19894 -
19895 -                       break;
19896 -               }
19897 -
19898 -               p = next;
19899 -       }
19900 -
19901 -       return NULL;
19902 -}
19903 -
19904 -void *ft_find_node_by_prop_value(struct ft_cxt *cxt, const void *prev,
19905 -                                 const char *propname, const char *propval,
19906 -                                 int proplen)
19907 -{
19908 -       void *node = NULL;
19909 -
19910 -       if (prev) {
19911 -               node = ft_node_ph2node(cxt, prev);
19912 -
19913 -               if (!node)
19914 -                       return NULL;
19915 -       }
19916 -
19917 -       node = __ft_find_node_by_prop_value(cxt, node, propname,
19918 -                                           propval, proplen);
19919 -       return ft_get_phandle(cxt, node);
19920 -}
19921 -
19922 -int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
19923 -               const void *buf, const unsigned int buflen)
19924 -{
19925 -       struct ft_atom atom;
19926 -       void *node;
19927 -       char *p, *next;
19928 -       int nextra;
19929 -
19930 -       node = ft_node_ph2node(cxt, phandle);
19931 -       if (node == NULL)
19932 -               return -1;
19933 -
19934 -       next = ft_next(cxt, node, &atom);
19935 -       if (atom.tag != OF_DT_BEGIN_NODE)
19936 -               /* phandle didn't point to a node */
19937 -               return -1;
19938 -       p = next;
19939 -
19940 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19941 -               switch (atom.tag) {
19942 -               case OF_DT_BEGIN_NODE: /* properties must go before subnodes */
19943 -               case OF_DT_END_NODE:
19944 -                       /* haven't found the property, insert here */
19945 -                       cxt->p = p;
19946 -                       return ft_prop(cxt, propname, buf, buflen);
19947 -               case OF_DT_PROP:
19948 -                       if (strcmp(atom.name, propname))
19949 -                               break;
19950 -                       /* found an existing property, overwrite it */
19951 -                       nextra = _ALIGN(buflen, 4) - _ALIGN(atom.size, 4);
19952 -                       cxt->p = atom.data;
19953 -                       if (nextra && !ft_make_space(cxt, &cxt->p, FT_STRUCT,
19954 -                                               nextra))
19955 -                               return -1;
19956 -                       *(u32 *) (cxt->p - 8) = cpu_to_be32(buflen);
19957 -                       ft_put_bin(cxt, buf, buflen);
19958 -                       return 0;
19959 -               }
19960 -               p = next;
19961 -       }
19962 -       return -1;
19963 -}
19964 -
19965 -int ft_del_prop(struct ft_cxt *cxt, const void *phandle, const char *propname)
19966 -{
19967 -       struct ft_atom atom;
19968 -       void *node;
19969 -       char *p, *next;
19970 -       int size;
19971 -
19972 -       node = ft_node_ph2node(cxt, phandle);
19973 -       if (node == NULL)
19974 -               return -1;
19975 -
19976 -       p = node;
19977 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19978 -               switch (atom.tag) {
19979 -               case OF_DT_BEGIN_NODE:
19980 -               case OF_DT_END_NODE:
19981 -                       return -1;
19982 -               case OF_DT_PROP:
19983 -                       if (strcmp(atom.name, propname))
19984 -                               break;
19985 -                       /* found the property, remove it */
19986 -                       size = 12 + -_ALIGN(atom.size, 4);
19987 -                       cxt->p = p;
19988 -                       if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, -size))
19989 -                               return -1;
19990 -                       return 0;
19991 -               }
19992 -               p = next;
19993 -       }
19994 -       return -1;
19995 -}
19996 -
19997 -void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name)
19998 -{
19999 -       struct ft_atom atom;
20000 -       char *p, *next, *ret;
20001 -       int depth = 0;
20002 -
20003 -       if (parent) {
20004 -               p = ft_node_ph2node(cxt, parent);
20005 -               if (!p)
20006 -                       return NULL;
20007 -       } else {
20008 -               p = ft_root_node(cxt);
20009 -       }
20010 -
20011 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
20012 -               switch (atom.tag) {
20013 -               case OF_DT_BEGIN_NODE:
20014 -                       ++depth;
20015 -                       if (depth == 1 && strcmp(atom.name, name) == 0)
20016 -                               /* duplicate node name, return error */
20017 -                               return NULL;
20018 -                       break;
20019 -               case OF_DT_END_NODE:
20020 -                       --depth;
20021 -                       if (depth > 0)
20022 -                               break;
20023 -                       /* end of node, insert here */
20024 -                       cxt->p = p;
20025 -                       ret = ft_begin_node(cxt, name);
20026 -                       ft_end_node(cxt);
20027 -                       return ft_get_phandle(cxt, ret);
20028 -               }
20029 -               p = next;
20030 -       }
20031 -       return NULL;
20032 -}
20033 -
20034 -/* Returns the start of the path within the provided buffer, or NULL on
20035 - * error.
20036 - */
20037 -char *ft_get_path(struct ft_cxt *cxt, const void *phandle,
20038 -                  char *buf, int len)
20039 -{
20040 -       const char *path_comp[FT_MAX_DEPTH];
20041 -       struct ft_atom atom;
20042 -       char *p, *next, *pos;
20043 -       int depth = 0, i;
20044 -       void *node;
20045 -
20046 -       node = ft_node_ph2node(cxt, phandle);
20047 -       if (node == NULL)
20048 -               return NULL;
20049 -
20050 -       p = ft_root_node(cxt);
20051 -
20052 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
20053 -               switch (atom.tag) {
20054 -               case OF_DT_BEGIN_NODE:
20055 -                       path_comp[depth++] = atom.name;
20056 -                       if (p == node)
20057 -                               goto found;
20058 -
20059 -                       break;
20060 -
20061 -               case OF_DT_END_NODE:
20062 -                       if (--depth == 0)
20063 -                               return NULL;
20064 -               }
20065 -
20066 -               p = next;
20067 -       }
20068 -
20069 -found:
20070 -       pos = buf;
20071 -       for (i = 1; i < depth; i++) {
20072 -               int this_len;
20073 -
20074 -               if (len <= 1)
20075 -                       return NULL;
20076 -
20077 -               *pos++ = '/';
20078 -               len--;
20079 -
20080 -               strncpy(pos, path_comp[i], len);
20081 -
20082 -               if (pos[len - 1] != 0)
20083 -                       return NULL;
20084 -
20085 -               this_len = strlen(pos);
20086 -               len -= this_len;
20087 -               pos += this_len;
20088 -       }
20089 -
20090 -       return buf;
20091 -}
20092 Index: linux-2.6.24.7/arch/powerpc/boot/flatdevtree.h
20093 ===================================================================
20094 --- linux-2.6.24.7.orig/arch/powerpc/boot/flatdevtree.h
20095 +++ /dev/null
20096 @@ -1,113 +0,0 @@
20097 -/*
20098 - * This program is free software; you can redistribute it and/or modify
20099 - * it under the terms of the GNU General Public License as published by
20100 - * the Free Software Foundation; either version 2 of the License, or
20101 - * (at your option) any later version.
20102 - *
20103 - * This program is distributed in the hope that it will be useful,
20104 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
20105 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20106 - * GNU General Public License for more details.
20107 - *
20108 - * You should have received a copy of the GNU General Public License
20109 - * along with this program; if not, write to the Free Software
20110 - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20111 - */
20112 -
20113 -#ifndef FLATDEVTREE_H
20114 -#define FLATDEVTREE_H
20115 -
20116 -#include "flatdevtree_env.h"
20117 -
20118 -/* Definitions used by the flattened device tree */
20119 -#define OF_DT_HEADER            0xd00dfeed      /* marker */
20120 -#define OF_DT_BEGIN_NODE        0x1     /* Start of node, full name */
20121 -#define OF_DT_END_NODE          0x2     /* End node */
20122 -#define OF_DT_PROP              0x3     /* Property: name off, size, content */
20123 -#define OF_DT_NOP               0x4     /* nop */
20124 -#define OF_DT_END               0x9
20125 -
20126 -#define OF_DT_VERSION           0x10
20127 -
20128 -struct boot_param_header {
20129 -       u32 magic;              /* magic word OF_DT_HEADER */
20130 -       u32 totalsize;          /* total size of DT block */
20131 -       u32 off_dt_struct;      /* offset to structure */
20132 -       u32 off_dt_strings;     /* offset to strings */
20133 -       u32 off_mem_rsvmap;     /* offset to memory reserve map */
20134 -       u32 version;            /* format version */
20135 -       u32 last_comp_version;  /* last compatible version */
20136 -       /* version 2 fields below */
20137 -       u32 boot_cpuid_phys;    /* Physical CPU id we're booting on */
20138 -       /* version 3 fields below */
20139 -       u32 dt_strings_size;    /* size of the DT strings block */
20140 -};
20141 -
20142 -struct ft_reserve {
20143 -       u64 start;
20144 -       u64 len;
20145 -};
20146 -
20147 -struct ft_region {
20148 -       char *start;
20149 -       unsigned long size;
20150 -};
20151 -
20152 -enum ft_rgn_id {
20153 -       FT_RSVMAP,
20154 -       FT_STRUCT,
20155 -       FT_STRINGS,
20156 -       FT_N_REGION
20157 -};
20158 -
20159 -#define FT_MAX_DEPTH   50
20160 -
20161 -struct ft_cxt {
20162 -       struct boot_param_header *bph;
20163 -       int max_size;           /* maximum size of tree */
20164 -       int isordered;          /* everything in standard order */
20165 -       void *(*realloc)(void *, unsigned long);
20166 -       char *str_anchor;
20167 -       char *p;                /* current insertion point in structs */
20168 -       struct ft_region rgn[FT_N_REGION];
20169 -       void *genealogy[FT_MAX_DEPTH+1];
20170 -       char **node_tbl;
20171 -       unsigned int node_max;
20172 -       unsigned int nodes_used;
20173 -};
20174 -
20175 -char *ft_begin_node(struct ft_cxt *cxt, const char *name);
20176 -void ft_end_node(struct ft_cxt *cxt);
20177 -
20178 -void ft_begin_tree(struct ft_cxt *cxt);
20179 -void ft_end_tree(struct ft_cxt *cxt);
20180 -
20181 -void ft_nop(struct ft_cxt *cxt);
20182 -int ft_prop(struct ft_cxt *cxt, const char *name,
20183 -           const void *data, unsigned int sz);
20184 -int ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str);
20185 -int ft_prop_int(struct ft_cxt *cxt, const char *name, unsigned int val);
20186 -void ft_begin(struct ft_cxt *cxt, void *blob, unsigned int max_size,
20187 -             void *(*realloc_fn)(void *, unsigned long));
20188 -int ft_open(struct ft_cxt *cxt, void *blob, unsigned int max_size,
20189 -               unsigned int max_find_device,
20190 -               void *(*realloc_fn)(void *, unsigned long));
20191 -int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
20192 -
20193 -void ft_dump_blob(const void *bphp);
20194 -void ft_merge_blob(struct ft_cxt *cxt, void *blob);
20195 -void *ft_find_device(struct ft_cxt *cxt, const void *top,
20196 -                     const char *srch_path);
20197 -void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path);
20198 -int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
20199 -               void *buf, const unsigned int buflen);
20200 -int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
20201 -               const void *buf, const unsigned int buflen);
20202 -void *ft_get_parent(struct ft_cxt *cxt, const void *phandle);
20203 -void *ft_find_node_by_prop_value(struct ft_cxt *cxt, const void *prev,
20204 -                                 const char *propname, const char *propval,
20205 -                                 int proplen);
20206 -void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name);
20207 -char *ft_get_path(struct ft_cxt *cxt, const void *phandle, char *buf, int len);
20208 -
20209 -#endif /* FLATDEVTREE_H */
20210 Index: linux-2.6.24.7/arch/powerpc/boot/flatdevtree_misc.c
20211 ===================================================================
20212 --- linux-2.6.24.7.orig/arch/powerpc/boot/flatdevtree_misc.c
20213 +++ /dev/null
20214 @@ -1,79 +0,0 @@
20215 -/*
20216 - * This file does the necessary interface mapping between the bootwrapper
20217 - * device tree operations and the interface provided by shared source
20218 - * files flatdevicetree.[ch].
20219 - *
20220 - * Author: Mark A. Greer <mgreer@mvista.com>
20221 - *
20222 - * 2006 (c) MontaVista Software, Inc.  This file is licensed under
20223 - * the terms of the GNU General Public License version 2.  This program
20224 - * is licensed "as is" without any warranty of any kind, whether express
20225 - * or implied.
20226 - */
20227 -#include <stddef.h>
20228 -#include "flatdevtree.h"
20229 -#include "ops.h"
20230 -
20231 -static struct ft_cxt cxt;
20232 -
20233 -static void *fdtm_finddevice(const char *name)
20234 -{
20235 -       return ft_find_device(&cxt, NULL, name);
20236 -}
20237 -
20238 -static int fdtm_getprop(const void *phandle, const char *propname,
20239 -                        void *buf, const int buflen)
20240 -{
20241 -       return ft_get_prop(&cxt, phandle, propname, buf, buflen);
20242 -}
20243 -
20244 -static int fdtm_setprop(const void *phandle, const char *propname,
20245 -                        const void *buf, const int buflen)
20246 -{
20247 -       return ft_set_prop(&cxt, phandle, propname, buf, buflen);
20248 -}
20249 -
20250 -static void *fdtm_get_parent(const void *phandle)
20251 -{
20252 -       return ft_get_parent(&cxt, phandle);
20253 -}
20254 -
20255 -static void *fdtm_create_node(const void *phandle, const char *name)
20256 -{
20257 -       return ft_create_node(&cxt, phandle, name);
20258 -}
20259 -
20260 -static void *fdtm_find_node_by_prop_value(const void *prev,
20261 -                                          const char *propname,
20262 -                                          const char *propval,
20263 -                                          int proplen)
20264 -{
20265 -       return ft_find_node_by_prop_value(&cxt, prev, propname,
20266 -                                         propval, proplen);
20267 -}
20268 -
20269 -static unsigned long fdtm_finalize(void)
20270 -{
20271 -       ft_end_tree(&cxt);
20272 -       return (unsigned long)cxt.bph;
20273 -}
20274 -
20275 -static char *fdtm_get_path(const void *phandle, char *buf, int len)
20276 -{
20277 -       return ft_get_path(&cxt, phandle, buf, len);
20278 -}
20279 -
20280 -int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device)
20281 -{
20282 -       dt_ops.finddevice = fdtm_finddevice;
20283 -       dt_ops.getprop = fdtm_getprop;
20284 -       dt_ops.setprop = fdtm_setprop;
20285 -       dt_ops.get_parent = fdtm_get_parent;
20286 -       dt_ops.create_node = fdtm_create_node;
20287 -       dt_ops.find_node_by_prop_value = fdtm_find_node_by_prop_value;
20288 -       dt_ops.finalize = fdtm_finalize;
20289 -       dt_ops.get_path = fdtm_get_path;
20290 -
20291 -       return ft_open(&cxt, dt_blob, max_size, max_find_device,
20292 -                       platform_ops.realloc);
20293 -}
20294 Index: linux-2.6.24.7/arch/powerpc/boot/holly.c
20295 ===================================================================
20296 --- linux-2.6.24.7.orig/arch/powerpc/boot/holly.c
20297 +++ linux-2.6.24.7/arch/powerpc/boot/holly.c
20298 @@ -28,6 +28,6 @@ void platform_init(unsigned long r3, uns
20299         u32 heapsize = 0x8000000 - (u32)_end; /* 128M */
20300  
20301         simple_alloc_init(_end, heapsize, 32, 64);
20302 -       ft_init(_dtb_start, 0, 4);
20303 +       fdt_init(_dtb_start);
20304         serial_console_init();
20305  }
20306 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt/Makefile.libfdt
20307 ===================================================================
20308 --- /dev/null
20309 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt/Makefile.libfdt
20310 @@ -0,0 +1,14 @@
20311 +# Makefile.libfdt
20312 +#
20313 +# This is not a complete Makefile of itself.  Instead, it is designed to
20314 +# be easily embeddable into other systems of Makefiles.
20315 +#
20316 +LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
20317 +LIBFDT_INCLUDES = fdt.h libfdt.h
20318 +LIBFDT_EXTRA = libfdt_internal.h
20319 +LIBFDT_LIB = libfdt/libfdt.a
20320 +
20321 +LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)
20322 +
20323 +$(LIBFDT_objdir)/$(LIBFDT_LIB): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS))
20324 +
20325 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt.c
20326 ===================================================================
20327 --- /dev/null
20328 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt.c
20329 @@ -0,0 +1,156 @@
20330 +/*
20331 + * libfdt - Flat Device Tree manipulation
20332 + * Copyright (C) 2006 David Gibson, IBM Corporation.
20333 + *
20334 + * libfdt is dual licensed: you can use it either under the terms of
20335 + * the GPL, or the BSD license, at your option.
20336 + *
20337 + *  a) This library is free software; you can redistribute it and/or
20338 + *     modify it under the terms of the GNU General Public License as
20339 + *     published by the Free Software Foundation; either version 2 of the
20340 + *     License, or (at your option) any later version.
20341 + *
20342 + *     This library is distributed in the hope that it will be useful,
20343 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
20344 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20345 + *     GNU General Public License for more details.
20346 + *
20347 + *     You should have received a copy of the GNU General Public
20348 + *     License along with this library; if not, write to the Free
20349 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20350 + *     MA 02110-1301 USA
20351 + *
20352 + * Alternatively,
20353 + *
20354 + *  b) Redistribution and use in source and binary forms, with or
20355 + *     without modification, are permitted provided that the following
20356 + *     conditions are met:
20357 + *
20358 + *     1. Redistributions of source code must retain the above
20359 + *        copyright notice, this list of conditions and the following
20360 + *        disclaimer.
20361 + *     2. Redistributions in binary form must reproduce the above
20362 + *        copyright notice, this list of conditions and the following
20363 + *        disclaimer in the documentation and/or other materials
20364 + *        provided with the distribution.
20365 + *
20366 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20367 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20368 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20369 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20370 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20371 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20372 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20373 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20374 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20375 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20376 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20377 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
20378 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20379 + */
20380 +#include "libfdt_env.h"
20381 +
20382 +#include <fdt.h>
20383 +#include <libfdt.h>
20384 +
20385 +#include "libfdt_internal.h"
20386 +
20387 +int fdt_check_header(const void *fdt)
20388 +{
20389 +       if (fdt_magic(fdt) == FDT_MAGIC) {
20390 +               /* Complete tree */
20391 +               if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION)
20392 +                       return -FDT_ERR_BADVERSION;
20393 +               if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION)
20394 +                       return -FDT_ERR_BADVERSION;
20395 +       } else if (fdt_magic(fdt) == SW_MAGIC) {
20396 +               /* Unfinished sequential-write blob */
20397 +               if (fdt_size_dt_struct(fdt) == 0)
20398 +                       return -FDT_ERR_BADSTATE;
20399 +       } else {
20400 +               return -FDT_ERR_BADMAGIC;
20401 +       }
20402 +
20403 +       return 0;
20404 +}
20405 +
20406 +const void *fdt_offset_ptr(const void *fdt, int offset, int len)
20407 +{
20408 +       const void *p;
20409 +
20410 +       if (fdt_version(fdt) >= 0x11)
20411 +               if (((offset + len) < offset)
20412 +                   || ((offset + len) > fdt_size_dt_struct(fdt)))
20413 +                       return NULL;
20414 +
20415 +       p = _fdt_offset_ptr(fdt, offset);
20416 +
20417 +       if (p + len < p)
20418 +               return NULL;
20419 +       return p;
20420 +}
20421 +
20422 +uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset)
20423 +{
20424 +       const uint32_t *tagp, *lenp;
20425 +       uint32_t tag;
20426 +       const char *p;
20427 +
20428 +       if (offset % FDT_TAGSIZE)
20429 +               return -1;
20430 +
20431 +       tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
20432 +       if (! tagp)
20433 +               return FDT_END; /* premature end */
20434 +       tag = fdt32_to_cpu(*tagp);
20435 +       offset += FDT_TAGSIZE;
20436 +
20437 +       switch (tag) {
20438 +       case FDT_BEGIN_NODE:
20439 +               /* skip name */
20440 +               do {
20441 +                       p = fdt_offset_ptr(fdt, offset++, 1);
20442 +               } while (p && (*p != '\0'));
20443 +               if (! p)
20444 +                       return FDT_END;
20445 +               break;
20446 +       case FDT_PROP:
20447 +               lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
20448 +               if (! lenp)
20449 +                       return FDT_END;
20450 +               /* skip name offset, length and value */
20451 +               offset += 2*FDT_TAGSIZE + fdt32_to_cpu(*lenp);
20452 +               break;
20453 +       }
20454 +
20455 +       if (nextoffset)
20456 +               *nextoffset = ALIGN(offset, FDT_TAGSIZE);
20457 +
20458 +       return tag;
20459 +}
20460 +
20461 +const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
20462 +{
20463 +       int len = strlen(s) + 1;
20464 +       const char *last = strtab + tabsize - len;
20465 +       const char *p;
20466 +
20467 +       for (p = strtab; p <= last; p++)
20468 +               if (memeq(p, s, len))
20469 +                       return p;
20470 +       return NULL;
20471 +}
20472 +
20473 +int fdt_move(const void *fdt, void *buf, int bufsize)
20474 +{
20475 +       int err = fdt_check_header(fdt);
20476 +
20477 +       if (err)
20478 +               return err;
20479 +
20480 +       if (fdt_totalsize(fdt) > bufsize)
20481 +               return -FDT_ERR_NOSPACE;
20482 +
20483 +       memmove(buf, fdt, fdt_totalsize(fdt));
20484 +       return 0;
20485 +}
20486 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt.h
20487 ===================================================================
20488 --- /dev/null
20489 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt.h
20490 @@ -0,0 +1,60 @@
20491 +#ifndef _FDT_H
20492 +#define _FDT_H
20493 +
20494 +#ifndef __ASSEMBLY__
20495 +
20496 +struct fdt_header {
20497 +       uint32_t magic;                  /* magic word FDT_MAGIC */
20498 +       uint32_t totalsize;              /* total size of DT block */
20499 +       uint32_t off_dt_struct;          /* offset to structure */
20500 +       uint32_t off_dt_strings;         /* offset to strings */
20501 +       uint32_t off_mem_rsvmap;         /* offset to memory reserve map */
20502 +       uint32_t version;                /* format version */
20503 +       uint32_t last_comp_version;      /* last compatible version */
20504 +
20505 +       /* version 2 fields below */
20506 +       uint32_t boot_cpuid_phys;        /* Which physical CPU id we're
20507 +                                           booting on */
20508 +       /* version 3 fields below */
20509 +       uint32_t size_dt_strings;        /* size of the strings block */
20510 +
20511 +       /* version 17 fields below */
20512 +       uint32_t size_dt_struct;         /* size of the structure block */
20513 +};
20514 +
20515 +struct fdt_reserve_entry {
20516 +       uint64_t address;
20517 +       uint64_t size;
20518 +};
20519 +
20520 +struct fdt_node_header {
20521 +       uint32_t tag;
20522 +       char name[0];
20523 +};
20524 +
20525 +struct fdt_property {
20526 +       uint32_t tag;
20527 +       uint32_t len;
20528 +       uint32_t nameoff;
20529 +       char data[0];
20530 +};
20531 +
20532 +#endif /* !__ASSEMBLY */
20533 +
20534 +#define FDT_MAGIC      0xd00dfeed      /* 4: version, 4: total size */
20535 +#define FDT_TAGSIZE    sizeof(uint32_t)
20536 +
20537 +#define FDT_BEGIN_NODE 0x1             /* Start node: full name */
20538 +#define FDT_END_NODE   0x2             /* End node */
20539 +#define FDT_PROP       0x3             /* Property: name off,
20540 +                                          size, content */
20541 +#define FDT_NOP                0x4             /* nop */
20542 +#define FDT_END                0x9
20543 +
20544 +#define FDT_V1_SIZE    (7*sizeof(uint32_t))
20545 +#define FDT_V2_SIZE    (FDT_V1_SIZE + sizeof(uint32_t))
20546 +#define FDT_V3_SIZE    (FDT_V2_SIZE + sizeof(uint32_t))
20547 +#define FDT_V16_SIZE   FDT_V3_SIZE
20548 +#define FDT_V17_SIZE   (FDT_V16_SIZE + sizeof(uint32_t))
20549 +
20550 +#endif /* _FDT_H */
20551 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt_ro.c
20552 ===================================================================
20553 --- /dev/null
20554 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt_ro.c
20555 @@ -0,0 +1,583 @@
20556 +/*
20557 + * libfdt - Flat Device Tree manipulation
20558 + * Copyright (C) 2006 David Gibson, IBM Corporation.
20559 + *
20560 + * libfdt is dual licensed: you can use it either under the terms of
20561 + * the GPL, or the BSD license, at your option.
20562 + *
20563 + *  a) This library is free software; you can redistribute it and/or
20564 + *     modify it under the terms of the GNU General Public License as
20565 + *     published by the Free Software Foundation; either version 2 of the
20566 + *     License, or (at your option) any later version.
20567 + *
20568 + *     This library is distributed in the hope that it will be useful,
20569 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
20570 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20571 + *     GNU General Public License for more details.
20572 + *
20573 + *     You should have received a copy of the GNU General Public
20574 + *     License along with this library; if not, write to the Free
20575 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20576 + *     MA 02110-1301 USA
20577 + *
20578 + * Alternatively,
20579 + *
20580 + *  b) Redistribution and use in source and binary forms, with or
20581 + *     without modification, are permitted provided that the following
20582 + *     conditions are met:
20583 + *
20584 + *     1. Redistributions of source code must retain the above
20585 + *        copyright notice, this list of conditions and the following
20586 + *        disclaimer.
20587 + *     2. Redistributions in binary form must reproduce the above
20588 + *        copyright notice, this list of conditions and the following
20589 + *        disclaimer in the documentation and/or other materials
20590 + *        provided with the distribution.
20591 + *
20592 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20593 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20594 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20595 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20596 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20597 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20598 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20599 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20600 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20601 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20602 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20603 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
20604 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20605 + */
20606 +#include "libfdt_env.h"
20607 +
20608 +#include <fdt.h>
20609 +#include <libfdt.h>
20610 +
20611 +#include "libfdt_internal.h"
20612 +
20613 +#define CHECK_HEADER(fdt) \
20614 +       { \
20615 +               int err; \
20616 +               if ((err = fdt_check_header(fdt)) != 0) \
20617 +                       return err; \
20618 +       }
20619 +
20620 +static int nodename_eq(const void *fdt, int offset,
20621 +                      const char *s, int len)
20622 +{
20623 +       const char *p = fdt_offset_ptr(fdt, offset, len+1);
20624 +
20625 +       if (! p)
20626 +               /* short match */
20627 +               return 0;
20628 +
20629 +       if (memcmp(p, s, len) != 0)
20630 +               return 0;
20631 +
20632 +       if (p[len] == '\0')
20633 +               return 1;
20634 +       else if (!memchr(s, '@', len) && (p[len] == '@'))
20635 +               return 1;
20636 +       else
20637 +               return 0;
20638 +}
20639 +
20640 +const char *fdt_string(const void *fdt, int stroffset)
20641 +{
20642 +       return (char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
20643 +}
20644 +
20645 +int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
20646 +{
20647 +       CHECK_HEADER(fdt);
20648 +       *address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address);
20649 +       *size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size);
20650 +       return 0;
20651 +}
20652 +
20653 +int fdt_num_mem_rsv(const void *fdt)
20654 +{
20655 +       int i = 0;
20656 +
20657 +       while (fdt64_to_cpu(_fdt_mem_rsv(fdt, i)->size) != 0)
20658 +               i++;
20659 +       return i;
20660 +}
20661 +
20662 +int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
20663 +                              const char *name, int namelen)
20664 +{
20665 +       int level = 0;
20666 +       uint32_t tag;
20667 +       int offset, nextoffset;
20668 +
20669 +       CHECK_HEADER(fdt);
20670 +
20671 +       tag = fdt_next_tag(fdt, parentoffset, &nextoffset);
20672 +       if (tag != FDT_BEGIN_NODE)
20673 +               return -FDT_ERR_BADOFFSET;
20674 +
20675 +       do {
20676 +               offset = nextoffset;
20677 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20678 +
20679 +               switch (tag) {
20680 +               case FDT_END:
20681 +                       return -FDT_ERR_TRUNCATED;
20682 +
20683 +               case FDT_BEGIN_NODE:
20684 +                       level++;
20685 +                       if (level != 1)
20686 +                               continue;
20687 +                       if (nodename_eq(fdt, offset+FDT_TAGSIZE, name, namelen))
20688 +                               /* Found it! */
20689 +                               return offset;
20690 +                       break;
20691 +
20692 +               case FDT_END_NODE:
20693 +                       level--;
20694 +                       break;
20695 +
20696 +               case FDT_PROP:
20697 +               case FDT_NOP:
20698 +                       break;
20699 +
20700 +               default:
20701 +                       return -FDT_ERR_BADSTRUCTURE;
20702 +               }
20703 +       } while (level >= 0);
20704 +
20705 +       return -FDT_ERR_NOTFOUND;
20706 +}
20707 +
20708 +int fdt_subnode_offset(const void *fdt, int parentoffset,
20709 +                      const char *name)
20710 +{
20711 +       return fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name));
20712 +}
20713 +
20714 +int fdt_path_offset(const void *fdt, const char *path)
20715 +{
20716 +       const char *end = path + strlen(path);
20717 +       const char *p = path;
20718 +       int offset = 0;
20719 +
20720 +       CHECK_HEADER(fdt);
20721 +
20722 +       if (*path != '/')
20723 +               return -FDT_ERR_BADPATH;
20724 +
20725 +       while (*p) {
20726 +               const char *q;
20727 +
20728 +               while (*p == '/')
20729 +                       p++;
20730 +               if (! *p)
20731 +                       return offset;
20732 +               q = strchr(p, '/');
20733 +               if (! q)
20734 +                       q = end;
20735 +
20736 +               offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p);
20737 +               if (offset < 0)
20738 +                       return offset;
20739 +
20740 +               p = q;
20741 +       }
20742 +
20743 +       return offset;
20744 +}
20745 +
20746 +const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
20747 +{
20748 +       const struct fdt_node_header *nh;
20749 +       int err;
20750 +
20751 +       if ((err = fdt_check_header(fdt)) != 0)
20752 +               goto fail;
20753 +
20754 +       err = -FDT_ERR_BADOFFSET;
20755 +       nh = fdt_offset_ptr(fdt, nodeoffset, sizeof(*nh));
20756 +       if (!nh || (fdt32_to_cpu(nh->tag) != FDT_BEGIN_NODE))
20757 +               goto fail;
20758 +
20759 +       if (len)
20760 +               *len = strlen(nh->name);
20761 +
20762 +       return nh->name;
20763 +
20764 + fail:
20765 +       if (len)
20766 +               *len = err;
20767 +       return NULL;
20768 +}
20769 +
20770 +const struct fdt_property *fdt_get_property(const void *fdt,
20771 +                                           int nodeoffset,
20772 +                                           const char *name, int *lenp)
20773 +{
20774 +       uint32_t tag;
20775 +       const struct fdt_property *prop;
20776 +       int namestroff;
20777 +       int offset, nextoffset;
20778 +       int err;
20779 +
20780 +       if ((err = fdt_check_header(fdt)) != 0)
20781 +               goto fail;
20782 +
20783 +       err = -FDT_ERR_BADOFFSET;
20784 +       if (nodeoffset % FDT_TAGSIZE)
20785 +               goto fail;
20786 +
20787 +       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
20788 +       if (tag != FDT_BEGIN_NODE)
20789 +               goto fail;
20790 +
20791 +       do {
20792 +               offset = nextoffset;
20793 +
20794 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20795 +               switch (tag) {
20796 +               case FDT_END:
20797 +                       err = -FDT_ERR_TRUNCATED;
20798 +                       goto fail;
20799 +
20800 +               case FDT_BEGIN_NODE:
20801 +               case FDT_END_NODE:
20802 +               case FDT_NOP:
20803 +                       break;
20804 +
20805 +               case FDT_PROP:
20806 +                       err = -FDT_ERR_BADSTRUCTURE;
20807 +                       prop = fdt_offset_ptr(fdt, offset, sizeof(*prop));
20808 +                       if (! prop)
20809 +                               goto fail;
20810 +                       namestroff = fdt32_to_cpu(prop->nameoff);
20811 +                       if (streq(fdt_string(fdt, namestroff), name)) {
20812 +                               /* Found it! */
20813 +                               int len = fdt32_to_cpu(prop->len);
20814 +                               prop = fdt_offset_ptr(fdt, offset,
20815 +                                                     sizeof(*prop)+len);
20816 +                               if (! prop)
20817 +                                       goto fail;
20818 +
20819 +                               if (lenp)
20820 +                                       *lenp = len;
20821 +
20822 +                               return prop;
20823 +                       }
20824 +                       break;
20825 +
20826 +               default:
20827 +                       err = -FDT_ERR_BADSTRUCTURE;
20828 +                       goto fail;
20829 +               }
20830 +       } while ((tag != FDT_BEGIN_NODE) && (tag != FDT_END_NODE));
20831 +
20832 +       err = -FDT_ERR_NOTFOUND;
20833 + fail:
20834 +       if (lenp)
20835 +               *lenp = err;
20836 +       return NULL;
20837 +}
20838 +
20839 +const void *fdt_getprop(const void *fdt, int nodeoffset,
20840 +                 const char *name, int *lenp)
20841 +{
20842 +       const struct fdt_property *prop;
20843 +
20844 +       prop = fdt_get_property(fdt, nodeoffset, name, lenp);
20845 +       if (! prop)
20846 +               return NULL;
20847 +
20848 +       return prop->data;
20849 +}
20850 +
20851 +uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
20852 +{
20853 +       const uint32_t *php;
20854 +       int len;
20855 +
20856 +       php = fdt_getprop(fdt, nodeoffset, "linux,phandle", &len);
20857 +       if (!php || (len != sizeof(*php)))
20858 +               return 0;
20859 +
20860 +       return fdt32_to_cpu(*php);
20861 +}
20862 +
20863 +int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
20864 +{
20865 +       uint32_t tag;
20866 +       int p = 0, overflow = 0;
20867 +       int offset, nextoffset, namelen;
20868 +       const char *name;
20869 +
20870 +       CHECK_HEADER(fdt);
20871 +
20872 +       tag = fdt_next_tag(fdt, 0, &nextoffset);
20873 +       if (tag != FDT_BEGIN_NODE)
20874 +               return -FDT_ERR_BADSTRUCTURE;
20875 +
20876 +       if (buflen < 2)
20877 +               return -FDT_ERR_NOSPACE;
20878 +       buf[0] = '/';
20879 +       p = 1;
20880 +
20881 +       while (nextoffset <= nodeoffset) {
20882 +               offset = nextoffset;
20883 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20884 +               switch (tag) {
20885 +               case FDT_END:
20886 +                       return -FDT_ERR_BADOFFSET;
20887 +
20888 +               case FDT_BEGIN_NODE:
20889 +                       name = fdt_get_name(fdt, offset, &namelen);
20890 +                       if (!name)
20891 +                               return namelen;
20892 +                       if (overflow || ((p + namelen + 1) > buflen)) {
20893 +                               overflow++;
20894 +                               break;
20895 +                       }
20896 +                       memcpy(buf + p, name, namelen);
20897 +                       p += namelen;
20898 +                       buf[p++] = '/';
20899 +                       break;
20900 +
20901 +               case FDT_END_NODE:
20902 +                       if (overflow) {
20903 +                               overflow--;
20904 +                               break;
20905 +                       }
20906 +                       do {
20907 +                               p--;
20908 +                       } while  (buf[p-1] != '/');
20909 +                       break;
20910 +
20911 +               case FDT_PROP:
20912 +               case FDT_NOP:
20913 +                       break;
20914 +
20915 +               default:
20916 +                       return -FDT_ERR_BADSTRUCTURE;
20917 +               }
20918 +       }
20919 +
20920 +       if (overflow)
20921 +               return -FDT_ERR_NOSPACE;
20922 +
20923 +       if (p > 1) /* special case so that root path is "/", not "" */
20924 +               p--;
20925 +       buf[p] = '\0';
20926 +       return p;
20927 +}
20928 +
20929 +int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
20930 +                                int supernodedepth, int *nodedepth)
20931 +{
20932 +       int level = -1;
20933 +       uint32_t tag;
20934 +       int offset, nextoffset = 0;
20935 +       int supernodeoffset = -FDT_ERR_INTERNAL;
20936 +
20937 +       CHECK_HEADER(fdt);
20938 +
20939 +       if (supernodedepth < 0)
20940 +               return -FDT_ERR_NOTFOUND;
20941 +
20942 +       do {
20943 +               offset = nextoffset;
20944 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20945 +               switch (tag) {
20946 +               case FDT_END:
20947 +                       return -FDT_ERR_BADOFFSET;
20948 +
20949 +               case FDT_BEGIN_NODE:
20950 +                       level++;
20951 +                       if (level == supernodedepth)
20952 +                               supernodeoffset = offset;
20953 +                       break;
20954 +
20955 +               case FDT_END_NODE:
20956 +                       level--;
20957 +                       break;
20958 +
20959 +               case FDT_PROP:
20960 +               case FDT_NOP:
20961 +                       break;
20962 +
20963 +               default:
20964 +                       return -FDT_ERR_BADSTRUCTURE;
20965 +               }
20966 +       } while (offset < nodeoffset);
20967 +
20968 +       if (nodedepth)
20969 +               *nodedepth = level;
20970 +
20971 +       if (supernodedepth > level)
20972 +               return -FDT_ERR_NOTFOUND;
20973 +       return supernodeoffset;
20974 +}
20975 +
20976 +int fdt_node_depth(const void *fdt, int nodeoffset)
20977 +{
20978 +       int nodedepth;
20979 +       int err;
20980 +
20981 +       err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);
20982 +       if (err)
20983 +               return (err < 0) ? err : -FDT_ERR_INTERNAL;
20984 +       return nodedepth;
20985 +}
20986 +
20987 +int fdt_parent_offset(const void *fdt, int nodeoffset)
20988 +{
20989 +       int nodedepth = fdt_node_depth(fdt, nodeoffset);
20990 +
20991 +       if (nodedepth < 0)
20992 +               return nodedepth;
20993 +       return fdt_supernode_atdepth_offset(fdt, nodeoffset,
20994 +                                           nodedepth - 1, NULL);
20995 +}
20996 +
20997 +int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
20998 +                                 const char *propname,
20999 +                                 const void *propval, int proplen)
21000 +{
21001 +       uint32_t tag;
21002 +       int offset, nextoffset;
21003 +       const void *val;
21004 +       int len;
21005 +
21006 +       CHECK_HEADER(fdt);
21007 +
21008 +       if (startoffset >= 0) {
21009 +               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
21010 +               if (tag != FDT_BEGIN_NODE)
21011 +                       return -FDT_ERR_BADOFFSET;
21012 +       } else {
21013 +               nextoffset = 0;
21014 +       }
21015 +
21016 +       /* FIXME: The algorithm here is pretty horrible: we scan each
21017 +        * property of a node in fdt_getprop(), then if that didn't
21018 +        * find what we want, we scan over them again making our way
21019 +        * to the next node.  Still it's the easiest to implement
21020 +        * approach; performance can come later. */
21021 +       do {
21022 +               offset = nextoffset;
21023 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
21024 +
21025 +               switch (tag) {
21026 +               case FDT_BEGIN_NODE:
21027 +                       val = fdt_getprop(fdt, offset, propname, &len);
21028 +                       if (val
21029 +                           && (len == proplen)
21030 +                           && (memcmp(val, propval, len) == 0))
21031 +                               return offset;
21032 +                       break;
21033 +
21034 +               case FDT_PROP:
21035 +               case FDT_END:
21036 +               case FDT_END_NODE:
21037 +               case FDT_NOP:
21038 +                       break;
21039 +
21040 +               default:
21041 +                       return -FDT_ERR_BADSTRUCTURE;
21042 +               }
21043 +       } while (tag != FDT_END);
21044 +
21045 +       return -FDT_ERR_NOTFOUND;
21046 +}
21047 +
21048 +int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
21049 +{
21050 +       if ((phandle == 0) || (phandle == -1))
21051 +               return -FDT_ERR_BADPHANDLE;
21052 +       phandle = cpu_to_fdt32(phandle);
21053 +       return fdt_node_offset_by_prop_value(fdt, -1, "linux,phandle",
21054 +                                            &phandle, sizeof(phandle));
21055 +}
21056 +
21057 +int _stringlist_contains(const void *strlist, int listlen, const char *str)
21058 +{
21059 +       int len = strlen(str);
21060 +       const void *p;
21061 +
21062 +       while (listlen >= len) {
21063 +               if (memcmp(str, strlist, len+1) == 0)
21064 +                       return 1;
21065 +               p = memchr(strlist, '\0', listlen);
21066 +               if (!p)
21067 +                       return 0; /* malformed strlist.. */
21068 +               listlen -= (p-strlist) + 1;
21069 +               strlist = p + 1;
21070 +       }
21071 +       return 0;
21072 +}
21073 +
21074 +int fdt_node_check_compatible(const void *fdt, int nodeoffset,
21075 +                             const char *compatible)
21076 +{
21077 +       const void *prop;
21078 +       int len;
21079 +
21080 +       prop = fdt_getprop(fdt, nodeoffset, "compatible", &len);
21081 +       if (!prop)
21082 +               return len;
21083 +       if (_stringlist_contains(prop, len, compatible))
21084 +               return 0;
21085 +       else
21086 +               return 1;
21087 +}
21088 +
21089 +int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
21090 +                                 const char *compatible)
21091 +{
21092 +       uint32_t tag;
21093 +       int offset, nextoffset;
21094 +       int err;
21095 +
21096 +       CHECK_HEADER(fdt);
21097 +
21098 +       if (startoffset >= 0) {
21099 +               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
21100 +               if (tag != FDT_BEGIN_NODE)
21101 +                       return -FDT_ERR_BADOFFSET;
21102 +       } else {
21103 +               nextoffset = 0;
21104 +       }
21105 +
21106 +       /* FIXME: The algorithm here is pretty horrible: we scan each
21107 +        * property of a node in fdt_node_check_compatible(), then if
21108 +        * that didn't find what we want, we scan over them again
21109 +        * making our way to the next node.  Still it's the easiest to
21110 +        * implement approach; performance can come later. */
21111 +       do {
21112 +               offset = nextoffset;
21113 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
21114 +
21115 +               switch (tag) {
21116 +               case FDT_BEGIN_NODE:
21117 +                       err = fdt_node_check_compatible(fdt, offset,
21118 +                                                       compatible);
21119 +                       if ((err < 0)
21120 +                           && (err != -FDT_ERR_NOTFOUND))
21121 +                               return err;
21122 +                       else if (err == 0)
21123 +                               return offset;
21124 +                       break;
21125 +
21126 +               case FDT_PROP:
21127 +               case FDT_END:
21128 +               case FDT_END_NODE:
21129 +               case FDT_NOP:
21130 +                       break;
21131 +
21132 +               default:
21133 +                       return -FDT_ERR_BADSTRUCTURE;
21134 +               }
21135 +       } while (tag != FDT_END);
21136 +
21137 +       return -FDT_ERR_NOTFOUND;
21138 +}
21139 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt_rw.c
21140 ===================================================================
21141 --- /dev/null
21142 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt_rw.c
21143 @@ -0,0 +1,447 @@
21144 +/*
21145 + * libfdt - Flat Device Tree manipulation
21146 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21147 + *
21148 + * libfdt is dual licensed: you can use it either under the terms of
21149 + * the GPL, or the BSD license, at your option.
21150 + *
21151 + *  a) This library is free software; you can redistribute it and/or
21152 + *     modify it under the terms of the GNU General Public License as
21153 + *     published by the Free Software Foundation; either version 2 of the
21154 + *     License, or (at your option) any later version.
21155 + *
21156 + *     This library is distributed in the hope that it will be useful,
21157 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21158 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21159 + *     GNU General Public License for more details.
21160 + *
21161 + *     You should have received a copy of the GNU General Public
21162 + *     License along with this library; if not, write to the Free
21163 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21164 + *     MA 02110-1301 USA
21165 + *
21166 + * Alternatively,
21167 + *
21168 + *  b) Redistribution and use in source and binary forms, with or
21169 + *     without modification, are permitted provided that the following
21170 + *     conditions are met:
21171 + *
21172 + *     1. Redistributions of source code must retain the above
21173 + *        copyright notice, this list of conditions and the following
21174 + *        disclaimer.
21175 + *     2. Redistributions in binary form must reproduce the above
21176 + *        copyright notice, this list of conditions and the following
21177 + *        disclaimer in the documentation and/or other materials
21178 + *        provided with the distribution.
21179 + *
21180 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21181 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21182 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21183 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21184 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21185 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21186 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21187 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21188 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21189 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21190 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21191 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21192 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21193 + */
21194 +#include "libfdt_env.h"
21195 +
21196 +#include <fdt.h>
21197 +#include <libfdt.h>
21198 +
21199 +#include "libfdt_internal.h"
21200 +
21201 +static int _blocks_misordered(const void *fdt,
21202 +                             int mem_rsv_size, int struct_size)
21203 +{
21204 +       return (fdt_off_mem_rsvmap(fdt) < ALIGN(sizeof(struct fdt_header), 8))
21205 +               || (fdt_off_dt_struct(fdt) <
21206 +                   (fdt_off_mem_rsvmap(fdt) + mem_rsv_size))
21207 +               || (fdt_off_dt_strings(fdt) <
21208 +                   (fdt_off_dt_struct(fdt) + struct_size))
21209 +               || (fdt_totalsize(fdt) <
21210 +                   (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)));
21211 +}
21212 +
21213 +static int rw_check_header(void *fdt)
21214 +{
21215 +       int err;
21216 +
21217 +       if ((err = fdt_check_header(fdt)))
21218 +               return err;
21219 +       if (fdt_version(fdt) < 17)
21220 +               return -FDT_ERR_BADVERSION;
21221 +       if (_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry),
21222 +                              fdt_size_dt_struct(fdt)))
21223 +               return -FDT_ERR_BADLAYOUT;
21224 +       if (fdt_version(fdt) > 17)
21225 +               fdt_set_version(fdt, 17);
21226 +
21227 +       return 0;
21228 +}
21229 +
21230 +#define RW_CHECK_HEADER(fdt) \
21231 +       { \
21232 +               int err; \
21233 +               if ((err = rw_check_header(fdt)) != 0) \
21234 +                       return err; \
21235 +       }
21236 +
21237 +static inline int _blob_data_size(void *fdt)
21238 +{
21239 +       return fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
21240 +}
21241 +
21242 +static int _blob_splice(void *fdt, void *p, int oldlen, int newlen)
21243 +{
21244 +       void *end = fdt + _blob_data_size(fdt);
21245 +
21246 +       if (((p + oldlen) < p) || ((p + oldlen) > end))
21247 +               return -FDT_ERR_BADOFFSET;
21248 +       if ((end - oldlen + newlen) > (fdt + fdt_totalsize(fdt)))
21249 +               return -FDT_ERR_NOSPACE;
21250 +       memmove(p + newlen, p + oldlen, end - p - oldlen);
21251 +       return 0;
21252 +}
21253 +
21254 +static int _blob_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p,
21255 +                               int oldn, int newn)
21256 +{
21257 +       int delta = (newn - oldn) * sizeof(*p);
21258 +       int err;
21259 +       err = _blob_splice(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
21260 +       if (err)
21261 +               return err;
21262 +       fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(fdt) + delta);
21263 +       fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
21264 +       return 0;
21265 +}
21266 +
21267 +static int _blob_splice_struct(void *fdt, void *p,
21268 +                              int oldlen, int newlen)
21269 +{
21270 +       int delta = newlen - oldlen;
21271 +       int err;
21272 +
21273 +       if ((err = _blob_splice(fdt, p, oldlen, newlen)))
21274 +               return err;
21275 +
21276 +       fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta);
21277 +       fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
21278 +       return 0;
21279 +}
21280 +
21281 +static int _blob_splice_string(void *fdt, int newlen)
21282 +{
21283 +       void *p = fdt + fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
21284 +       int err;
21285 +
21286 +       if ((err = _blob_splice(fdt, p, 0, newlen)))
21287 +               return err;
21288 +
21289 +       fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) + newlen);
21290 +       return 0;
21291 +}
21292 +
21293 +static int _find_add_string(void *fdt, const char *s)
21294 +{
21295 +       char *strtab = (char *)fdt + fdt_off_dt_strings(fdt);
21296 +       const char *p;
21297 +       char *new;
21298 +       int len = strlen(s) + 1;
21299 +       int err;
21300 +
21301 +       p = _fdt_find_string(strtab, fdt_size_dt_strings(fdt), s);
21302 +       if (p)
21303 +               /* found it */
21304 +               return (p - strtab);
21305 +
21306 +       new = strtab + fdt_size_dt_strings(fdt);
21307 +       err = _blob_splice_string(fdt, len);
21308 +       if (err)
21309 +               return err;
21310 +
21311 +       memcpy(new, s, len);
21312 +       return (new - strtab);
21313 +}
21314 +
21315 +int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
21316 +{
21317 +       struct fdt_reserve_entry *re;
21318 +       int err;
21319 +
21320 +       if ((err = rw_check_header(fdt)))
21321 +               return err;
21322 +
21323 +       re = _fdt_mem_rsv_w(fdt, fdt_num_mem_rsv(fdt));
21324 +       err = _blob_splice_mem_rsv(fdt, re, 0, 1);
21325 +       if (err)
21326 +               return err;
21327 +
21328 +       re->address = cpu_to_fdt64(address);
21329 +       re->size = cpu_to_fdt64(size);
21330 +       return 0;
21331 +}
21332 +
21333 +int fdt_del_mem_rsv(void *fdt, int n)
21334 +{
21335 +       struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n);
21336 +       int err;
21337 +
21338 +       if ((err = rw_check_header(fdt)))
21339 +               return err;
21340 +       if (n >= fdt_num_mem_rsv(fdt))
21341 +               return -FDT_ERR_NOTFOUND;
21342 +
21343 +       err = _blob_splice_mem_rsv(fdt, re, 1, 0);
21344 +       if (err)
21345 +               return err;
21346 +       return 0;
21347 +}
21348 +
21349 +static int _resize_property(void *fdt, int nodeoffset, const char *name, int len,
21350 +                           struct fdt_property **prop)
21351 +{
21352 +       int oldlen;
21353 +       int err;
21354 +
21355 +       *prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
21356 +       if (! (*prop))
21357 +               return oldlen;
21358 +
21359 +       if ((err = _blob_splice_struct(fdt, (*prop)->data,
21360 +                                      ALIGN(oldlen, FDT_TAGSIZE),
21361 +                                      ALIGN(len, FDT_TAGSIZE))))
21362 +               return err;
21363 +
21364 +       (*prop)->len = cpu_to_fdt32(len);
21365 +       return 0;
21366 +}
21367 +
21368 +static int _add_property(void *fdt, int nodeoffset, const char *name, int len,
21369 +                        struct fdt_property **prop)
21370 +{
21371 +       uint32_t tag;
21372 +       int proplen;
21373 +       int nextoffset;
21374 +       int namestroff;
21375 +       int err;
21376 +
21377 +       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
21378 +       if (tag != FDT_BEGIN_NODE)
21379 +               return -FDT_ERR_BADOFFSET;
21380 +
21381 +       namestroff = _find_add_string(fdt, name);
21382 +       if (namestroff < 0)
21383 +               return namestroff;
21384 +
21385 +       *prop = _fdt_offset_ptr_w(fdt, nextoffset);
21386 +       proplen = sizeof(**prop) + ALIGN(len, FDT_TAGSIZE);
21387 +
21388 +       err = _blob_splice_struct(fdt, *prop, 0, proplen);
21389 +       if (err)
21390 +               return err;
21391 +
21392 +       (*prop)->tag = cpu_to_fdt32(FDT_PROP);
21393 +       (*prop)->nameoff = cpu_to_fdt32(namestroff);
21394 +       (*prop)->len = cpu_to_fdt32(len);
21395 +       return 0;
21396 +}
21397 +
21398 +int fdt_setprop(void *fdt, int nodeoffset, const char *name,
21399 +               const void *val, int len)
21400 +{
21401 +       struct fdt_property *prop;
21402 +       int err;
21403 +
21404 +       if ((err = rw_check_header(fdt)))
21405 +               return err;
21406 +
21407 +       err = _resize_property(fdt, nodeoffset, name, len, &prop);
21408 +       if (err == -FDT_ERR_NOTFOUND)
21409 +               err = _add_property(fdt, nodeoffset, name, len, &prop);
21410 +       if (err)
21411 +               return err;
21412 +
21413 +       memcpy(prop->data, val, len);
21414 +       return 0;
21415 +}
21416 +
21417 +int fdt_delprop(void *fdt, int nodeoffset, const char *name)
21418 +{
21419 +       struct fdt_property *prop;
21420 +       int len, proplen;
21421 +
21422 +       RW_CHECK_HEADER(fdt);
21423 +
21424 +       prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
21425 +       if (! prop)
21426 +               return len;
21427 +
21428 +       proplen = sizeof(*prop) + ALIGN(len, FDT_TAGSIZE);
21429 +       return _blob_splice_struct(fdt, prop, proplen, 0);
21430 +}
21431 +
21432 +int fdt_add_subnode_namelen(void *fdt, int parentoffset,
21433 +                           const char *name, int namelen)
21434 +{
21435 +       struct fdt_node_header *nh;
21436 +       int offset, nextoffset;
21437 +       int nodelen;
21438 +       int err;
21439 +       uint32_t tag;
21440 +       uint32_t *endtag;
21441 +
21442 +       RW_CHECK_HEADER(fdt);
21443 +
21444 +       offset = fdt_subnode_offset_namelen(fdt, parentoffset, name, namelen);
21445 +       if (offset >= 0)
21446 +               return -FDT_ERR_EXISTS;
21447 +       else if (offset != -FDT_ERR_NOTFOUND)
21448 +               return offset;
21449 +
21450 +       /* Try to place the new node after the parent's properties */
21451 +       fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
21452 +       do {
21453 +               offset = nextoffset;
21454 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
21455 +       } while (tag == FDT_PROP);
21456 +
21457 +       nh = _fdt_offset_ptr_w(fdt, offset);
21458 +       nodelen = sizeof(*nh) + ALIGN(namelen+1, FDT_TAGSIZE) + FDT_TAGSIZE;
21459 +
21460 +       err = _blob_splice_struct(fdt, nh, 0, nodelen);
21461 +       if (err)
21462 +               return err;
21463 +
21464 +       nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
21465 +       memset(nh->name, 0, ALIGN(namelen+1, FDT_TAGSIZE));
21466 +       memcpy(nh->name, name, namelen);
21467 +       endtag = (uint32_t *)((void *)nh + nodelen - FDT_TAGSIZE);
21468 +       *endtag = cpu_to_fdt32(FDT_END_NODE);
21469 +
21470 +       return offset;
21471 +}
21472 +
21473 +int fdt_add_subnode(void *fdt, int parentoffset, const char *name)
21474 +{
21475 +       return fdt_add_subnode_namelen(fdt, parentoffset, name, strlen(name));
21476 +}
21477 +
21478 +int fdt_del_node(void *fdt, int nodeoffset)
21479 +{
21480 +       int endoffset;
21481 +
21482 +       RW_CHECK_HEADER(fdt);
21483 +
21484 +       endoffset = _fdt_node_end_offset(fdt, nodeoffset);
21485 +       if (endoffset < 0)
21486 +               return endoffset;
21487 +
21488 +       return _blob_splice_struct(fdt, _fdt_offset_ptr_w(fdt, nodeoffset),
21489 +                                  endoffset - nodeoffset, 0);
21490 +}
21491 +
21492 +static void _packblocks(const void *fdt, void *buf,
21493 +                      int mem_rsv_size, int struct_size)
21494 +{
21495 +       int mem_rsv_off, struct_off, strings_off;
21496 +
21497 +       mem_rsv_off = ALIGN(sizeof(struct fdt_header), 8);
21498 +       struct_off = mem_rsv_off + mem_rsv_size;
21499 +       strings_off = struct_off + struct_size;
21500 +
21501 +       memmove(buf + mem_rsv_off, fdt + fdt_off_mem_rsvmap(fdt), mem_rsv_size);
21502 +       fdt_set_off_mem_rsvmap(buf, mem_rsv_off);
21503 +
21504 +       memmove(buf + struct_off, fdt + fdt_off_dt_struct(fdt), struct_size);
21505 +       fdt_set_off_dt_struct(buf, struct_off);
21506 +       fdt_set_size_dt_struct(buf, struct_size);
21507 +
21508 +       memmove(buf + strings_off, fdt + fdt_off_dt_strings(fdt),
21509 +               fdt_size_dt_strings(fdt));
21510 +       fdt_set_off_dt_strings(buf, strings_off);
21511 +       fdt_set_size_dt_strings(buf, fdt_size_dt_strings(fdt));
21512 +}
21513 +
21514 +int fdt_open_into(const void *fdt, void *buf, int bufsize)
21515 +{
21516 +       int err;
21517 +       int mem_rsv_size, struct_size;
21518 +       int newsize;
21519 +       void *tmp;
21520 +
21521 +       err = fdt_check_header(fdt);
21522 +       if (err)
21523 +               return err;
21524 +
21525 +       mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
21526 +               * sizeof(struct fdt_reserve_entry);
21527 +
21528 +       if (fdt_version(fdt) >= 17) {
21529 +               struct_size = fdt_size_dt_struct(fdt);
21530 +       } else {
21531 +               struct_size = 0;
21532 +               while (fdt_next_tag(fdt, struct_size, &struct_size) != FDT_END)
21533 +                       ;
21534 +       }
21535 +
21536 +       if (!_blocks_misordered(fdt, mem_rsv_size, struct_size)) {
21537 +               /* no further work necessary */
21538 +               err = fdt_move(fdt, buf, bufsize);
21539 +               if (err)
21540 +                       return err;
21541 +               fdt_set_version(buf, 17);
21542 +               fdt_set_size_dt_struct(buf, struct_size);
21543 +               fdt_set_totalsize(buf, bufsize);
21544 +               return 0;
21545 +       }
21546 +
21547 +       /* Need to reorder */
21548 +       newsize = ALIGN(sizeof(struct fdt_header), 8) + mem_rsv_size
21549 +               + struct_size + fdt_size_dt_strings(fdt);
21550 +
21551 +       if (bufsize < newsize)
21552 +               return -FDT_ERR_NOSPACE;
21553 +
21554 +       if (((buf + newsize) <= fdt)
21555 +           || (buf >= (fdt + fdt_totalsize(fdt)))) {
21556 +               tmp = buf;
21557 +       } else {
21558 +               tmp = (void *)fdt + fdt_totalsize(fdt);
21559 +               if ((tmp + newsize) > (buf + bufsize))
21560 +                       return -FDT_ERR_NOSPACE;
21561 +       }
21562 +
21563 +       _packblocks(fdt, tmp, mem_rsv_size, struct_size);
21564 +       memmove(buf, tmp, newsize);
21565 +
21566 +       fdt_set_magic(buf, FDT_MAGIC);
21567 +       fdt_set_totalsize(buf, bufsize);
21568 +       fdt_set_version(buf, 17);
21569 +       fdt_set_last_comp_version(buf, 16);
21570 +       fdt_set_boot_cpuid_phys(buf, fdt_boot_cpuid_phys(fdt));
21571 +
21572 +       return 0;
21573 +}
21574 +
21575 +int fdt_pack(void *fdt)
21576 +{
21577 +       int mem_rsv_size;
21578 +       int err;
21579 +
21580 +       err = rw_check_header(fdt);
21581 +       if (err)
21582 +               return err;
21583 +
21584 +       mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
21585 +               * sizeof(struct fdt_reserve_entry);
21586 +       _packblocks(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
21587 +       fdt_set_totalsize(fdt, _blob_data_size(fdt));
21588 +
21589 +       return 0;
21590 +}
21591 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt_strerror.c
21592 ===================================================================
21593 --- /dev/null
21594 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt_strerror.c
21595 @@ -0,0 +1,96 @@
21596 +/*
21597 + * libfdt - Flat Device Tree manipulation
21598 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21599 + *
21600 + * libfdt is dual licensed: you can use it either under the terms of
21601 + * the GPL, or the BSD license, at your option.
21602 + *
21603 + *  a) This library is free software; you can redistribute it and/or
21604 + *     modify it under the terms of the GNU General Public License as
21605 + *     published by the Free Software Foundation; either version 2 of the
21606 + *     License, or (at your option) any later version.
21607 + *
21608 + *     This library is distributed in the hope that it will be useful,
21609 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21610 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21611 + *     GNU General Public License for more details.
21612 + *
21613 + *     You should have received a copy of the GNU General Public
21614 + *     License along with this library; if not, write to the Free
21615 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21616 + *     MA 02110-1301 USA
21617 + *
21618 + * Alternatively,
21619 + *
21620 + *  b) Redistribution and use in source and binary forms, with or
21621 + *     without modification, are permitted provided that the following
21622 + *     conditions are met:
21623 + *
21624 + *     1. Redistributions of source code must retain the above
21625 + *        copyright notice, this list of conditions and the following
21626 + *        disclaimer.
21627 + *     2. Redistributions in binary form must reproduce the above
21628 + *        copyright notice, this list of conditions and the following
21629 + *        disclaimer in the documentation and/or other materials
21630 + *        provided with the distribution.
21631 + *
21632 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21633 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21634 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21635 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21636 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21637 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21638 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21639 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21640 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21641 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21642 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21643 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21644 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21645 + */
21646 +#include "libfdt_env.h"
21647 +
21648 +#include <fdt.h>
21649 +#include <libfdt.h>
21650 +
21651 +#include "libfdt_internal.h"
21652 +
21653 +struct errtabent {
21654 +       const char *str;
21655 +};
21656 +
21657 +#define ERRTABENT(val) \
21658 +       [(val)] = { .str = #val, }
21659 +
21660 +static struct errtabent errtable[] = {
21661 +       ERRTABENT(FDT_ERR_NOTFOUND),
21662 +       ERRTABENT(FDT_ERR_EXISTS),
21663 +       ERRTABENT(FDT_ERR_NOSPACE),
21664 +
21665 +       ERRTABENT(FDT_ERR_BADOFFSET),
21666 +       ERRTABENT(FDT_ERR_BADPATH),
21667 +       ERRTABENT(FDT_ERR_BADSTATE),
21668 +
21669 +       ERRTABENT(FDT_ERR_TRUNCATED),
21670 +       ERRTABENT(FDT_ERR_BADMAGIC),
21671 +       ERRTABENT(FDT_ERR_BADVERSION),
21672 +       ERRTABENT(FDT_ERR_BADSTRUCTURE),
21673 +       ERRTABENT(FDT_ERR_BADLAYOUT),
21674 +};
21675 +#define ERRTABSIZE     (sizeof(errtable) / sizeof(errtable[0]))
21676 +
21677 +const char *fdt_strerror(int errval)
21678 +{
21679 +       if (errval > 0)
21680 +               return "<valid offset/length>";
21681 +       else if (errval == 0)
21682 +               return "<no error>";
21683 +       else if (errval > -ERRTABSIZE) {
21684 +               const char *s = errtable[-errval].str;
21685 +
21686 +               if (s)
21687 +                       return s;
21688 +       }
21689 +
21690 +       return "<unknown error>";
21691 +}
21692 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt_sw.c
21693 ===================================================================
21694 --- /dev/null
21695 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt_sw.c
21696 @@ -0,0 +1,258 @@
21697 +/*
21698 + * libfdt - Flat Device Tree manipulation
21699 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21700 + *
21701 + * libfdt is dual licensed: you can use it either under the terms of
21702 + * the GPL, or the BSD license, at your option.
21703 + *
21704 + *  a) This library is free software; you can redistribute it and/or
21705 + *     modify it under the terms of the GNU General Public License as
21706 + *     published by the Free Software Foundation; either version 2 of the
21707 + *     License, or (at your option) any later version.
21708 + *
21709 + *     This library is distributed in the hope that it will be useful,
21710 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21711 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21712 + *     GNU General Public License for more details.
21713 + *
21714 + *     You should have received a copy of the GNU General Public
21715 + *     License along with this library; if not, write to the Free
21716 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21717 + *     MA 02110-1301 USA
21718 + *
21719 + * Alternatively,
21720 + *
21721 + *  b) Redistribution and use in source and binary forms, with or
21722 + *     without modification, are permitted provided that the following
21723 + *     conditions are met:
21724 + *
21725 + *     1. Redistributions of source code must retain the above
21726 + *        copyright notice, this list of conditions and the following
21727 + *        disclaimer.
21728 + *     2. Redistributions in binary form must reproduce the above
21729 + *        copyright notice, this list of conditions and the following
21730 + *        disclaimer in the documentation and/or other materials
21731 + *        provided with the distribution.
21732 + *
21733 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21734 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21735 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21736 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21737 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21738 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21739 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21740 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21741 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21742 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21743 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21744 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21745 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21746 + */
21747 +#include "libfdt_env.h"
21748 +
21749 +#include <fdt.h>
21750 +#include <libfdt.h>
21751 +
21752 +#include "libfdt_internal.h"
21753 +
21754 +static int check_header_sw(void *fdt)
21755 +{
21756 +       if (fdt_magic(fdt) != SW_MAGIC)
21757 +               return -FDT_ERR_BADMAGIC;
21758 +       return 0;
21759 +}
21760 +
21761 +static void *grab_space(void *fdt, int len)
21762 +{
21763 +       int offset = fdt_size_dt_struct(fdt);
21764 +       int spaceleft;
21765 +
21766 +       spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt)
21767 +               - fdt_size_dt_strings(fdt);
21768 +
21769 +       if ((offset + len < offset) || (offset + len > spaceleft))
21770 +               return NULL;
21771 +
21772 +       fdt_set_size_dt_struct(fdt, offset + len);
21773 +       return fdt_offset_ptr_w(fdt, offset, len);
21774 +}
21775 +
21776 +int fdt_create(void *buf, int bufsize)
21777 +{
21778 +       void *fdt = buf;
21779 +
21780 +       if (bufsize < sizeof(struct fdt_header))
21781 +               return -FDT_ERR_NOSPACE;
21782 +
21783 +       memset(buf, 0, bufsize);
21784 +
21785 +       fdt_set_magic(fdt, SW_MAGIC);
21786 +       fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION);
21787 +       fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
21788 +       fdt_set_totalsize(fdt,  bufsize);
21789 +
21790 +       fdt_set_off_mem_rsvmap(fdt, ALIGN(sizeof(struct fdt_header),
21791 +                                         sizeof(struct fdt_reserve_entry)));
21792 +       fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt));
21793 +       fdt_set_off_dt_strings(fdt, bufsize);
21794 +
21795 +       return 0;
21796 +}
21797 +
21798 +int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size)
21799 +{
21800 +       struct fdt_reserve_entry *re;
21801 +       int err = check_header_sw(fdt);
21802 +       int offset;
21803 +
21804 +       if (err)
21805 +               return err;
21806 +       if (fdt_size_dt_struct(fdt))
21807 +               return -FDT_ERR_BADSTATE;
21808 +
21809 +       offset = fdt_off_dt_struct(fdt);
21810 +       if ((offset + sizeof(*re)) > fdt_totalsize(fdt))
21811 +               return -FDT_ERR_NOSPACE;
21812 +
21813 +       re = (struct fdt_reserve_entry *)(fdt + offset);
21814 +       re->address = cpu_to_fdt64(addr);
21815 +       re->size = cpu_to_fdt64(size);
21816 +
21817 +       fdt_set_off_dt_struct(fdt, offset + sizeof(*re));
21818 +
21819 +       return 0;
21820 +}
21821 +
21822 +int fdt_finish_reservemap(void *fdt)
21823 +{
21824 +       return fdt_add_reservemap_entry(fdt, 0, 0);
21825 +}
21826 +
21827 +int fdt_begin_node(void *fdt, const char *name)
21828 +{
21829 +       struct fdt_node_header *nh;
21830 +       int err = check_header_sw(fdt);
21831 +       int namelen = strlen(name) + 1;
21832 +
21833 +       if (err)
21834 +               return err;
21835 +
21836 +       nh = grab_space(fdt, sizeof(*nh) + ALIGN(namelen, FDT_TAGSIZE));
21837 +       if (! nh)
21838 +               return -FDT_ERR_NOSPACE;
21839 +
21840 +       nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
21841 +       memcpy(nh->name, name, namelen);
21842 +       return 0;
21843 +}
21844 +
21845 +int fdt_end_node(void *fdt)
21846 +{
21847 +       uint32_t *en;
21848 +       int err = check_header_sw(fdt);
21849 +
21850 +       if (err)
21851 +               return err;
21852 +
21853 +       en = grab_space(fdt, FDT_TAGSIZE);
21854 +       if (! en)
21855 +               return -FDT_ERR_NOSPACE;
21856 +
21857 +       *en = cpu_to_fdt32(FDT_END_NODE);
21858 +       return 0;
21859 +}
21860 +
21861 +static int find_add_string(void *fdt, const char *s)
21862 +{
21863 +       char *strtab = (char *)fdt + fdt_totalsize(fdt);
21864 +       const char *p;
21865 +       int strtabsize = fdt_size_dt_strings(fdt);
21866 +       int len = strlen(s) + 1;
21867 +       int struct_top, offset;
21868 +
21869 +       p = _fdt_find_string(strtab - strtabsize, strtabsize, s);
21870 +       if (p)
21871 +               return p - strtab;
21872 +
21873 +       /* Add it */
21874 +       offset = -strtabsize - len;
21875 +       struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
21876 +       if (fdt_totalsize(fdt) + offset < struct_top)
21877 +               return 0; /* no more room :( */
21878 +
21879 +       memcpy(strtab + offset, s, len);
21880 +       fdt_set_size_dt_strings(fdt, strtabsize + len);
21881 +       return offset;
21882 +}
21883 +
21884 +int fdt_property(void *fdt, const char *name, const void *val, int len)
21885 +{
21886 +       struct fdt_property *prop;
21887 +       int err = check_header_sw(fdt);
21888 +       int nameoff;
21889 +
21890 +       if (err)
21891 +               return err;
21892 +
21893 +       nameoff = find_add_string(fdt, name);
21894 +       if (nameoff == 0)
21895 +               return -FDT_ERR_NOSPACE;
21896 +
21897 +       prop = grab_space(fdt, sizeof(*prop) + ALIGN(len, FDT_TAGSIZE));
21898 +       if (! prop)
21899 +               return -FDT_ERR_NOSPACE;
21900 +
21901 +       prop->tag = cpu_to_fdt32(FDT_PROP);
21902 +       prop->nameoff = cpu_to_fdt32(nameoff);
21903 +       prop->len = cpu_to_fdt32(len);
21904 +       memcpy(prop->data, val, len);
21905 +       return 0;
21906 +}
21907 +
21908 +int fdt_finish(void *fdt)
21909 +{
21910 +       int err = check_header_sw(fdt);
21911 +       char *p = (char *)fdt;
21912 +       uint32_t *end;
21913 +       int oldstroffset, newstroffset;
21914 +       uint32_t tag;
21915 +       int offset, nextoffset;
21916 +
21917 +       if (err)
21918 +               return err;
21919 +
21920 +       /* Add terminator */
21921 +       end = grab_space(fdt, sizeof(*end));
21922 +       if (! end)
21923 +               return -FDT_ERR_NOSPACE;
21924 +       *end = cpu_to_fdt32(FDT_END);
21925 +
21926 +       /* Relocate the string table */
21927 +       oldstroffset = fdt_totalsize(fdt) - fdt_size_dt_strings(fdt);
21928 +       newstroffset = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
21929 +       memmove(p + newstroffset, p + oldstroffset, fdt_size_dt_strings(fdt));
21930 +       fdt_set_off_dt_strings(fdt, newstroffset);
21931 +
21932 +       /* Walk the structure, correcting string offsets */
21933 +       offset = 0;
21934 +       while ((tag = fdt_next_tag(fdt, offset, &nextoffset)) != FDT_END) {
21935 +               if (tag == FDT_PROP) {
21936 +                       struct fdt_property *prop =
21937 +                               fdt_offset_ptr_w(fdt, offset, sizeof(*prop));
21938 +                       int nameoff;
21939 +
21940 +                       if (! prop)
21941 +                               return -FDT_ERR_BADSTRUCTURE;
21942 +
21943 +                       nameoff = fdt32_to_cpu(prop->nameoff);
21944 +                       nameoff += fdt_size_dt_strings(fdt);
21945 +                       prop->nameoff = cpu_to_fdt32(nameoff);
21946 +               }
21947 +               offset = nextoffset;
21948 +       }
21949 +
21950 +       /* Finally, adjust the header */
21951 +       fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
21952 +       fdt_set_magic(fdt, FDT_MAGIC);
21953 +       return 0;
21954 +}
21955 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt_wip.c
21956 ===================================================================
21957 --- /dev/null
21958 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt/fdt_wip.c
21959 @@ -0,0 +1,144 @@
21960 +/*
21961 + * libfdt - Flat Device Tree manipulation
21962 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21963 + *
21964 + * libfdt is dual licensed: you can use it either under the terms of
21965 + * the GPL, or the BSD license, at your option.
21966 + *
21967 + *  a) This library is free software; you can redistribute it and/or
21968 + *     modify it under the terms of the GNU General Public License as
21969 + *     published by the Free Software Foundation; either version 2 of the
21970 + *     License, or (at your option) any later version.
21971 + *
21972 + *     This library is distributed in the hope that it will be useful,
21973 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21974 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21975 + *     GNU General Public License for more details.
21976 + *
21977 + *     You should have received a copy of the GNU General Public
21978 + *     License along with this library; if not, write to the Free
21979 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21980 + *     MA 02110-1301 USA
21981 + *
21982 + * Alternatively,
21983 + *
21984 + *  b) Redistribution and use in source and binary forms, with or
21985 + *     without modification, are permitted provided that the following
21986 + *     conditions are met:
21987 + *
21988 + *     1. Redistributions of source code must retain the above
21989 + *        copyright notice, this list of conditions and the following
21990 + *        disclaimer.
21991 + *     2. Redistributions in binary form must reproduce the above
21992 + *        copyright notice, this list of conditions and the following
21993 + *        disclaimer in the documentation and/or other materials
21994 + *        provided with the distribution.
21995 + *
21996 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21997 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21998 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21999 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22000 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22001 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22002 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22003 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22004 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22005 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22006 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22007 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
22008 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22009 + */
22010 +#include "libfdt_env.h"
22011 +
22012 +#include <fdt.h>
22013 +#include <libfdt.h>
22014 +
22015 +#include "libfdt_internal.h"
22016 +
22017 +int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
22018 +                       const void *val, int len)
22019 +{
22020 +       void *propval;
22021 +       int proplen;
22022 +
22023 +       propval = fdt_getprop_w(fdt, nodeoffset, name, &proplen);
22024 +       if (! propval)
22025 +               return proplen;
22026 +
22027 +       if (proplen != len)
22028 +               return -FDT_ERR_NOSPACE;
22029 +
22030 +       memcpy(propval, val, len);
22031 +       return 0;
22032 +}
22033 +
22034 +static void nop_region(void *start, int len)
22035 +{
22036 +       uint32_t *p;
22037 +
22038 +       for (p = start; (void *)p < (start + len); p++)
22039 +               *p = cpu_to_fdt32(FDT_NOP);
22040 +}
22041 +
22042 +int fdt_nop_property(void *fdt, int nodeoffset, const char *name)
22043 +{
22044 +       struct fdt_property *prop;
22045 +       int len;
22046 +
22047 +       prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
22048 +       if (! prop)
22049 +               return len;
22050 +
22051 +       nop_region(prop, len + sizeof(*prop));
22052 +
22053 +       return 0;
22054 +}
22055 +
22056 +int _fdt_node_end_offset(void *fdt, int nodeoffset)
22057 +{
22058 +       int level = 0;
22059 +       uint32_t tag;
22060 +       int offset, nextoffset;
22061 +
22062 +       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
22063 +       if (tag != FDT_BEGIN_NODE)
22064 +               return -FDT_ERR_BADOFFSET;
22065 +       do {
22066 +               offset = nextoffset;
22067 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
22068 +
22069 +               switch (tag) {
22070 +               case FDT_END:
22071 +                       return offset;
22072 +
22073 +               case FDT_BEGIN_NODE:
22074 +                       level++;
22075 +                       break;
22076 +
22077 +               case FDT_END_NODE:
22078 +                       level--;
22079 +                       break;
22080 +
22081 +               case FDT_PROP:
22082 +               case FDT_NOP:
22083 +                       break;
22084 +
22085 +               default:
22086 +                       return -FDT_ERR_BADSTRUCTURE;
22087 +               }
22088 +       } while (level >= 0);
22089 +
22090 +       return nextoffset;
22091 +}
22092 +
22093 +int fdt_nop_node(void *fdt, int nodeoffset)
22094 +{
22095 +       int endoffset;
22096 +
22097 +       endoffset = _fdt_node_end_offset(fdt, nodeoffset);
22098 +       if (endoffset < 0)
22099 +               return endoffset;
22100 +
22101 +       nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0), endoffset - nodeoffset);
22102 +       return 0;
22103 +}
22104 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt/libfdt.h
22105 ===================================================================
22106 --- /dev/null
22107 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt/libfdt.h
22108 @@ -0,0 +1,721 @@
22109 +#ifndef _LIBFDT_H
22110 +#define _LIBFDT_H
22111 +/*
22112 + * libfdt - Flat Device Tree manipulation
22113 + * Copyright (C) 2006 David Gibson, IBM Corporation.
22114 + *
22115 + * libfdt is dual licensed: you can use it either under the terms of
22116 + * the GPL, or the BSD license, at your option.
22117 + *
22118 + *  a) This library is free software; you can redistribute it and/or
22119 + *     modify it under the terms of the GNU General Public License as
22120 + *     published by the Free Software Foundation; either version 2 of the
22121 + *     License, or (at your option) any later version.
22122 + *
22123 + *     This library is distributed in the hope that it will be useful,
22124 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
22125 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22126 + *     GNU General Public License for more details.
22127 + *
22128 + *     You should have received a copy of the GNU General Public
22129 + *     License along with this library; if not, write to the Free
22130 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22131 + *     MA 02110-1301 USA
22132 + *
22133 + * Alternatively,
22134 + *
22135 + *  b) Redistribution and use in source and binary forms, with or
22136 + *     without modification, are permitted provided that the following
22137 + *     conditions are met:
22138 + *
22139 + *     1. Redistributions of source code must retain the above
22140 + *        copyright notice, this list of conditions and the following
22141 + *        disclaimer.
22142 + *     2. Redistributions in binary form must reproduce the above
22143 + *        copyright notice, this list of conditions and the following
22144 + *        disclaimer in the documentation and/or other materials
22145 + *        provided with the distribution.
22146 + *
22147 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22148 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22149 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22150 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22151 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22152 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22153 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22154 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22155 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22156 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22157 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22158 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
22159 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22160 + */
22161 +
22162 +#include <libfdt_env.h>
22163 +#include <fdt.h>
22164 +
22165 +#define FDT_FIRST_SUPPORTED_VERSION    0x10
22166 +#define FDT_LAST_SUPPORTED_VERSION     0x11
22167 +
22168 +/* Error codes: informative error codes */
22169 +#define FDT_ERR_NOTFOUND       1
22170 +       /* FDT_ERR_NOTFOUND: The requested node or property does not exist */
22171 +#define FDT_ERR_EXISTS         2
22172 +       /* FDT_ERR_EXISTS: Attemped to create a node or property which
22173 +        * already exists */
22174 +#define FDT_ERR_NOSPACE                3
22175 +       /* FDT_ERR_NOSPACE: Operation needed to expand the device
22176 +        * tree, but its buffer did not have sufficient space to
22177 +        * contain the expanded tree. Use fdt_open_into() to move the
22178 +        * device tree to a buffer with more space. */
22179 +
22180 +/* Error codes: codes for bad parameters */
22181 +#define FDT_ERR_BADOFFSET      4
22182 +       /* FDT_ERR_BADOFFSET: Function was passed a structure block
22183 +        * offset which is out-of-bounds, or which points to an
22184 +        * unsuitable part of the structure for the operation. */
22185 +#define FDT_ERR_BADPATH                5
22186 +       /* FDT_ERR_BADPATH: Function was passed a badly formatted path
22187 +        * (e.g. missing a leading / for a function which requires an
22188 +        * absolute path) */
22189 +#define FDT_ERR_BADPHANDLE     6
22190 +       /* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
22191 +        * value.  phandle values of 0 and -1 are not permitted. */
22192 +#define FDT_ERR_BADSTATE       7
22193 +       /* FDT_ERR_BADSTATE: Function was passed an incomplete device
22194 +        * tree created by the sequential-write functions, which is
22195 +        * not sufficiently complete for the requested operation. */
22196 +
22197 +/* Error codes: codes for bad device tree blobs */
22198 +#define FDT_ERR_TRUNCATED      8
22199 +       /* FDT_ERR_TRUNCATED: Structure block of the given device tree
22200 +        * ends without an FDT_END tag. */
22201 +#define FDT_ERR_BADMAGIC       9
22202 +       /* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
22203 +        * device tree at all - it is missing the flattened device
22204 +        * tree magic number. */
22205 +#define FDT_ERR_BADVERSION     10
22206 +       /* FDT_ERR_BADVERSION: Given device tree has a version which
22207 +        * can't be handled by the requested operation.  For
22208 +        * read-write functions, this may mean that fdt_open_into() is
22209 +        * required to convert the tree to the expected version. */
22210 +#define FDT_ERR_BADSTRUCTURE   11
22211 +       /* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
22212 +        * structure block or other serious error (e.g. misnested
22213 +        * nodes, or subnodes preceding properties). */
22214 +#define FDT_ERR_BADLAYOUT      12
22215 +       /* FDT_ERR_BADLAYOUT: For read-write functions, the given
22216 +        * device tree has it's sub-blocks in an order that the
22217 +        * function can't handle (memory reserve map, then structure,
22218 +        * then strings).  Use fdt_open_into() to reorganize the tree
22219 +        * into a form suitable for the read-write operations. */
22220 +
22221 +/* "Can't happen" error indicating a bug in libfdt */
22222 +#define FDT_ERR_INTERNAL       13
22223 +       /* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
22224 +        * Should never be returned, if it is, it indicates a bug in
22225 +        * libfdt itself. */
22226 +
22227 +#define FDT_ERR_MAX            13
22228 +
22229 +/**********************************************************************/
22230 +/* Low-level functions (you probably don't need these)                */
22231 +/**********************************************************************/
22232 +
22233 +const void *fdt_offset_ptr(const void *fdt, int offset, int checklen);
22234 +static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
22235 +{
22236 +       return (void *)fdt_offset_ptr(fdt, offset, checklen);
22237 +}
22238 +
22239 +uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
22240 +
22241 +/**********************************************************************/
22242 +/* General functions                                                  */
22243 +/**********************************************************************/
22244 +
22245 +#define fdt_get_header(fdt, field) \
22246 +       (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
22247 +#define fdt_magic(fdt)                         (fdt_get_header(fdt, magic))
22248 +#define fdt_totalsize(fdt)             (fdt_get_header(fdt, totalsize))
22249 +#define fdt_off_dt_struct(fdt)         (fdt_get_header(fdt, off_dt_struct))
22250 +#define fdt_off_dt_strings(fdt)                (fdt_get_header(fdt, off_dt_strings))
22251 +#define fdt_off_mem_rsvmap(fdt)                (fdt_get_header(fdt, off_mem_rsvmap))
22252 +#define fdt_version(fdt)               (fdt_get_header(fdt, version))
22253 +#define fdt_last_comp_version(fdt)     (fdt_get_header(fdt, last_comp_version))
22254 +#define fdt_boot_cpuid_phys(fdt)       (fdt_get_header(fdt, boot_cpuid_phys))
22255 +#define fdt_size_dt_strings(fdt)       (fdt_get_header(fdt, size_dt_strings))
22256 +#define fdt_size_dt_struct(fdt)                (fdt_get_header(fdt, size_dt_struct))
22257 +
22258 +#define __fdt_set_hdr(name) \
22259 +       static inline void fdt_set_##name(void *fdt, uint32_t val) \
22260 +       { \
22261 +               struct fdt_header *fdth = fdt; \
22262 +               fdth->name = cpu_to_fdt32(val); \
22263 +       }
22264 +__fdt_set_hdr(magic);
22265 +__fdt_set_hdr(totalsize);
22266 +__fdt_set_hdr(off_dt_struct);
22267 +__fdt_set_hdr(off_dt_strings);
22268 +__fdt_set_hdr(off_mem_rsvmap);
22269 +__fdt_set_hdr(version);
22270 +__fdt_set_hdr(last_comp_version);
22271 +__fdt_set_hdr(boot_cpuid_phys);
22272 +__fdt_set_hdr(size_dt_strings);
22273 +__fdt_set_hdr(size_dt_struct);
22274 +#undef __fdt_set_hdr
22275 +
22276 +/**
22277 + * fdt_check_header - sanity check a device tree or possible device tree
22278 + * @fdt: pointer to data which might be a flattened device tree
22279 + *
22280 + * fdt_check_header() checks that the given buffer contains what
22281 + * appears to be a flattened device tree with sane information in its
22282 + * header.
22283 + *
22284 + * returns:
22285 + *     0, if the buffer appears to contain a valid device tree
22286 + *     -FDT_ERR_BADMAGIC,
22287 + *     -FDT_ERR_BADVERSION,
22288 + *     -FDT_ERR_BADSTATE, standard meanings, as above
22289 + */
22290 +int fdt_check_header(const void *fdt);
22291 +
22292 +/**
22293 + * fdt_move - move a device tree around in memory
22294 + * @fdt: pointer to the device tree to move
22295 + * @buf: pointer to memory where the device is to be moved
22296 + * @bufsize: size of the memory space at buf
22297 + *
22298 + * fdt_move() relocates, if possible, the device tree blob located at
22299 + * fdt to the buffer at buf of size bufsize.  The buffer may overlap
22300 + * with the existing device tree blob at fdt.  Therefore,
22301 + *     fdt_move(fdt, fdt, fdt_totalsize(fdt))
22302 + * should always succeed.
22303 + *
22304 + * returns:
22305 + *     0, on success
22306 + *     -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
22307 + *     -FDT_ERR_BADMAGIC,
22308 + *     -FDT_ERR_BADVERSION,
22309 + *     -FDT_ERR_BADSTATE, standard meanings
22310 + */
22311 +int fdt_move(const void *fdt, void *buf, int bufsize);
22312 +
22313 +/**********************************************************************/
22314 +/* Read-only functions                                                */
22315 +/**********************************************************************/
22316 +
22317 +/**
22318 + * fdt_string - retreive a string from the strings block of a device tree
22319 + * @fdt: pointer to the device tree blob
22320 + * @stroffset: offset of the string within the strings block (native endian)
22321 + *
22322 + * fdt_string() retrieves a pointer to a single string from the
22323 + * strings block of the device tree blob at fdt.
22324 + *
22325 + * returns:
22326 + *     a pointer to the string, on success
22327 + *     NULL, if stroffset is out of bounds
22328 + */
22329 +const char *fdt_string(const void *fdt, int stroffset);
22330 +
22331 +/**
22332 + * fdt_num_mem_rsv - retreive the number of memory reserve map entries
22333 + * @fdt: pointer to the device tree blob
22334 + *
22335 + * Returns the number of entries in the device tree blob's memory
22336 + * reservation map.  This does not include the terminating 0,0 entry
22337 + * or any other (0,0) entries reserved for expansion.
22338 + *
22339 + * returns:
22340 + *     the number of entries
22341 + */
22342 +int fdt_num_mem_rsv(const void *fdt);
22343 +
22344 +/**
22345 + * fdt_get_mem_rsv - retreive one memory reserve map entry
22346 + * @fdt: pointer to the device tree blob
22347 + * @address, @size: pointers to 64-bit variables
22348 + *
22349 + * On success, *address and *size will contain the address and size of
22350 + * the n-th reserve map entry from the device tree blob, in
22351 + * native-endian format.
22352 + *
22353 + * returns:
22354 + *     0, on success
22355 + *     -FDT_ERR_BADMAGIC,
22356 + *     -FDT_ERR_BADVERSION,
22357 + *     -FDT_ERR_BADSTATE, standard meanings
22358 + */
22359 +int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
22360 +
22361 +/**
22362 + * fdt_subnode_offset_namelen - find a subnode based on substring
22363 + * @fdt: pointer to the device tree blob
22364 + * @parentoffset: structure block offset of a node
22365 + * @name: name of the subnode to locate
22366 + * @namelen: number of characters of name to consider
22367 + *
22368 + * Identical to fdt_subnode_offset(), but only examine the first
22369 + * namelen characters of name for matching the subnode name.  This is
22370 + * useful for finding subnodes based on a portion of a larger string,
22371 + * such as a full path.
22372 + */
22373 +int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
22374 +                              const char *name, int namelen);
22375 +/**
22376 + * fdt_subnode_offset - find a subnode of a given node
22377 + * @fdt: pointer to the device tree blob
22378 + * @parentoffset: structure block offset of a node
22379 + * @name: name of the subnode to locate
22380 + *
22381 + * fdt_subnode_offset() finds a subnode of the node at structure block
22382 + * offset parentoffset with the given name.  name may include a unit
22383 + * address, in which case fdt_subnode_offset() will find the subnode
22384 + * with that unit address, or the unit address may be omitted, in
22385 + * which case fdt_subnode_offset() will find an arbitrary subnode
22386 + * whose name excluding unit address matches the given name.
22387 + *
22388 + * returns:
22389 + *     structure block offset of the requested subnode (>=0), on success
22390 + *     -FDT_ERR_NOTFOUND, if the requested subnode does not exist
22391 + *     -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
22392 + *      -FDT_ERR_BADMAGIC,
22393 + *     -FDT_ERR_BADVERSION,
22394 + *     -FDT_ERR_BADSTATE,
22395 + *     -FDT_ERR_BADSTRUCTURE,
22396 + *     -FDT_ERR_TRUNCATED, standard meanings.
22397 + */
22398 +int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
22399 +
22400 +/**
22401 + * fdt_path_offset - find a tree node by its full path
22402 + * @fdt: pointer to the device tree blob
22403 + * @path: full path of the node to locate
22404 + *
22405 + * fdt_path_offset() finds a node of a given path in the device tree.
22406 + * Each path component may omit the unit address portion, but the
22407 + * results of this are undefined if any such path component is
22408 + * ambiguous (that is if there are multiple nodes at the relevant
22409 + * level matching the given component, differentiated only by unit
22410 + * address).
22411 + *
22412 + * returns:
22413 + *     structure block offset of the node with the requested path (>=0), on success
22414 + *     -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
22415 + *     -FDT_ERR_NOTFOUND, if the requested node does not exist
22416 + *      -FDT_ERR_BADMAGIC,
22417 + *     -FDT_ERR_BADVERSION,
22418 + *     -FDT_ERR_BADSTATE,
22419 + *     -FDT_ERR_BADSTRUCTURE,
22420 + *     -FDT_ERR_TRUNCATED, standard meanings.
22421 + */
22422 +int fdt_path_offset(const void *fdt, const char *path);
22423 +
22424 +/**
22425 + * fdt_get_name - retreive the name of a given node
22426 + * @fdt: pointer to the device tree blob
22427 + * @nodeoffset: structure block offset of the starting node
22428 + * @lenp: pointer to an integer variable (will be overwritten) or NULL
22429 + *
22430 + * fdt_get_name() retrieves the name (including unit address) of the
22431 + * device tree node at structure block offset nodeoffset.  If lenp is
22432 + * non-NULL, the length of this name is also returned, in the integer
22433 + * pointed to by lenp.
22434 + *
22435 + * returns:
22436 + *     pointer to the node's name, on success
22437 + *             If lenp is non-NULL, *lenp contains the length of that name (>=0)
22438 + *     NULL, on error
22439 + *             if lenp is non-NULL *lenp contains an error code (<0):
22440 + *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
22441 + *             -FDT_ERR_BADMAGIC,
22442 + *             -FDT_ERR_BADVERSION,
22443 + *             -FDT_ERR_BADSTATE, standard meanings
22444 + */
22445 +const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
22446 +
22447 +/**
22448 + * fdt_get_property - find a given property in a given node
22449 + * @fdt: pointer to the device tree blob
22450 + * @nodeoffset: offset of the node whose property to find
22451 + * @name: name of the property to find
22452 + * @lenp: pointer to an integer variable (will be overwritten) or NULL
22453 + *
22454 + * fdt_get_property() retrieves a pointer to the fdt_property
22455 + * structure within the device tree blob corresponding to the property
22456 + * named 'name' of the node at offset nodeoffset.  If lenp is
22457 + * non-NULL, the length of the property value also returned, in the
22458 + * integer pointed to by lenp.
22459 + *
22460 + * returns:
22461 + *     pointer to the structure representing the property
22462 + *             if lenp is non-NULL, *lenp contains the length of the property
22463 + *             value (>=0)
22464 + *     NULL, on error
22465 + *             if lenp is non-NULL, *lenp contains an error code (<0):
22466 + *             -FDT_ERR_NOTFOUND, node does not have named property
22467 + *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
22468 + *             -FDT_ERR_BADMAGIC,
22469 + *             -FDT_ERR_BADVERSION,
22470 + *             -FDT_ERR_BADSTATE,
22471 + *             -FDT_ERR_BADSTRUCTURE,
22472 + *             -FDT_ERR_TRUNCATED, standard meanings
22473 + */
22474 +const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
22475 +                                           const char *name, int *lenp);
22476 +static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
22477 +                                                     const char *name,
22478 +                                                     int *lenp)
22479 +{
22480 +       return (struct fdt_property *)fdt_get_property(fdt, nodeoffset,
22481 +                                                      name, lenp);
22482 +}
22483 +
22484 +/**
22485 + * fdt_getprop - retrieve the value of a given property
22486 + * @fdt: pointer to the device tree blob
22487 + * @nodeoffset: offset of the node whose property to find
22488 + * @name: name of the property to find
22489 + * @lenp: pointer to an integer variable (will be overwritten) or NULL
22490 + *
22491 + * fdt_getprop() retrieves a pointer to the value of the property
22492 + * named 'name' of the node at offset nodeoffset (this will be a
22493 + * pointer to within the device blob itself, not a copy of the value).
22494 + * If lenp is non-NULL, the length of the property value also
22495 + * returned, in the integer pointed to by lenp.
22496 + *
22497 + * returns:
22498 + *     pointer to the property's value
22499 + *             if lenp is non-NULL, *lenp contains the length of the property
22500 + *             value (>=0)
22501 + *     NULL, on error
22502 + *             if lenp is non-NULL, *lenp contains an error code (<0):
22503 + *             -FDT_ERR_NOTFOUND, node does not have named property
22504 + *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
22505 + *             -FDT_ERR_BADMAGIC,
22506 + *             -FDT_ERR_BADVERSION,
22507 + *             -FDT_ERR_BADSTATE,
22508 + *             -FDT_ERR_BADSTRUCTURE,
22509 + *             -FDT_ERR_TRUNCATED, standard meanings
22510 + */
22511 +const void *fdt_getprop(const void *fdt, int nodeoffset,
22512 +                       const char *name, int *lenp);
22513 +static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
22514 +                                 const char *name, int *lenp)
22515 +{
22516 +       return (void *)fdt_getprop(fdt, nodeoffset, name, lenp);
22517 +}
22518 +
22519 +/**
22520 + * fdt_get_phandle - retreive the phandle of a given node
22521 + * @fdt: pointer to the device tree blob
22522 + * @nodeoffset: structure block offset of the node
22523 + *
22524 + * fdt_get_phandle() retrieves the phandle of the device tree node at
22525 + * structure block offset nodeoffset.
22526 + *
22527 + * returns:
22528 + *     the phandle of the node at nodeoffset, on succes (!= 0, != -1)
22529 + *     0, if the node has no phandle, or another error occurs
22530 + */
22531 +uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
22532 +
22533 +/**
22534 + * fdt_get_path - determine the full path of a node
22535 + * @fdt: pointer to the device tree blob
22536 + * @nodeoffset: offset of the node whose path to find
22537 + * @buf: character buffer to contain the returned path (will be overwritten)
22538 + * @buflen: size of the character buffer at buf
22539 + *
22540 + * fdt_get_path() computes the full path of the node at offset
22541 + * nodeoffset, and records that path in the buffer at buf.
22542 + *
22543 + * NOTE: This function is expensive, as it must scan the device tree
22544 + * structure from the start to nodeoffset.
22545 + *
22546 + * returns:
22547 + *     0, on success
22548 + *             buf contains the absolute path of the node at
22549 + *             nodeoffset, as a NUL-terminated string.
22550 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22551 + *     -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
22552 + *             characters and will not fit in the given buffer.
22553 + *     -FDT_ERR_BADMAGIC,
22554 + *     -FDT_ERR_BADVERSION,
22555 + *     -FDT_ERR_BADSTATE,
22556 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22557 + */
22558 +int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
22559 +
22560 +/**
22561 + * fdt_supernode_atdepth_offset - find a specific ancestor of a node
22562 + * @fdt: pointer to the device tree blob
22563 + * @nodeoffset: offset of the node whose parent to find
22564 + * @supernodedepth: depth of the ancestor to find
22565 + * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
22566 + *
22567 + * fdt_supernode_atdepth_offset() finds an ancestor of the given node
22568 + * at a specific depth from the root (where the root itself has depth
22569 + * 0, its immediate subnodes depth 1 and so forth).  So
22570 + *     fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
22571 + * will always return 0, the offset of the root node.  If the node at
22572 + * nodeoffset has depth D, then:
22573 + *     fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
22574 + * will return nodeoffset itself.
22575 + *
22576 + * NOTE: This function is expensive, as it must scan the device tree
22577 + * structure from the start to nodeoffset.
22578 + *
22579 + * returns:
22580 +
22581 + *     structure block offset of the node at node offset's ancestor
22582 + *             of depth supernodedepth (>=0), on success
22583 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22584 +*      -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
22585 + *     -FDT_ERR_BADMAGIC,
22586 + *     -FDT_ERR_BADVERSION,
22587 + *     -FDT_ERR_BADSTATE,
22588 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22589 + */
22590 +int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
22591 +                                int supernodedepth, int *nodedepth);
22592 +
22593 +/**
22594 + * fdt_node_depth - find the depth of a given node
22595 + * @fdt: pointer to the device tree blob
22596 + * @nodeoffset: offset of the node whose parent to find
22597 + *
22598 + * fdt_node_depth() finds the depth of a given node.  The root node
22599 + * has depth 0, its immediate subnodes depth 1 and so forth.
22600 + *
22601 + * NOTE: This function is expensive, as it must scan the device tree
22602 + * structure from the start to nodeoffset.
22603 + *
22604 + * returns:
22605 + *     depth of the node at nodeoffset (>=0), on success
22606 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22607 + *     -FDT_ERR_BADMAGIC,
22608 + *     -FDT_ERR_BADVERSION,
22609 + *     -FDT_ERR_BADSTATE,
22610 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22611 + */
22612 +int fdt_node_depth(const void *fdt, int nodeoffset);
22613 +
22614 +/**
22615 + * fdt_parent_offset - find the parent of a given node
22616 + * @fdt: pointer to the device tree blob
22617 + * @nodeoffset: offset of the node whose parent to find
22618 + *
22619 + * fdt_parent_offset() locates the parent node of a given node (that
22620 + * is, it finds the offset of the node which contains the node at
22621 + * nodeoffset as a subnode).
22622 + *
22623 + * NOTE: This function is expensive, as it must scan the device tree
22624 + * structure from the start to nodeoffset, *twice*.
22625 + *
22626 + * returns:
22627 + *     stucture block offset of the parent of the node at nodeoffset
22628 + *             (>=0), on success
22629 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22630 + *     -FDT_ERR_BADMAGIC,
22631 + *     -FDT_ERR_BADVERSION,
22632 + *     -FDT_ERR_BADSTATE,
22633 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22634 + */
22635 +int fdt_parent_offset(const void *fdt, int nodeoffset);
22636 +
22637 +/**
22638 + * fdt_node_offset_by_prop_value - find nodes with a given property value
22639 + * @fdt: pointer to the device tree blob
22640 + * @startoffset: only find nodes after this offset
22641 + * @propname: property name to check
22642 + * @propval: property value to search for
22643 + * @proplen: length of the value in propval
22644 + *
22645 + * fdt_node_offset_by_prop_value() returns the offset of the first
22646 + * node after startoffset, which has a property named propname whose
22647 + * value is of length proplen and has value equal to propval; or if
22648 + * startoffset is -1, the very first such node in the tree.
22649 + *
22650 + * To iterate through all nodes matching the criterion, the following
22651 + * idiom can be used:
22652 + *     offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
22653 + *                                            propval, proplen);
22654 + *     while (offset != -FDT_ERR_NOTFOUND) {
22655 + *             // other code here
22656 + *             offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
22657 + *                                                    propval, proplen);
22658 + *     }
22659 + *
22660 + * Note the -1 in the first call to the function, if 0 is used here
22661 + * instead, the function will never locate the root node, even if it
22662 + * matches the criterion.
22663 + *
22664 + * returns:
22665 + *     structure block offset of the located node (>= 0, >startoffset),
22666 + *              on success
22667 + *     -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
22668 + *             tree after startoffset
22669 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22670 + *     -FDT_ERR_BADMAGIC,
22671 + *     -FDT_ERR_BADVERSION,
22672 + *     -FDT_ERR_BADSTATE,
22673 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22674 + */
22675 +int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
22676 +                                 const char *propname,
22677 +                                 const void *propval, int proplen);
22678 +
22679 +/**
22680 + * fdt_node_offset_by_phandle - find the node with a given phandle
22681 + * @fdt: pointer to the device tree blob
22682 + * @phandle: phandle value
22683 + *
22684 + * fdt_node_offset_by_prop_value() returns the offset of the node
22685 + * which has the given phandle value.  If there is more than one node
22686 + * in the tree with the given phandle (an invalid tree), results are
22687 + * undefined.
22688 + *
22689 + * returns:
22690 + *     structure block offset of the located node (>= 0), on success
22691 + *     -FDT_ERR_NOTFOUND, no node with that phandle exists
22692 + *     -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
22693 + *     -FDT_ERR_BADMAGIC,
22694 + *     -FDT_ERR_BADVERSION,
22695 + *     -FDT_ERR_BADSTATE,
22696 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22697 + */
22698 +int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
22699 +
22700 +/**
22701 + * fdt_node_check_compatible: check a node's compatible property
22702 + * @fdt: pointer to the device tree blob
22703 + * @nodeoffset: offset of a tree node
22704 + * @compatible: string to match against
22705 + *
22706 + *
22707 + * fdt_node_check_compatible() returns 0 if the given node contains a
22708 + * 'compatible' property with the given string as one of its elements,
22709 + * it returns non-zero otherwise, or on error.
22710 + *
22711 + * returns:
22712 + *     0, if the node has a 'compatible' property listing the given string
22713 + *     1, if the node has a 'compatible' property, but it does not list
22714 + *             the given string
22715 + *     -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
22716 + *     -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
22717 + *     -FDT_ERR_BADMAGIC,
22718 + *     -FDT_ERR_BADVERSION,
22719 + *     -FDT_ERR_BADSTATE,
22720 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22721 + */
22722 +int fdt_node_check_compatible(const void *fdt, int nodeoffset,
22723 +                             const char *compatible);
22724 +
22725 +/**
22726 + * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
22727 + * @fdt: pointer to the device tree blob
22728 + * @startoffset: only find nodes after this offset
22729 + * @compatible: 'compatible' string to match against
22730 + *
22731 + * fdt_node_offset_by_compatible() returns the offset of the first
22732 + * node after startoffset, which has a 'compatible' property which
22733 + * lists the given compatible string; or if startoffset is -1, the
22734 + * very first such node in the tree.
22735 + *
22736 + * To iterate through all nodes matching the criterion, the following
22737 + * idiom can be used:
22738 + *     offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
22739 + *     while (offset != -FDT_ERR_NOTFOUND) {
22740 + *             // other code here
22741 + *             offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
22742 + *     }
22743 + *
22744 + * Note the -1 in the first call to the function, if 0 is used here
22745 + * instead, the function will never locate the root node, even if it
22746 + * matches the criterion.
22747 + *
22748 + * returns:
22749 + *     structure block offset of the located node (>= 0, >startoffset),
22750 + *              on success
22751 + *     -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
22752 + *             tree after startoffset
22753 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22754 + *     -FDT_ERR_BADMAGIC,
22755 + *     -FDT_ERR_BADVERSION,
22756 + *     -FDT_ERR_BADSTATE,
22757 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22758 + */
22759 +int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
22760 +                                 const char *compatible);
22761 +
22762 +/**********************************************************************/
22763 +/* Write-in-place functions                                           */
22764 +/**********************************************************************/
22765 +
22766 +int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
22767 +                       const void *val, int len);
22768 +static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
22769 +                                          const char *name, uint32_t val)
22770 +{
22771 +       val = cpu_to_fdt32(val);
22772 +       return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
22773 +}
22774 +
22775 +int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
22776 +int fdt_nop_node(void *fdt, int nodeoffset);
22777 +
22778 +/**********************************************************************/
22779 +/* Sequential write functions                                         */
22780 +/**********************************************************************/
22781 +
22782 +int fdt_create(void *buf, int bufsize);
22783 +int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
22784 +int fdt_finish_reservemap(void *fdt);
22785 +int fdt_begin_node(void *fdt, const char *name);
22786 +int fdt_property(void *fdt, const char *name, const void *val, int len);
22787 +static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
22788 +{
22789 +       val = cpu_to_fdt32(val);
22790 +       return fdt_property(fdt, name, &val, sizeof(val));
22791 +}
22792 +#define fdt_property_string(fdt, name, str) \
22793 +       fdt_property(fdt, name, str, strlen(str)+1)
22794 +int fdt_end_node(void *fdt);
22795 +int fdt_finish(void *fdt);
22796 +
22797 +/**********************************************************************/
22798 +/* Read-write functions                                               */
22799 +/**********************************************************************/
22800 +
22801 +int fdt_open_into(const void *fdt, void *buf, int bufsize);
22802 +int fdt_pack(void *fdt);
22803 +
22804 +int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
22805 +int fdt_del_mem_rsv(void *fdt, int n);
22806 +
22807 +int fdt_setprop(void *fdt, int nodeoffset, const char *name,
22808 +               const void *val, int len);
22809 +static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
22810 +                                  uint32_t val)
22811 +{
22812 +       val = cpu_to_fdt32(val);
22813 +       return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
22814 +}
22815 +#define fdt_setprop_string(fdt, nodeoffset, name, str) \
22816 +       fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
22817 +int fdt_delprop(void *fdt, int nodeoffset, const char *name);
22818 +int fdt_add_subnode_namelen(void *fdt, int parentoffset,
22819 +                           const char *name, int namelen);
22820 +int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
22821 +int fdt_del_node(void *fdt, int nodeoffset);
22822 +
22823 +/**********************************************************************/
22824 +/* Debugging / informational functions                                */
22825 +/**********************************************************************/
22826 +
22827 +const char *fdt_strerror(int errval);
22828 +
22829 +#endif /* _LIBFDT_H */
22830 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt/libfdt_internal.h
22831 ===================================================================
22832 --- /dev/null
22833 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt/libfdt_internal.h
22834 @@ -0,0 +1,89 @@
22835 +#ifndef _LIBFDT_INTERNAL_H
22836 +#define _LIBFDT_INTERNAL_H
22837 +/*
22838 + * libfdt - Flat Device Tree manipulation
22839 + * Copyright (C) 2006 David Gibson, IBM Corporation.
22840 + *
22841 + * libfdt is dual licensed: you can use it either under the terms of
22842 + * the GPL, or the BSD license, at your option.
22843 + *
22844 + *  a) This library is free software; you can redistribute it and/or
22845 + *     modify it under the terms of the GNU General Public License as
22846 + *     published by the Free Software Foundation; either version 2 of the
22847 + *     License, or (at your option) any later version.
22848 + *
22849 + *     This library is distributed in the hope that it will be useful,
22850 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
22851 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22852 + *     GNU General Public License for more details.
22853 + *
22854 + *     You should have received a copy of the GNU General Public
22855 + *     License along with this library; if not, write to the Free
22856 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22857 + *     MA 02110-1301 USA
22858 + *
22859 + * Alternatively,
22860 + *
22861 + *  b) Redistribution and use in source and binary forms, with or
22862 + *     without modification, are permitted provided that the following
22863 + *     conditions are met:
22864 + *
22865 + *     1. Redistributions of source code must retain the above
22866 + *        copyright notice, this list of conditions and the following
22867 + *        disclaimer.
22868 + *     2. Redistributions in binary form must reproduce the above
22869 + *        copyright notice, this list of conditions and the following
22870 + *        disclaimer in the documentation and/or other materials
22871 + *        provided with the distribution.
22872 + *
22873 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22874 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22875 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22876 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22877 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22878 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22879 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22880 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22881 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22882 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22883 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22884 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
22885 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22886 + */
22887 +#include <fdt.h>
22888 +
22889 +#define ALIGN(x, a)    (((x) + (a) - 1) & ~((a) - 1))
22890 +#define PALIGN(p, a)   ((void *)ALIGN((unsigned long)(p), (a)))
22891 +
22892 +#define memeq(p, q, n) (memcmp((p), (q), (n)) == 0)
22893 +#define streq(p, q)    (strcmp((p), (q)) == 0)
22894 +
22895 +uint32_t _fdt_next_tag(const void *fdt, int startoffset, int *nextoffset);
22896 +const char *_fdt_find_string(const char *strtab, int tabsize, const char *s);
22897 +int _fdt_node_end_offset(void *fdt, int nodeoffset);
22898 +
22899 +static inline const void *_fdt_offset_ptr(const void *fdt, int offset)
22900 +{
22901 +       return fdt + fdt_off_dt_struct(fdt) + offset;
22902 +}
22903 +
22904 +static inline void *_fdt_offset_ptr_w(void *fdt, int offset)
22905 +{
22906 +       return (void *)_fdt_offset_ptr(fdt, offset);
22907 +}
22908 +
22909 +static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n)
22910 +{
22911 +       const struct fdt_reserve_entry *rsv_table =
22912 +               fdt + fdt_off_mem_rsvmap(fdt);
22913 +
22914 +       return rsv_table + n;
22915 +}
22916 +static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
22917 +{
22918 +       return (void *)_fdt_mem_rsv(fdt, n);
22919 +}
22920 +
22921 +#define SW_MAGIC               (~FDT_MAGIC)
22922 +
22923 +#endif /* _LIBFDT_INTERNAL_H */
22924 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt-wrapper.c
22925 ===================================================================
22926 --- /dev/null
22927 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt-wrapper.c
22928 @@ -0,0 +1,184 @@
22929 +/*
22930 + * This file does the necessary interface mapping between the bootwrapper
22931 + * device tree operations and the interface provided by shared source
22932 + * files flatdevicetree.[ch].
22933 + *
22934 + * Copyright 2007 David Gibson, IBM Corporation.
22935 + *
22936 + * This library is free software; you can redistribute it and/or
22937 + * modify it under the terms of the GNU General Public License as
22938 + * published by the Free Software Foundation; either version 2 of the
22939 + * License, or (at your option) any later version.
22940 + *
22941 + * This library is distributed in the hope that it will be useful, but
22942 + * WITHOUT ANY WARRANTY; without even the implied warranty of
22943 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22944 + * General Public License for more details.
22945 + *
22946 + * You should have received a copy of the GNU General Public License
22947 + * along with this library; if not, write to the Free Software
22948 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22949 + * 02110-1301 USA
22950 + */
22951 +
22952 +#include <stddef.h>
22953 +#include <stdio.h>
22954 +#include <page.h>
22955 +#include <libfdt.h>
22956 +#include "ops.h"
22957 +
22958 +#define DEBUG  0
22959 +#define BAD_ERROR(err) (((err) < 0) \
22960 +                        && ((err) != -FDT_ERR_NOTFOUND) \
22961 +                        && ((err) != -FDT_ERR_EXISTS))
22962 +
22963 +#define check_err(err) \
22964 +       ({ \
22965 +               if (BAD_ERROR(err) || ((err < 0) && DEBUG)) \
22966 +                       printf("%s():%d  %s\n\r", __FUNCTION__, __LINE__, \
22967 +                              fdt_strerror(err)); \
22968 +               if (BAD_ERROR(err)) \
22969 +                       exit(); \
22970 +               (err < 0) ? -1 : 0; \
22971 +       })
22972 +
22973 +#define offset_devp(off)       \
22974 +       ({ \
22975 +               int _offset = (off); \
22976 +               check_err(_offset) ? NULL : (void *)(_offset+1); \
22977 +       })
22978 +
22979 +#define devp_offset_find(devp) (((int)(devp))-1)
22980 +#define devp_offset(devp)      (devp ? ((int)(devp))-1 : 0)
22981 +
22982 +static void *fdt;
22983 +static void *buf; /* = NULL */
22984 +
22985 +#define EXPAND_GRANULARITY     1024
22986 +
22987 +static void expand_buf(int minexpand)
22988 +{
22989 +       int size = fdt_totalsize(fdt);
22990 +       int rc;
22991 +
22992 +       size = _ALIGN(size + minexpand, EXPAND_GRANULARITY);
22993 +       buf = platform_ops.realloc(buf, size);
22994 +       if (!buf)
22995 +               fatal("Couldn't find %d bytes to expand device tree\n\r", size);
22996 +       rc = fdt_open_into(fdt, buf, size);
22997 +       if (rc != 0)
22998 +               fatal("Couldn't expand fdt into new buffer: %s\n\r",
22999 +                     fdt_strerror(rc));
23000 +
23001 +       fdt = buf;
23002 +}
23003 +
23004 +static void *fdt_wrapper_finddevice(const char *path)
23005 +{
23006 +       return offset_devp(fdt_path_offset(fdt, path));
23007 +}
23008 +
23009 +static int fdt_wrapper_getprop(const void *devp, const char *name,
23010 +                              void *buf, const int buflen)
23011 +{
23012 +       const void *p;
23013 +       int len;
23014 +
23015 +       p = fdt_getprop(fdt, devp_offset(devp), name, &len);
23016 +       if (!p)
23017 +               return check_err(len);
23018 +       memcpy(buf, p, min(len, buflen));
23019 +       return len;
23020 +}
23021 +
23022 +static int fdt_wrapper_setprop(const void *devp, const char *name,
23023 +                              const void *buf, const int len)
23024 +{
23025 +       int rc;
23026 +
23027 +       rc = fdt_setprop(fdt, devp_offset(devp), name, buf, len);
23028 +       if (rc == -FDT_ERR_NOSPACE) {
23029 +               expand_buf(len + 16);
23030 +               rc = fdt_setprop(fdt, devp_offset(devp), name, buf, len);
23031 +       }
23032 +
23033 +       return check_err(rc);
23034 +}
23035 +
23036 +static void *fdt_wrapper_get_parent(const void *devp)
23037 +{
23038 +       return offset_devp(fdt_parent_offset(fdt, devp_offset(devp)));
23039 +}
23040 +
23041 +static void *fdt_wrapper_create_node(const void *devp, const char *name)
23042 +{
23043 +       int offset;
23044 +
23045 +       offset = fdt_add_subnode(fdt, devp_offset(devp), name);
23046 +       if (offset == -FDT_ERR_NOSPACE) {
23047 +               expand_buf(strlen(name) + 16);
23048 +               offset = fdt_add_subnode(fdt, devp_offset(devp), name);
23049 +       }
23050 +
23051 +       return offset_devp(offset);
23052 +}
23053 +
23054 +static void *fdt_wrapper_find_node_by_prop_value(const void *prev,
23055 +                                                const char *name,
23056 +                                                const char *val,
23057 +                                                int len)
23058 +{
23059 +       int offset = fdt_node_offset_by_prop_value(fdt, devp_offset_find(prev),
23060 +                                                  name, val, len);
23061 +       return offset_devp(offset);
23062 +}
23063 +
23064 +static char *fdt_wrapper_get_path(const void *devp, char *buf, int len)
23065 +{
23066 +       int rc;
23067 +
23068 +       rc = fdt_get_path(fdt, devp_offset(devp), buf, len);
23069 +       if (check_err(rc))
23070 +               return NULL;
23071 +       return buf;
23072 +}
23073 +
23074 +static unsigned long fdt_wrapper_finalize(void)
23075 +{
23076 +       int rc;
23077 +
23078 +       rc = fdt_pack(fdt);
23079 +       if (rc != 0)
23080 +               fatal("Couldn't pack flat tree: %s\n\r",
23081 +                     fdt_strerror(rc));
23082 +       return (unsigned long)fdt;
23083 +}
23084 +
23085 +void fdt_init(void *blob)
23086 +{
23087 +       int err;
23088 +
23089 +       dt_ops.finddevice = fdt_wrapper_finddevice;
23090 +       dt_ops.getprop = fdt_wrapper_getprop;
23091 +       dt_ops.setprop = fdt_wrapper_setprop;
23092 +       dt_ops.get_parent = fdt_wrapper_get_parent;
23093 +       dt_ops.create_node = fdt_wrapper_create_node;
23094 +       dt_ops.find_node_by_prop_value = fdt_wrapper_find_node_by_prop_value;
23095 +       dt_ops.get_path = fdt_wrapper_get_path;
23096 +       dt_ops.finalize = fdt_wrapper_finalize;
23097 +
23098 +       /* Make sure the dt blob is the right version and so forth */
23099 +       fdt = blob;
23100 +       err = fdt_open_into(fdt, fdt, fdt_totalsize(blob));
23101 +       if (err == -FDT_ERR_NOSPACE) {
23102 +               int bufsize = fdt_totalsize(fdt) + 4;
23103 +               buf = malloc(bufsize);
23104 +               err = fdt_open_into(fdt, buf, bufsize);
23105 +       }
23106 +
23107 +       if (err != 0)
23108 +               fatal("fdt_init(): %s\n\r", fdt_strerror(err));
23109 +
23110 +       if (buf)
23111 +               fdt = buf;
23112 +}
23113 Index: linux-2.6.24.7/arch/powerpc/boot/libfdt_env.h
23114 ===================================================================
23115 --- /dev/null
23116 +++ linux-2.6.24.7/arch/powerpc/boot/libfdt_env.h
23117 @@ -0,0 +1,17 @@
23118 +#ifndef _ARCH_POWERPC_BOOT_LIBFDT_ENV_H
23119 +#define _ARCH_POWERPC_BOOT_LIBFDT_ENV_H
23120 +
23121 +#include <types.h>
23122 +#include <string.h>
23123 +
23124 +typedef u32 uint32_t;
23125 +typedef u64 uint64_t;
23126 +
23127 +#define fdt16_to_cpu(x)                (x)
23128 +#define cpu_to_fdt16(x)                (x)
23129 +#define fdt32_to_cpu(x)                (x)
23130 +#define cpu_to_fdt32(x)                (x)
23131 +#define fdt64_to_cpu(x)                (x)
23132 +#define cpu_to_fdt64(x)                (x)
23133 +
23134 +#endif /* _ARCH_POWERPC_BOOT_LIBFDT_ENV_H */
23135 Index: linux-2.6.24.7/arch/powerpc/boot/main.c
23136 ===================================================================
23137 --- linux-2.6.24.7.orig/arch/powerpc/boot/main.c
23138 +++ linux-2.6.24.7/arch/powerpc/boot/main.c
23139 @@ -16,7 +16,6 @@
23140  #include "stdio.h"
23141  #include "ops.h"
23142  #include "gunzip_util.h"
23143 -#include "flatdevtree.h"
23144  #include "reg.h"
23145  
23146  static struct gunzip_state gzstate;
23147 Index: linux-2.6.24.7/arch/powerpc/boot/ops.h
23148 ===================================================================
23149 --- linux-2.6.24.7.orig/arch/powerpc/boot/ops.h
23150 +++ linux-2.6.24.7/arch/powerpc/boot/ops.h
23151 @@ -79,7 +79,7 @@ struct loader_info {
23152  extern struct loader_info loader_info;
23153  
23154  void start(void);
23155 -int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device);
23156 +void fdt_init(void *blob);
23157  int serial_console_init(void);
23158  int ns16550_console_init(void *devp, struct serial_console_data *scdp);
23159  int mpsc_console_init(void *devp, struct serial_console_data *scdp);
23160 @@ -159,9 +159,23 @@ static inline void *find_node_by_devtype
23161         return find_node_by_prop_value_str(prev, "device_type", type);
23162  }
23163  
23164 +static inline void *find_node_by_alias(const char *alias)
23165 +{
23166 +       void *devp = finddevice("/aliases");
23167 +
23168 +       if (devp) {
23169 +               char path[MAX_PATH_LEN];
23170 +               if (getprop(devp, alias, path, MAX_PATH_LEN) > 0)
23171 +                       return finddevice(path);
23172 +       }
23173 +
23174 +       return NULL;
23175 +}
23176 +
23177  void dt_fixup_memory(u64 start, u64 size);
23178  void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq);
23179  void dt_fixup_clock(const char *path, u32 freq);
23180 +void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr);
23181  void dt_fixup_mac_address(u32 index, const u8 *addr);
23182  void __dt_fixup_mac_addresses(u32 startindex, ...);
23183  #define dt_fixup_mac_addresses(...) \
23184 Index: linux-2.6.24.7/arch/powerpc/boot/prpmc2800.c
23185 ===================================================================
23186 --- linux-2.6.24.7.orig/arch/powerpc/boot/prpmc2800.c
23187 +++ linux-2.6.24.7/arch/powerpc/boot/prpmc2800.c
23188 @@ -547,8 +547,7 @@ void platform_init(unsigned long r3, uns
23189         if (!dtb)
23190                 exit();
23191         memmove(dtb, _dtb_start, dt_size);
23192 -       if (ft_init(dtb, dt_size, 16))
23193 -               exit();
23194 +       fdt_init(dtb);
23195  
23196         bridge_base = mv64x60_get_bridge_base();
23197  
23198 Index: linux-2.6.24.7/arch/powerpc/boot/ps3.c
23199 ===================================================================
23200 --- linux-2.6.24.7.orig/arch/powerpc/boot/ps3.c
23201 +++ linux-2.6.24.7/arch/powerpc/boot/ps3.c
23202 @@ -131,7 +131,7 @@ void platform_init(void)
23203         printf("\n-- PS3 bootwrapper --\n");
23204  
23205         simple_alloc_init(_end, heapsize, 32, 64);
23206 -       ft_init(_dtb_start, 0, 4);
23207 +       fdt_init(_dtb_start);
23208  
23209         chosen = finddevice("/chosen");
23210  
23211 Index: linux-2.6.24.7/arch/powerpc/boot/redboot-8xx.c
23212 ===================================================================
23213 --- /dev/null
23214 +++ linux-2.6.24.7/arch/powerpc/boot/redboot-8xx.c
23215 @@ -0,0 +1,58 @@
23216 +/*
23217 + * RedBoot firmware support
23218 + *
23219 + * Author: Scott Wood <scottwood@freescale.com>
23220 + *
23221 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
23222 + *
23223 + * This program is free software; you can redistribute it and/or modify it
23224 + * under the terms of the GNU General Public License version 2 as published
23225 + * by the Free Software Foundation.
23226 + */
23227 +
23228 +#include "ops.h"
23229 +#include "stdio.h"
23230 +#include "redboot.h"
23231 +#include "fsl-soc.h"
23232 +#include "io.h"
23233 +
23234 +static bd_t bd;
23235 +BSS_STACK(4096);
23236 +
23237 +#define MHZ(x) ((x + 500000) / 1000000)
23238 +
23239 +static void platform_fixups(void)
23240 +{
23241 +       void *node;
23242 +
23243 +       dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
23244 +       dt_fixup_mac_addresses(bd.bi_enetaddr);
23245 +       dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq);
23246 +
23247 +       node = finddevice("/soc/cpm/brg");
23248 +       if (node) {
23249 +               printf("BRG clock-frequency <- 0x%x (%dMHz)\r\n",
23250 +                      bd.bi_busfreq, MHZ(bd.bi_busfreq));
23251 +               setprop(node, "clock-frequency",  &bd.bi_busfreq, 4);
23252 +       }
23253 +}
23254 +
23255 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
23256 +                   unsigned long r6, unsigned long r7)
23257 +{
23258 +       memcpy(&bd, (char *)r3, sizeof(bd));
23259 +
23260 +       if (bd.bi_tag != 0x42444944)
23261 +               return;
23262 +
23263 +       simple_alloc_init(_end,
23264 +                         bd.bi_memstart + bd.bi_memsize - (unsigned long)_end,
23265 +                         32, 64);
23266 +
23267 +       fdt_init(_dtb_start);
23268 +       serial_console_init();
23269 +       platform_ops.fixups = platform_fixups;
23270 +
23271 +       loader_info.cmdline = (char *)bd.bi_cmdline;
23272 +       loader_info.cmdline_len = strlen((char *)bd.bi_cmdline);
23273 +}
23274 Index: linux-2.6.24.7/arch/powerpc/boot/redboot.h
23275 ===================================================================
23276 --- /dev/null
23277 +++ linux-2.6.24.7/arch/powerpc/boot/redboot.h
23278 @@ -0,0 +1,56 @@
23279 +#ifndef _PPC_REDBOOT_H
23280 +#define _PPC_REDBOOT_H
23281 +
23282 +//=========================================================================
23283 +// include/asm-ppc/redboot.h
23284 +//   Copyright (c) 2002, 2003 Gary Thomas (<gary@mlbassoc.com>
23285 +//   Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
23286 +
23287 +//
23288 +// Board specific details, as provided by RedBoot
23289 +//
23290 +
23291 +/* A Board Information structure that is given to a program when
23292 + * RedBoot starts it up.  Note: not all fields make sense for all
23293 + * architectures and it's up to the platform specific code to fill
23294 + * in the details.
23295 + */
23296 +typedef struct bd_info {
23297 +    unsigned int   bi_tag;        /* Should be 0x42444944 "BDID" */
23298 +    unsigned int   bi_size;       /* Size of this structure */
23299 +    unsigned int   bi_revision;   /* revision of this structure */
23300 +    unsigned int   bi_bdate;      /* bootstrap date, i.e. 0x19971106 */
23301 +    unsigned int   bi_memstart;   /* Memory start address */
23302 +    unsigned int   bi_memsize;    /* Memory (end) size in bytes */
23303 +    unsigned int   bi_intfreq;    /* Internal Freq, in Hz */
23304 +    unsigned int   bi_busfreq;    /* Bus Freq, in Hz */
23305 +    unsigned int   bi_cpmfreq;    /* CPM Freq, in Hz */
23306 +    unsigned int   bi_brgfreq;    /* BRG Freq, in Hz */
23307 +    unsigned int   bi_vco;        /* VCO Out from PLL */
23308 +    unsigned int   bi_pci_freq;   /* PCI Freq, in Hz */
23309 +    unsigned int   bi_baudrate;   /* Default console baud rate */
23310 +    unsigned int   bi_immr;       /* IMMR when called from boot rom */
23311 +    unsigned char  bi_enetaddr[6];
23312 +    unsigned int   bi_flashbase;  /* Physical address of FLASH memory */
23313 +    unsigned int   bi_flashsize;  /* Length of FLASH memory */
23314 +    int            bi_flashwidth; /* Width (8,16,32,64) */
23315 +    unsigned char *bi_cmdline;    /* Pointer to command line */
23316 +    unsigned char  bi_esa[3][6];  /* Ethernet station addresses */
23317 +    unsigned int   bi_ramdisk_begin, bi_ramdisk_end;
23318 +    struct {                      /* Information about [main] video screen */
23319 +        short x_res;              /*   Horizontal resolution in pixels */
23320 +        short y_res;              /*   Vertical resolution in pixels */
23321 +        short bpp;                /*   Bits/pixel */
23322 +        short mode;               /*   Type of pixels (packed, indexed) */
23323 +        unsigned long fb;         /*   Pointer to frame buffer (pixel) memory */
23324 +    } bi_video;
23325 +    void         (*bi_cputc)(char);   /* Write a character to the RedBoot console */
23326 +    char         (*bi_cgetc)(void);   /* Read a character from the RedBoot console */
23327 +    int          (*bi_ctstc)(void);   /* Test for input on the RedBoot console */
23328 +} bd_t;
23329 +
23330 +#define BI_REV 0x0102    /* Version 1.02 */
23331 +
23332 +#define bi_pci_busfreq bi_pci_freq
23333 +#define bi_immr_base   bi_immr
23334 +#endif
23335 Index: linux-2.6.24.7/arch/powerpc/boot/reg.h
23336 ===================================================================
23337 --- linux-2.6.24.7.orig/arch/powerpc/boot/reg.h
23338 +++ linux-2.6.24.7/arch/powerpc/boot/reg.h
23339 @@ -16,6 +16,14 @@ static inline u32 mfpvr(void)
23340         return pvr;
23341  }
23342  
23343 +#define __stringify_1(x)       #x
23344 +#define __stringify(x)         __stringify_1(x)
23345 +
23346 +#define mfspr(rn)      ({unsigned long rval; \
23347 +                       asm volatile("mfspr %0," __stringify(rn) \
23348 +                               : "=r" (rval)); rval; })
23349 +#define mtspr(rn, v)   asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
23350 +
23351  register void *__stack_pointer asm("r1");
23352  #define get_sp()       (__stack_pointer)
23353  
23354 Index: linux-2.6.24.7/arch/powerpc/boot/serial.c
23355 ===================================================================
23356 --- linux-2.6.24.7.orig/arch/powerpc/boot/serial.c
23357 +++ linux-2.6.24.7/arch/powerpc/boot/serial.c
23358 @@ -128,7 +128,8 @@ int serial_console_init(void)
23359                 rc = cpm_console_init(devp, &serial_cd);
23360         else if (dt_is_compatible(devp, "mpc5200-psc-uart"))
23361                 rc = mpc5200_psc_console_init(devp, &serial_cd);
23362 -       else if (dt_is_compatible(devp, "xilinx,uartlite"))
23363 +       else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
23364 +                dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
23365                 rc = uartlite_console_init(devp, &serial_cd);
23366  
23367         /* Add other serial console driver calls here */
23368 Index: linux-2.6.24.7/arch/powerpc/boot/treeboot-walnut.c
23369 ===================================================================
23370 --- linux-2.6.24.7.orig/arch/powerpc/boot/treeboot-walnut.c
23371 +++ linux-2.6.24.7/arch/powerpc/boot/treeboot-walnut.c
23372 @@ -20,55 +20,6 @@
23373  
23374  BSS_STACK(4096);
23375  
23376 -void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
23377 -{
23378 -       u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
23379 -       u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
23380 -       u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
23381 -       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
23382 -       u32 fwdv, fbdv, cbdv, opdv, epdv, udiv;
23383 -
23384 -       fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
23385 -       fbdv = (pllmr & 0x1e000000) >> 25;
23386 -       cbdv = ((pllmr & 0x00060000) >> 17) + 1;
23387 -       opdv = ((pllmr & 0x00018000) >> 15) + 1;
23388 -       epdv = ((pllmr & 0x00001800) >> 13) + 2;
23389 -       udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
23390 -
23391 -       m = fwdv * fbdv * cbdv;
23392 -
23393 -       cpu = sysclk * m / fwdv;
23394 -       plb = cpu / cbdv;
23395 -       opb = plb / opdv;
23396 -       ebc = plb / epdv;
23397 -
23398 -       if (cpc0_cr0 & 0x80) {
23399 -               /* uart0 uses the external clock */
23400 -               uart0 = ser_clk;
23401 -       } else {
23402 -               uart0 = cpu / udiv;
23403 -       }
23404 -
23405 -       if (cpc0_cr0 & 0x40) {
23406 -               /* uart1 uses the external clock */
23407 -               uart1 = ser_clk;
23408 -       } else {
23409 -               uart1 = cpu / udiv;
23410 -       }
23411 -
23412 -       /* setup the timebase clock to tick at the cpu frequency */
23413 -       cpc0_cr1 = cpc0_cr1 & ~0x00800000;
23414 -       mtdcr(DCRN_405_CPC0_CR1, cpc0_cr1);
23415 -       tb = cpu;
23416 -
23417 -       dt_fixup_cpu_clocks(cpu, tb, 0);
23418 -       dt_fixup_clock("/plb", plb);
23419 -       dt_fixup_clock("/plb/opb", opb);
23420 -       dt_fixup_clock("/plb/ebc", ebc);
23421 -       dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
23422 -       dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
23423 -}
23424 -
23425  static void walnut_flashsel_fixup(void)
23426  {
23427         void *devp, *sram;
23428 @@ -112,7 +63,7 @@ static void walnut_flashsel_fixup(void)
23429  #define WALNUT_OPENBIOS_MAC_OFF 0xfffffe0b
23430  static void walnut_fixups(void)
23431  {
23432 -       ibm4xx_fixup_memsize();
23433 +       ibm4xx_sdram_fixup_memsize();
23434         ibm405gp_fixup_clocks(33330000, 0xa8c000);
23435         ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
23436         ibm4xx_fixup_ebc_ranges("/plb/ebc");
23437 @@ -128,6 +79,6 @@ void platform_init(void)
23438         simple_alloc_init(_end, avail_ram, 32, 32);
23439         platform_ops.fixups = walnut_fixups;
23440         platform_ops.exit = ibm40x_dbcr_reset;
23441 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
23442 +       fdt_init(_dtb_start);
23443         serial_console_init();
23444  }
23445 Index: linux-2.6.24.7/arch/powerpc/boot/wrapper
23446 ===================================================================
23447 --- linux-2.6.24.7.orig/arch/powerpc/boot/wrapper
23448 +++ linux-2.6.24.7/arch/powerpc/boot/wrapper
23449 @@ -45,6 +45,7 @@ CROSS=
23450  
23451  # directory for object and other files used by this script
23452  object=arch/powerpc/boot
23453 +objbin=$object
23454  
23455  # directory for working files
23456  tmpdir=.
23457 @@ -95,6 +96,7 @@ while [ "$#" -gt 0 ]; do
23458         shift
23459         [ "$#" -gt 0 ] || usage
23460         object="$1"
23461 +       objbin="$1"
23462         ;;
23463      -W)
23464         shift
23465 @@ -116,10 +118,13 @@ while [ "$#" -gt 0 ]; do
23466  done
23467  
23468  if [ -n "$dts" ]; then
23469 +    if [ ! -r "$dts" -a -r "$object/dts/$dts" ]; then
23470 +       dts="$object/dts/$dts"
23471 +    fi
23472      if [ -z "$dtb" ]; then
23473         dtb="$platform.dtb"
23474      fi
23475 -    dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
23476 +    $object/dtc -O dtb -o "$dtb" -b 0 "$dts"
23477  fi
23478  
23479  if [ -z "$kernel" ]; then
23480 @@ -163,7 +168,7 @@ ps3)
23481      ksection=.kernel:vmlinux.bin
23482      isection=.kernel:initrd
23483      ;;
23484 -ep88xc)
23485 +ep88xc|ep405|redboot*|ep8248e)
23486      platformo="$object/fixed-head.o $object/$platform.o"
23487      binary=y
23488      ;;
23489 @@ -246,11 +251,11 @@ fi
23490  # post-processing needed for some platforms
23491  case "$platform" in
23492  pseries|chrp)
23493 -    $object/addnote "$ofile"
23494 +    $objbin/addnote "$ofile"
23495      ;;
23496  coff)
23497      ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"
23498 -    $object/hack-coff "$ofile"
23499 +    $objbin/hack-coff "$ofile"
23500      ;;
23501  cuboot*)
23502      gzip -f -9 "$ofile"
23503 @@ -259,7 +264,7 @@ cuboot*)
23504      ;;
23505  treeboot*)
23506      mv "$ofile" "$ofile.elf"
23507 -    $object/mktree "$ofile.elf" "$ofile" "$base" "$entry"
23508 +    $objbin/mktree "$ofile.elf" "$ofile" "$base" "$entry"
23509      if [ -z "$cacheit" ]; then
23510         rm -f "$ofile.elf"
23511      fi
23512 @@ -287,8 +292,6 @@ ps3)
23513      overlay_dest="256"
23514      overlay_size="256"
23515  
23516 -    rm -f "$object/otheros.bld"
23517 -
23518      ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
23519  
23520      dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
23521 @@ -299,6 +302,8 @@ ps3)
23522          skip=$system_reset_overlay seek=$overlay_dest \
23523          count=$overlay_size bs=1
23524  
23525 -    gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
23526 +    odir="$(dirname "$ofile.bin")"
23527 +    rm -f "$odir/otheros.bld"
23528 +    gzip --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
23529      ;;
23530  esac
23531 Index: linux-2.6.24.7/arch/powerpc/configs/adder875-redboot_defconfig
23532 ===================================================================
23533 --- /dev/null
23534 +++ linux-2.6.24.7/arch/powerpc/configs/adder875-redboot_defconfig
23535 @@ -0,0 +1,798 @@
23536 +#
23537 +# Automatically generated make config: don't edit
23538 +# Linux kernel version: 2.6.24-rc6
23539 +# Thu Jan 17 16:17:38 2008
23540 +#
23541 +# CONFIG_PPC64 is not set
23542 +
23543 +#
23544 +# Processor support
23545 +#
23546 +# CONFIG_6xx is not set
23547 +# CONFIG_PPC_85xx is not set
23548 +CONFIG_PPC_8xx=y
23549 +# CONFIG_40x is not set
23550 +# CONFIG_44x is not set
23551 +# CONFIG_E200 is not set
23552 +CONFIG_8xx=y
23553 +# CONFIG_PPC_MM_SLICES is not set
23554 +CONFIG_NOT_COHERENT_CACHE=y
23555 +CONFIG_PPC32=y
23556 +CONFIG_WORD_SIZE=32
23557 +CONFIG_PPC_MERGE=y
23558 +CONFIG_MMU=y
23559 +CONFIG_GENERIC_CMOS_UPDATE=y
23560 +CONFIG_GENERIC_TIME=y
23561 +CONFIG_GENERIC_TIME_VSYSCALL=y
23562 +CONFIG_GENERIC_CLOCKEVENTS=y
23563 +CONFIG_GENERIC_HARDIRQS=y
23564 +CONFIG_IRQ_PER_CPU=y
23565 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
23566 +CONFIG_ARCH_HAS_ILOG2_U32=y
23567 +CONFIG_GENERIC_HWEIGHT=y
23568 +CONFIG_GENERIC_CALIBRATE_DELAY=y
23569 +CONFIG_GENERIC_FIND_NEXT_BIT=y
23570 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
23571 +CONFIG_PPC=y
23572 +CONFIG_EARLY_PRINTK=y
23573 +CONFIG_GENERIC_NVRAM=y
23574 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
23575 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
23576 +CONFIG_PPC_OF=y
23577 +CONFIG_OF=y
23578 +# CONFIG_PPC_UDBG_16550 is not set
23579 +# CONFIG_GENERIC_TBSYNC is not set
23580 +CONFIG_AUDIT_ARCH=y
23581 +CONFIG_GENERIC_BUG=y
23582 +# CONFIG_DEFAULT_UIMAGE is not set
23583 +CONFIG_REDBOOT=y
23584 +# CONFIG_PPC_DCR_NATIVE is not set
23585 +# CONFIG_PPC_DCR_MMIO is not set
23586 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23587 +
23588 +#
23589 +# General setup
23590 +#
23591 +CONFIG_EXPERIMENTAL=y
23592 +CONFIG_BROKEN_ON_SMP=y
23593 +CONFIG_INIT_ENV_ARG_LIMIT=32
23594 +CONFIG_LOCALVERSION=""
23595 +CONFIG_LOCALVERSION_AUTO=y
23596 +# CONFIG_SWAP is not set
23597 +CONFIG_SYSVIPC=y
23598 +CONFIG_SYSVIPC_SYSCTL=y
23599 +# CONFIG_POSIX_MQUEUE is not set
23600 +# CONFIG_BSD_PROCESS_ACCT is not set
23601 +# CONFIG_TASKSTATS is not set
23602 +# CONFIG_USER_NS is not set
23603 +# CONFIG_PID_NS is not set
23604 +# CONFIG_AUDIT is not set
23605 +# CONFIG_IKCONFIG is not set
23606 +CONFIG_LOG_BUF_SHIFT=14
23607 +# CONFIG_CGROUPS is not set
23608 +CONFIG_FAIR_GROUP_SCHED=y
23609 +CONFIG_FAIR_USER_SCHED=y
23610 +# CONFIG_FAIR_CGROUP_SCHED is not set
23611 +CONFIG_SYSFS_DEPRECATED=y
23612 +# CONFIG_RELAY is not set
23613 +# CONFIG_BLK_DEV_INITRD is not set
23614 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
23615 +CONFIG_SYSCTL=y
23616 +CONFIG_EMBEDDED=y
23617 +# CONFIG_SYSCTL_SYSCALL is not set
23618 +CONFIG_KALLSYMS=y
23619 +# CONFIG_KALLSYMS_ALL is not set
23620 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
23621 +CONFIG_HOTPLUG=y
23622 +CONFIG_PRINTK=y
23623 +CONFIG_BUG=y
23624 +# CONFIG_ELF_CORE is not set
23625 +# CONFIG_BASE_FULL is not set
23626 +# CONFIG_FUTEX is not set
23627 +CONFIG_ANON_INODES=y
23628 +CONFIG_EPOLL=y
23629 +CONFIG_SIGNALFD=y
23630 +CONFIG_EVENTFD=y
23631 +CONFIG_SHMEM=y
23632 +# CONFIG_VM_EVENT_COUNTERS is not set
23633 +CONFIG_SLUB_DEBUG=y
23634 +# CONFIG_SLAB is not set
23635 +CONFIG_SLUB=y
23636 +# CONFIG_SLOB is not set
23637 +# CONFIG_TINY_SHMEM is not set
23638 +CONFIG_BASE_SMALL=1
23639 +# CONFIG_MODULES is not set
23640 +CONFIG_BLOCK=y
23641 +# CONFIG_LBD is not set
23642 +# CONFIG_BLK_DEV_IO_TRACE is not set
23643 +# CONFIG_LSF is not set
23644 +# CONFIG_BLK_DEV_BSG is not set
23645 +
23646 +#
23647 +# IO Schedulers
23648 +#
23649 +CONFIG_IOSCHED_NOOP=y
23650 +# CONFIG_IOSCHED_AS is not set
23651 +CONFIG_IOSCHED_DEADLINE=y
23652 +# CONFIG_IOSCHED_CFQ is not set
23653 +# CONFIG_DEFAULT_AS is not set
23654 +CONFIG_DEFAULT_DEADLINE=y
23655 +# CONFIG_DEFAULT_CFQ is not set
23656 +# CONFIG_DEFAULT_NOOP is not set
23657 +CONFIG_DEFAULT_IOSCHED="deadline"
23658 +
23659 +#
23660 +# Platform support
23661 +#
23662 +# CONFIG_PPC_MPC52xx is not set
23663 +# CONFIG_PPC_MPC5200 is not set
23664 +# CONFIG_PPC_CELL is not set
23665 +# CONFIG_PPC_CELL_NATIVE is not set
23666 +CONFIG_CPM1=y
23667 +# CONFIG_MPC8XXFADS is not set
23668 +# CONFIG_MPC86XADS is not set
23669 +# CONFIG_MPC885ADS is not set
23670 +# CONFIG_PPC_EP88XC is not set
23671 +CONFIG_PPC_ADDER875=y
23672 +
23673 +#
23674 +# MPC8xx CPM Options
23675 +#
23676 +
23677 +#
23678 +# Generic MPC8xx Options
23679 +#
23680 +CONFIG_8xx_COPYBACK=y
23681 +# CONFIG_8xx_CPU6 is not set
23682 +CONFIG_8xx_CPU15=y
23683 +CONFIG_NO_UCODE_PATCH=y
23684 +# CONFIG_USB_SOF_UCODE_PATCH is not set
23685 +# CONFIG_I2C_SPI_UCODE_PATCH is not set
23686 +# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
23687 +# CONFIG_PQ2ADS is not set
23688 +# CONFIG_MPIC is not set
23689 +# CONFIG_MPIC_WEIRD is not set
23690 +# CONFIG_PPC_I8259 is not set
23691 +# CONFIG_PPC_RTAS is not set
23692 +# CONFIG_MMIO_NVRAM is not set
23693 +# CONFIG_PPC_MPC106 is not set
23694 +# CONFIG_PPC_970_NAP is not set
23695 +# CONFIG_PPC_INDIRECT_IO is not set
23696 +# CONFIG_GENERIC_IOMAP is not set
23697 +# CONFIG_CPU_FREQ is not set
23698 +# CONFIG_CPM2 is not set
23699 +CONFIG_PPC_CPM_NEW_BINDING=y
23700 +# CONFIG_FSL_ULI1575 is not set
23701 +CONFIG_CPM=y
23702 +
23703 +#
23704 +# Kernel options
23705 +#
23706 +# CONFIG_HIGHMEM is not set
23707 +# CONFIG_TICK_ONESHOT is not set
23708 +# CONFIG_NO_HZ is not set
23709 +# CONFIG_HIGH_RES_TIMERS is not set
23710 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
23711 +# CONFIG_HZ_100 is not set
23712 +# CONFIG_HZ_250 is not set
23713 +# CONFIG_HZ_300 is not set
23714 +CONFIG_HZ_1000=y
23715 +CONFIG_HZ=1000
23716 +CONFIG_PREEMPT_NONE=y
23717 +# CONFIG_PREEMPT_VOLUNTARY is not set
23718 +# CONFIG_PREEMPT is not set
23719 +CONFIG_BINFMT_ELF=y
23720 +# CONFIG_BINFMT_MISC is not set
23721 +# CONFIG_MATH_EMULATION is not set
23722 +# CONFIG_8XX_MINIMAL_FPEMU is not set
23723 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
23724 +CONFIG_ARCH_FLATMEM_ENABLE=y
23725 +CONFIG_ARCH_POPULATES_NODE_MAP=y
23726 +CONFIG_SELECT_MEMORY_MODEL=y
23727 +CONFIG_FLATMEM_MANUAL=y
23728 +# CONFIG_DISCONTIGMEM_MANUAL is not set
23729 +# CONFIG_SPARSEMEM_MANUAL is not set
23730 +CONFIG_FLATMEM=y
23731 +CONFIG_FLAT_NODE_MEM_MAP=y
23732 +# CONFIG_SPARSEMEM_STATIC is not set
23733 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
23734 +CONFIG_SPLIT_PTLOCK_CPUS=4
23735 +# CONFIG_RESOURCES_64BIT is not set
23736 +CONFIG_ZONE_DMA_FLAG=1
23737 +CONFIG_BOUNCE=y
23738 +CONFIG_VIRT_TO_BUS=y
23739 +# CONFIG_PROC_DEVICETREE is not set
23740 +# CONFIG_CMDLINE_BOOL is not set
23741 +# CONFIG_PM is not set
23742 +CONFIG_SUSPEND_UP_POSSIBLE=y
23743 +CONFIG_HIBERNATION_UP_POSSIBLE=y
23744 +# CONFIG_SECCOMP is not set
23745 +CONFIG_WANT_DEVICE_TREE=y
23746 +CONFIG_DEVICE_TREE="adder875-redboot.dts"
23747 +CONFIG_ISA_DMA_API=y
23748 +
23749 +#
23750 +# Bus options
23751 +#
23752 +CONFIG_ZONE_DMA=y
23753 +CONFIG_FSL_SOC=y
23754 +# CONFIG_PCI is not set
23755 +# CONFIG_PCI_DOMAINS is not set
23756 +# CONFIG_PCI_SYSCALL is not set
23757 +# CONFIG_PCI_QSPAN is not set
23758 +# CONFIG_ARCH_SUPPORTS_MSI is not set
23759 +# CONFIG_PCCARD is not set
23760 +
23761 +#
23762 +# Advanced setup
23763 +#
23764 +# CONFIG_ADVANCED_OPTIONS is not set
23765 +
23766 +#
23767 +# Default settings for advanced configuration options are used
23768 +#
23769 +CONFIG_HIGHMEM_START=0xfe000000
23770 +CONFIG_LOWMEM_SIZE=0x30000000
23771 +CONFIG_KERNEL_START=0xc0000000
23772 +CONFIG_TASK_SIZE=0x80000000
23773 +CONFIG_CONSISTENT_START=0xfd000000
23774 +CONFIG_CONSISTENT_SIZE=0x00200000
23775 +CONFIG_BOOT_LOAD=0x00400000
23776 +
23777 +#
23778 +# Networking
23779 +#
23780 +CONFIG_NET=y
23781 +
23782 +#
23783 +# Networking options
23784 +#
23785 +CONFIG_PACKET=y
23786 +# CONFIG_PACKET_MMAP is not set
23787 +CONFIG_UNIX=y
23788 +# CONFIG_NET_KEY is not set
23789 +CONFIG_INET=y
23790 +CONFIG_IP_MULTICAST=y
23791 +# CONFIG_IP_ADVANCED_ROUTER is not set
23792 +CONFIG_IP_FIB_HASH=y
23793 +CONFIG_IP_PNP=y
23794 +# CONFIG_IP_PNP_DHCP is not set
23795 +# CONFIG_IP_PNP_BOOTP is not set
23796 +# CONFIG_IP_PNP_RARP is not set
23797 +# CONFIG_NET_IPIP is not set
23798 +# CONFIG_NET_IPGRE is not set
23799 +# CONFIG_IP_MROUTE is not set
23800 +# CONFIG_ARPD is not set
23801 +CONFIG_SYN_COOKIES=y
23802 +# CONFIG_INET_AH is not set
23803 +# CONFIG_INET_ESP is not set
23804 +# CONFIG_INET_IPCOMP is not set
23805 +# CONFIG_INET_XFRM_TUNNEL is not set
23806 +# CONFIG_INET_TUNNEL is not set
23807 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
23808 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
23809 +# CONFIG_INET_XFRM_MODE_BEET is not set
23810 +# CONFIG_INET_LRO is not set
23811 +CONFIG_INET_DIAG=y
23812 +CONFIG_INET_TCP_DIAG=y
23813 +# CONFIG_TCP_CONG_ADVANCED is not set
23814 +CONFIG_TCP_CONG_CUBIC=y
23815 +CONFIG_DEFAULT_TCP_CONG="cubic"
23816 +# CONFIG_TCP_MD5SIG is not set
23817 +# CONFIG_IPV6 is not set
23818 +# CONFIG_INET6_XFRM_TUNNEL is not set
23819 +# CONFIG_INET6_TUNNEL is not set
23820 +# CONFIG_NETWORK_SECMARK is not set
23821 +# CONFIG_NETFILTER is not set
23822 +# CONFIG_IP_DCCP is not set
23823 +# CONFIG_IP_SCTP is not set
23824 +# CONFIG_TIPC is not set
23825 +# CONFIG_ATM is not set
23826 +# CONFIG_BRIDGE is not set
23827 +# CONFIG_VLAN_8021Q is not set
23828 +# CONFIG_DECNET is not set
23829 +# CONFIG_LLC2 is not set
23830 +# CONFIG_IPX is not set
23831 +# CONFIG_ATALK is not set
23832 +# CONFIG_X25 is not set
23833 +# CONFIG_LAPB is not set
23834 +# CONFIG_ECONET is not set
23835 +# CONFIG_WAN_ROUTER is not set
23836 +# CONFIG_NET_SCHED is not set
23837 +
23838 +#
23839 +# Network testing
23840 +#
23841 +# CONFIG_NET_PKTGEN is not set
23842 +# CONFIG_HAMRADIO is not set
23843 +# CONFIG_IRDA is not set
23844 +# CONFIG_BT is not set
23845 +# CONFIG_AF_RXRPC is not set
23846 +
23847 +#
23848 +# Wireless
23849 +#
23850 +# CONFIG_CFG80211 is not set
23851 +# CONFIG_WIRELESS_EXT is not set
23852 +# CONFIG_MAC80211 is not set
23853 +# CONFIG_IEEE80211 is not set
23854 +# CONFIG_RFKILL is not set
23855 +# CONFIG_NET_9P is not set
23856 +
23857 +#
23858 +# Device Drivers
23859 +#
23860 +
23861 +#
23862 +# Generic Driver Options
23863 +#
23864 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
23865 +CONFIG_STANDALONE=y
23866 +CONFIG_PREVENT_FIRMWARE_BUILD=y
23867 +# CONFIG_FW_LOADER is not set
23868 +# CONFIG_DEBUG_DRIVER is not set
23869 +# CONFIG_DEBUG_DEVRES is not set
23870 +# CONFIG_SYS_HYPERVISOR is not set
23871 +# CONFIG_CONNECTOR is not set
23872 +CONFIG_MTD=y
23873 +# CONFIG_MTD_DEBUG is not set
23874 +# CONFIG_MTD_CONCAT is not set
23875 +# CONFIG_MTD_PARTITIONS is not set
23876 +
23877 +#
23878 +# User Modules And Translation Layers
23879 +#
23880 +CONFIG_MTD_CHAR=y
23881 +CONFIG_MTD_BLKDEVS=y
23882 +CONFIG_MTD_BLOCK=y
23883 +# CONFIG_FTL is not set
23884 +# CONFIG_NFTL is not set
23885 +# CONFIG_INFTL is not set
23886 +# CONFIG_RFD_FTL is not set
23887 +# CONFIG_SSFDC is not set
23888 +# CONFIG_MTD_OOPS is not set
23889 +
23890 +#
23891 +# RAM/ROM/Flash chip drivers
23892 +#
23893 +CONFIG_MTD_CFI=y
23894 +# CONFIG_MTD_JEDECPROBE is not set
23895 +CONFIG_MTD_GEN_PROBE=y
23896 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
23897 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
23898 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
23899 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
23900 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
23901 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
23902 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
23903 +CONFIG_MTD_CFI_I1=y
23904 +CONFIG_MTD_CFI_I2=y
23905 +# CONFIG_MTD_CFI_I4 is not set
23906 +# CONFIG_MTD_CFI_I8 is not set
23907 +# CONFIG_MTD_CFI_INTELEXT is not set
23908 +CONFIG_MTD_CFI_AMDSTD=y
23909 +# CONFIG_MTD_CFI_STAA is not set
23910 +CONFIG_MTD_CFI_UTIL=y
23911 +# CONFIG_MTD_RAM is not set
23912 +# CONFIG_MTD_ROM is not set
23913 +# CONFIG_MTD_ABSENT is not set
23914 +
23915 +#
23916 +# Mapping drivers for chip access
23917 +#
23918 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
23919 +# CONFIG_MTD_PHYSMAP is not set
23920 +CONFIG_MTD_PHYSMAP_OF=y
23921 +# CONFIG_MTD_CFI_FLAGADM is not set
23922 +# CONFIG_MTD_PLATRAM is not set
23923 +
23924 +#
23925 +# Self-contained MTD device drivers
23926 +#
23927 +# CONFIG_MTD_SLRAM is not set
23928 +# CONFIG_MTD_PHRAM is not set
23929 +# CONFIG_MTD_MTDRAM is not set
23930 +# CONFIG_MTD_BLOCK2MTD is not set
23931 +
23932 +#
23933 +# Disk-On-Chip Device Drivers
23934 +#
23935 +# CONFIG_MTD_DOC2000 is not set
23936 +# CONFIG_MTD_DOC2001 is not set
23937 +# CONFIG_MTD_DOC2001PLUS is not set
23938 +# CONFIG_MTD_NAND is not set
23939 +# CONFIG_MTD_ONENAND is not set
23940 +
23941 +#
23942 +# UBI - Unsorted block images
23943 +#
23944 +# CONFIG_MTD_UBI is not set
23945 +CONFIG_OF_DEVICE=y
23946 +# CONFIG_PARPORT is not set
23947 +# CONFIG_BLK_DEV is not set
23948 +# CONFIG_MISC_DEVICES is not set
23949 +# CONFIG_IDE is not set
23950 +
23951 +#
23952 +# SCSI device support
23953 +#
23954 +# CONFIG_RAID_ATTRS is not set
23955 +# CONFIG_SCSI is not set
23956 +# CONFIG_SCSI_DMA is not set
23957 +# CONFIG_SCSI_NETLINK is not set
23958 +# CONFIG_ATA is not set
23959 +# CONFIG_MD is not set
23960 +# CONFIG_MACINTOSH_DRIVERS is not set
23961 +CONFIG_NETDEVICES=y
23962 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
23963 +# CONFIG_DUMMY is not set
23964 +# CONFIG_BONDING is not set
23965 +# CONFIG_MACVLAN is not set
23966 +# CONFIG_EQUALIZER is not set
23967 +# CONFIG_TUN is not set
23968 +# CONFIG_VETH is not set
23969 +CONFIG_PHYLIB=y
23970 +
23971 +#
23972 +# MII PHY device drivers
23973 +#
23974 +# CONFIG_MARVELL_PHY is not set
23975 +CONFIG_DAVICOM_PHY=y
23976 +# CONFIG_QSEMI_PHY is not set
23977 +# CONFIG_LXT_PHY is not set
23978 +# CONFIG_CICADA_PHY is not set
23979 +# CONFIG_VITESSE_PHY is not set
23980 +# CONFIG_SMSC_PHY is not set
23981 +# CONFIG_BROADCOM_PHY is not set
23982 +# CONFIG_ICPLUS_PHY is not set
23983 +# CONFIG_FIXED_PHY is not set
23984 +# CONFIG_MDIO_BITBANG is not set
23985 +CONFIG_NET_ETHERNET=y
23986 +CONFIG_MII=y
23987 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
23988 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
23989 +# CONFIG_IBM_NEW_EMAC_TAH is not set
23990 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
23991 +# CONFIG_B44 is not set
23992 +CONFIG_FS_ENET=y
23993 +# CONFIG_FS_ENET_HAS_SCC is not set
23994 +CONFIG_FS_ENET_HAS_FEC=y
23995 +CONFIG_FS_ENET_MDIO_FEC=y
23996 +# CONFIG_NETDEV_1000 is not set
23997 +# CONFIG_NETDEV_10000 is not set
23998 +
23999 +#
24000 +# Wireless LAN
24001 +#
24002 +# CONFIG_WLAN_PRE80211 is not set
24003 +# CONFIG_WLAN_80211 is not set
24004 +# CONFIG_WAN is not set
24005 +# CONFIG_PPP is not set
24006 +# CONFIG_SLIP is not set
24007 +# CONFIG_SHAPER is not set
24008 +# CONFIG_NETCONSOLE is not set
24009 +# CONFIG_NETPOLL is not set
24010 +# CONFIG_NET_POLL_CONTROLLER is not set
24011 +# CONFIG_ISDN is not set
24012 +# CONFIG_PHONE is not set
24013 +
24014 +#
24015 +# Input device support
24016 +#
24017 +CONFIG_INPUT=y
24018 +# CONFIG_INPUT_FF_MEMLESS is not set
24019 +# CONFIG_INPUT_POLLDEV is not set
24020 +
24021 +#
24022 +# Userland interfaces
24023 +#
24024 +CONFIG_INPUT_MOUSEDEV=y
24025 +CONFIG_INPUT_MOUSEDEV_PSAUX=y
24026 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
24027 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
24028 +# CONFIG_INPUT_JOYDEV is not set
24029 +# CONFIG_INPUT_EVDEV is not set
24030 +# CONFIG_INPUT_EVBUG is not set
24031 +
24032 +#
24033 +# Input Device Drivers
24034 +#
24035 +CONFIG_INPUT_KEYBOARD=y
24036 +CONFIG_KEYBOARD_ATKBD=y
24037 +# CONFIG_KEYBOARD_SUNKBD is not set
24038 +# CONFIG_KEYBOARD_LKKBD is not set
24039 +# CONFIG_KEYBOARD_XTKBD is not set
24040 +# CONFIG_KEYBOARD_NEWTON is not set
24041 +# CONFIG_KEYBOARD_STOWAWAY is not set
24042 +CONFIG_INPUT_MOUSE=y
24043 +CONFIG_MOUSE_PS2=y
24044 +CONFIG_MOUSE_PS2_ALPS=y
24045 +CONFIG_MOUSE_PS2_LOGIPS2PP=y
24046 +CONFIG_MOUSE_PS2_SYNAPTICS=y
24047 +CONFIG_MOUSE_PS2_LIFEBOOK=y
24048 +CONFIG_MOUSE_PS2_TRACKPOINT=y
24049 +# CONFIG_MOUSE_PS2_TOUCHKIT is not set
24050 +# CONFIG_MOUSE_SERIAL is not set
24051 +# CONFIG_MOUSE_VSXXXAA is not set
24052 +# CONFIG_INPUT_JOYSTICK is not set
24053 +# CONFIG_INPUT_TABLET is not set
24054 +# CONFIG_INPUT_TOUCHSCREEN is not set
24055 +# CONFIG_INPUT_MISC is not set
24056 +
24057 +#
24058 +# Hardware I/O ports
24059 +#
24060 +CONFIG_SERIO=y
24061 +CONFIG_SERIO_I8042=y
24062 +CONFIG_SERIO_SERPORT=y
24063 +CONFIG_SERIO_LIBPS2=y
24064 +# CONFIG_SERIO_RAW is not set
24065 +# CONFIG_GAMEPORT is not set
24066 +
24067 +#
24068 +# Character devices
24069 +#
24070 +# CONFIG_VT is not set
24071 +# CONFIG_SERIAL_NONSTANDARD is not set
24072 +
24073 +#
24074 +# Serial drivers
24075 +#
24076 +# CONFIG_SERIAL_8250 is not set
24077 +
24078 +#
24079 +# Non-8250 serial port support
24080 +#
24081 +# CONFIG_SERIAL_UARTLITE is not set
24082 +CONFIG_SERIAL_CORE=y
24083 +CONFIG_SERIAL_CORE_CONSOLE=y
24084 +CONFIG_SERIAL_CPM=y
24085 +CONFIG_SERIAL_CPM_CONSOLE=y
24086 +# CONFIG_SERIAL_CPM_SCC1 is not set
24087 +# CONFIG_SERIAL_CPM_SCC2 is not set
24088 +# CONFIG_SERIAL_CPM_SCC3 is not set
24089 +# CONFIG_SERIAL_CPM_SCC4 is not set
24090 +CONFIG_SERIAL_CPM_SMC1=y
24091 +CONFIG_SERIAL_CPM_SMC2=y
24092 +CONFIG_UNIX98_PTYS=y
24093 +# CONFIG_LEGACY_PTYS is not set
24094 +# CONFIG_IPMI_HANDLER is not set
24095 +CONFIG_HW_RANDOM=y
24096 +# CONFIG_NVRAM is not set
24097 +CONFIG_GEN_RTC=y
24098 +# CONFIG_GEN_RTC_X is not set
24099 +# CONFIG_R3964 is not set
24100 +# CONFIG_RAW_DRIVER is not set
24101 +# CONFIG_TCG_TPM is not set
24102 +# CONFIG_I2C is not set
24103 +
24104 +#
24105 +# SPI support
24106 +#
24107 +# CONFIG_SPI is not set
24108 +# CONFIG_SPI_MASTER is not set
24109 +# CONFIG_W1 is not set
24110 +# CONFIG_POWER_SUPPLY is not set
24111 +# CONFIG_HWMON is not set
24112 +# CONFIG_WATCHDOG is not set
24113 +
24114 +#
24115 +# Sonics Silicon Backplane
24116 +#
24117 +CONFIG_SSB_POSSIBLE=y
24118 +# CONFIG_SSB is not set
24119 +
24120 +#
24121 +# Multifunction device drivers
24122 +#
24123 +# CONFIG_MFD_SM501 is not set
24124 +
24125 +#
24126 +# Multimedia devices
24127 +#
24128 +# CONFIG_VIDEO_DEV is not set
24129 +# CONFIG_DVB_CORE is not set
24130 +CONFIG_DAB=y
24131 +
24132 +#
24133 +# Graphics support
24134 +#
24135 +# CONFIG_VGASTATE is not set
24136 +CONFIG_VIDEO_OUTPUT_CONTROL=y
24137 +# CONFIG_FB is not set
24138 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
24139 +
24140 +#
24141 +# Display device support
24142 +#
24143 +# CONFIG_DISPLAY_SUPPORT is not set
24144 +
24145 +#
24146 +# Sound
24147 +#
24148 +# CONFIG_SOUND is not set
24149 +# CONFIG_HID_SUPPORT is not set
24150 +# CONFIG_USB_SUPPORT is not set
24151 +# CONFIG_MMC is not set
24152 +# CONFIG_NEW_LEDS is not set
24153 +# CONFIG_EDAC is not set
24154 +# CONFIG_RTC_CLASS is not set
24155 +
24156 +#
24157 +# Userspace I/O
24158 +#
24159 +# CONFIG_UIO is not set
24160 +
24161 +#
24162 +# File systems
24163 +#
24164 +# CONFIG_EXT2_FS is not set
24165 +# CONFIG_EXT3_FS is not set
24166 +# CONFIG_EXT4DEV_FS is not set
24167 +# CONFIG_REISERFS_FS is not set
24168 +# CONFIG_JFS_FS is not set
24169 +# CONFIG_FS_POSIX_ACL is not set
24170 +# CONFIG_XFS_FS is not set
24171 +# CONFIG_GFS2_FS is not set
24172 +# CONFIG_OCFS2_FS is not set
24173 +# CONFIG_MINIX_FS is not set
24174 +# CONFIG_ROMFS_FS is not set
24175 +# CONFIG_INOTIFY is not set
24176 +# CONFIG_QUOTA is not set
24177 +# CONFIG_DNOTIFY is not set
24178 +# CONFIG_AUTOFS_FS is not set
24179 +# CONFIG_AUTOFS4_FS is not set
24180 +# CONFIG_FUSE_FS is not set
24181 +
24182 +#
24183 +# CD-ROM/DVD Filesystems
24184 +#
24185 +# CONFIG_ISO9660_FS is not set
24186 +# CONFIG_UDF_FS is not set
24187 +
24188 +#
24189 +# DOS/FAT/NT Filesystems
24190 +#
24191 +# CONFIG_MSDOS_FS is not set
24192 +# CONFIG_VFAT_FS is not set
24193 +# CONFIG_NTFS_FS is not set
24194 +
24195 +#
24196 +# Pseudo filesystems
24197 +#
24198 +CONFIG_PROC_FS=y
24199 +# CONFIG_PROC_KCORE is not set
24200 +CONFIG_PROC_SYSCTL=y
24201 +CONFIG_SYSFS=y
24202 +CONFIG_TMPFS=y
24203 +# CONFIG_TMPFS_POSIX_ACL is not set
24204 +# CONFIG_HUGETLB_PAGE is not set
24205 +# CONFIG_CONFIGFS_FS is not set
24206 +
24207 +#
24208 +# Miscellaneous filesystems
24209 +#
24210 +# CONFIG_ADFS_FS is not set
24211 +# CONFIG_AFFS_FS is not set
24212 +# CONFIG_HFS_FS is not set
24213 +# CONFIG_HFSPLUS_FS is not set
24214 +# CONFIG_BEFS_FS is not set
24215 +# CONFIG_BFS_FS is not set
24216 +# CONFIG_EFS_FS is not set
24217 +# CONFIG_JFFS2_FS is not set
24218 +CONFIG_CRAMFS=y
24219 +# CONFIG_VXFS_FS is not set
24220 +# CONFIG_HPFS_FS is not set
24221 +# CONFIG_QNX4FS_FS is not set
24222 +# CONFIG_SYSV_FS is not set
24223 +# CONFIG_UFS_FS is not set
24224 +CONFIG_NETWORK_FILESYSTEMS=y
24225 +CONFIG_NFS_FS=y
24226 +CONFIG_NFS_V3=y
24227 +# CONFIG_NFS_V3_ACL is not set
24228 +# CONFIG_NFS_V4 is not set
24229 +# CONFIG_NFS_DIRECTIO is not set
24230 +# CONFIG_NFSD is not set
24231 +CONFIG_ROOT_NFS=y
24232 +CONFIG_LOCKD=y
24233 +CONFIG_LOCKD_V4=y
24234 +CONFIG_NFS_COMMON=y
24235 +CONFIG_SUNRPC=y
24236 +# CONFIG_SUNRPC_BIND34 is not set
24237 +# CONFIG_RPCSEC_GSS_KRB5 is not set
24238 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
24239 +# CONFIG_SMB_FS is not set
24240 +# CONFIG_CIFS is not set
24241 +# CONFIG_NCP_FS is not set
24242 +# CONFIG_CODA_FS is not set
24243 +# CONFIG_AFS_FS is not set
24244 +
24245 +#
24246 +# Partition Types
24247 +#
24248 +CONFIG_PARTITION_ADVANCED=y
24249 +# CONFIG_ACORN_PARTITION is not set
24250 +# CONFIG_OSF_PARTITION is not set
24251 +# CONFIG_AMIGA_PARTITION is not set
24252 +# CONFIG_ATARI_PARTITION is not set
24253 +# CONFIG_MAC_PARTITION is not set
24254 +CONFIG_MSDOS_PARTITION=y
24255 +# CONFIG_BSD_DISKLABEL is not set
24256 +# CONFIG_MINIX_SUBPARTITION is not set
24257 +# CONFIG_SOLARIS_X86_PARTITION is not set
24258 +# CONFIG_UNIXWARE_DISKLABEL is not set
24259 +# CONFIG_LDM_PARTITION is not set
24260 +# CONFIG_SGI_PARTITION is not set
24261 +# CONFIG_ULTRIX_PARTITION is not set
24262 +# CONFIG_SUN_PARTITION is not set
24263 +# CONFIG_KARMA_PARTITION is not set
24264 +# CONFIG_EFI_PARTITION is not set
24265 +# CONFIG_SYSV68_PARTITION is not set
24266 +# CONFIG_NLS is not set
24267 +# CONFIG_DLM is not set
24268 +# CONFIG_UCC_SLOW is not set
24269 +
24270 +#
24271 +# Library routines
24272 +#
24273 +# CONFIG_CRC_CCITT is not set
24274 +# CONFIG_CRC16 is not set
24275 +# CONFIG_CRC_ITU_T is not set
24276 +# CONFIG_CRC32 is not set
24277 +# CONFIG_CRC7 is not set
24278 +# CONFIG_LIBCRC32C is not set
24279 +CONFIG_ZLIB_INFLATE=y
24280 +CONFIG_HAS_IOMEM=y
24281 +CONFIG_HAS_IOPORT=y
24282 +CONFIG_HAS_DMA=y
24283 +CONFIG_INSTRUMENTATION=y
24284 +# CONFIG_PROFILING is not set
24285 +# CONFIG_MARKERS is not set
24286 +
24287 +#
24288 +# Kernel hacking
24289 +#
24290 +# CONFIG_PRINTK_TIME is not set
24291 +CONFIG_ENABLE_WARN_DEPRECATED=y
24292 +CONFIG_ENABLE_MUST_CHECK=y
24293 +CONFIG_MAGIC_SYSRQ=y
24294 +# CONFIG_UNUSED_SYMBOLS is not set
24295 +# CONFIG_DEBUG_FS is not set
24296 +# CONFIG_HEADERS_CHECK is not set
24297 +CONFIG_DEBUG_KERNEL=y
24298 +# CONFIG_DEBUG_SHIRQ is not set
24299 +CONFIG_DETECT_SOFTLOCKUP=y
24300 +CONFIG_SCHED_DEBUG=y
24301 +# CONFIG_SCHEDSTATS is not set
24302 +# CONFIG_TIMER_STATS is not set
24303 +# CONFIG_SLUB_DEBUG_ON is not set
24304 +# CONFIG_DEBUG_SPINLOCK is not set
24305 +# CONFIG_DEBUG_MUTEXES is not set
24306 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
24307 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
24308 +# CONFIG_DEBUG_KOBJECT is not set
24309 +CONFIG_DEBUG_BUGVERBOSE=y
24310 +CONFIG_DEBUG_INFO=y
24311 +# CONFIG_DEBUG_VM is not set
24312 +# CONFIG_DEBUG_LIST is not set
24313 +# CONFIG_DEBUG_SG is not set
24314 +CONFIG_FORCED_INLINING=y
24315 +# CONFIG_BOOT_PRINTK_DELAY is not set
24316 +# CONFIG_FAULT_INJECTION is not set
24317 +# CONFIG_SAMPLES is not set
24318 +# CONFIG_DEBUG_STACKOVERFLOW is not set
24319 +# CONFIG_DEBUG_STACK_USAGE is not set
24320 +# CONFIG_DEBUG_PAGEALLOC is not set
24321 +# CONFIG_DEBUGGER is not set
24322 +# CONFIG_BDI_SWITCH is not set
24323 +# CONFIG_PPC_EARLY_DEBUG is not set
24324 +
24325 +#
24326 +# Security options
24327 +#
24328 +# CONFIG_KEYS is not set
24329 +# CONFIG_SECURITY is not set
24330 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
24331 +# CONFIG_CRYPTO is not set
24332 +# CONFIG_PPC_CLOCK is not set
24333 +CONFIG_PPC_LIB_RHEAP=y
24334 Index: linux-2.6.24.7/arch/powerpc/configs/adder875-uboot_defconfig
24335 ===================================================================
24336 --- /dev/null
24337 +++ linux-2.6.24.7/arch/powerpc/configs/adder875-uboot_defconfig
24338 @@ -0,0 +1,798 @@
24339 +#
24340 +# Automatically generated make config: don't edit
24341 +# Linux kernel version: 2.6.24-rc6
24342 +# Thu Jan 17 16:17:18 2008
24343 +#
24344 +# CONFIG_PPC64 is not set
24345 +
24346 +#
24347 +# Processor support
24348 +#
24349 +# CONFIG_6xx is not set
24350 +# CONFIG_PPC_85xx is not set
24351 +CONFIG_PPC_8xx=y
24352 +# CONFIG_40x is not set
24353 +# CONFIG_44x is not set
24354 +# CONFIG_E200 is not set
24355 +CONFIG_8xx=y
24356 +# CONFIG_PPC_MM_SLICES is not set
24357 +CONFIG_NOT_COHERENT_CACHE=y
24358 +CONFIG_PPC32=y
24359 +CONFIG_WORD_SIZE=32
24360 +CONFIG_PPC_MERGE=y
24361 +CONFIG_MMU=y
24362 +CONFIG_GENERIC_CMOS_UPDATE=y
24363 +CONFIG_GENERIC_TIME=y
24364 +CONFIG_GENERIC_TIME_VSYSCALL=y
24365 +CONFIG_GENERIC_CLOCKEVENTS=y
24366 +CONFIG_GENERIC_HARDIRQS=y
24367 +CONFIG_IRQ_PER_CPU=y
24368 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
24369 +CONFIG_ARCH_HAS_ILOG2_U32=y
24370 +CONFIG_GENERIC_HWEIGHT=y
24371 +CONFIG_GENERIC_CALIBRATE_DELAY=y
24372 +CONFIG_GENERIC_FIND_NEXT_BIT=y
24373 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
24374 +CONFIG_PPC=y
24375 +CONFIG_EARLY_PRINTK=y
24376 +CONFIG_GENERIC_NVRAM=y
24377 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
24378 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
24379 +CONFIG_PPC_OF=y
24380 +CONFIG_OF=y
24381 +# CONFIG_PPC_UDBG_16550 is not set
24382 +# CONFIG_GENERIC_TBSYNC is not set
24383 +CONFIG_AUDIT_ARCH=y
24384 +CONFIG_GENERIC_BUG=y
24385 +# CONFIG_DEFAULT_UIMAGE is not set
24386 +CONFIG_REDBOOT=y
24387 +# CONFIG_PPC_DCR_NATIVE is not set
24388 +# CONFIG_PPC_DCR_MMIO is not set
24389 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24390 +
24391 +#
24392 +# General setup
24393 +#
24394 +CONFIG_EXPERIMENTAL=y
24395 +CONFIG_BROKEN_ON_SMP=y
24396 +CONFIG_INIT_ENV_ARG_LIMIT=32
24397 +CONFIG_LOCALVERSION=""
24398 +CONFIG_LOCALVERSION_AUTO=y
24399 +# CONFIG_SWAP is not set
24400 +CONFIG_SYSVIPC=y
24401 +CONFIG_SYSVIPC_SYSCTL=y
24402 +# CONFIG_POSIX_MQUEUE is not set
24403 +# CONFIG_BSD_PROCESS_ACCT is not set
24404 +# CONFIG_TASKSTATS is not set
24405 +# CONFIG_USER_NS is not set
24406 +# CONFIG_PID_NS is not set
24407 +# CONFIG_AUDIT is not set
24408 +# CONFIG_IKCONFIG is not set
24409 +CONFIG_LOG_BUF_SHIFT=14
24410 +# CONFIG_CGROUPS is not set
24411 +CONFIG_FAIR_GROUP_SCHED=y
24412 +CONFIG_FAIR_USER_SCHED=y
24413 +# CONFIG_FAIR_CGROUP_SCHED is not set
24414 +CONFIG_SYSFS_DEPRECATED=y
24415 +# CONFIG_RELAY is not set
24416 +# CONFIG_BLK_DEV_INITRD is not set
24417 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
24418 +CONFIG_SYSCTL=y
24419 +CONFIG_EMBEDDED=y
24420 +# CONFIG_SYSCTL_SYSCALL is not set
24421 +CONFIG_KALLSYMS=y
24422 +# CONFIG_KALLSYMS_ALL is not set
24423 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
24424 +CONFIG_HOTPLUG=y
24425 +CONFIG_PRINTK=y
24426 +CONFIG_BUG=y
24427 +# CONFIG_ELF_CORE is not set
24428 +# CONFIG_BASE_FULL is not set
24429 +# CONFIG_FUTEX is not set
24430 +CONFIG_ANON_INODES=y
24431 +CONFIG_EPOLL=y
24432 +CONFIG_SIGNALFD=y
24433 +CONFIG_EVENTFD=y
24434 +CONFIG_SHMEM=y
24435 +# CONFIG_VM_EVENT_COUNTERS is not set
24436 +CONFIG_SLUB_DEBUG=y
24437 +# CONFIG_SLAB is not set
24438 +CONFIG_SLUB=y
24439 +# CONFIG_SLOB is not set
24440 +# CONFIG_TINY_SHMEM is not set
24441 +CONFIG_BASE_SMALL=1
24442 +# CONFIG_MODULES is not set
24443 +CONFIG_BLOCK=y
24444 +# CONFIG_LBD is not set
24445 +# CONFIG_BLK_DEV_IO_TRACE is not set
24446 +# CONFIG_LSF is not set
24447 +# CONFIG_BLK_DEV_BSG is not set
24448 +
24449 +#
24450 +# IO Schedulers
24451 +#
24452 +CONFIG_IOSCHED_NOOP=y
24453 +# CONFIG_IOSCHED_AS is not set
24454 +CONFIG_IOSCHED_DEADLINE=y
24455 +# CONFIG_IOSCHED_CFQ is not set
24456 +# CONFIG_DEFAULT_AS is not set
24457 +CONFIG_DEFAULT_DEADLINE=y
24458 +# CONFIG_DEFAULT_CFQ is not set
24459 +# CONFIG_DEFAULT_NOOP is not set
24460 +CONFIG_DEFAULT_IOSCHED="deadline"
24461 +
24462 +#
24463 +# Platform support
24464 +#
24465 +# CONFIG_PPC_MPC52xx is not set
24466 +# CONFIG_PPC_MPC5200 is not set
24467 +# CONFIG_PPC_CELL is not set
24468 +# CONFIG_PPC_CELL_NATIVE is not set
24469 +CONFIG_CPM1=y
24470 +# CONFIG_MPC8XXFADS is not set
24471 +# CONFIG_MPC86XADS is not set
24472 +# CONFIG_MPC885ADS is not set
24473 +# CONFIG_PPC_EP88XC is not set
24474 +CONFIG_PPC_ADDER875=y
24475 +
24476 +#
24477 +# MPC8xx CPM Options
24478 +#
24479 +
24480 +#
24481 +# Generic MPC8xx Options
24482 +#
24483 +CONFIG_8xx_COPYBACK=y
24484 +# CONFIG_8xx_CPU6 is not set
24485 +CONFIG_8xx_CPU15=y
24486 +CONFIG_NO_UCODE_PATCH=y
24487 +# CONFIG_USB_SOF_UCODE_PATCH is not set
24488 +# CONFIG_I2C_SPI_UCODE_PATCH is not set
24489 +# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
24490 +# CONFIG_PQ2ADS is not set
24491 +# CONFIG_MPIC is not set
24492 +# CONFIG_MPIC_WEIRD is not set
24493 +# CONFIG_PPC_I8259 is not set
24494 +# CONFIG_PPC_RTAS is not set
24495 +# CONFIG_MMIO_NVRAM is not set
24496 +# CONFIG_PPC_MPC106 is not set
24497 +# CONFIG_PPC_970_NAP is not set
24498 +# CONFIG_PPC_INDIRECT_IO is not set
24499 +# CONFIG_GENERIC_IOMAP is not set
24500 +# CONFIG_CPU_FREQ is not set
24501 +# CONFIG_CPM2 is not set
24502 +CONFIG_PPC_CPM_NEW_BINDING=y
24503 +# CONFIG_FSL_ULI1575 is not set
24504 +CONFIG_CPM=y
24505 +
24506 +#
24507 +# Kernel options
24508 +#
24509 +# CONFIG_HIGHMEM is not set
24510 +# CONFIG_TICK_ONESHOT is not set
24511 +# CONFIG_NO_HZ is not set
24512 +# CONFIG_HIGH_RES_TIMERS is not set
24513 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
24514 +# CONFIG_HZ_100 is not set
24515 +# CONFIG_HZ_250 is not set
24516 +# CONFIG_HZ_300 is not set
24517 +CONFIG_HZ_1000=y
24518 +CONFIG_HZ=1000
24519 +CONFIG_PREEMPT_NONE=y
24520 +# CONFIG_PREEMPT_VOLUNTARY is not set
24521 +# CONFIG_PREEMPT is not set
24522 +CONFIG_BINFMT_ELF=y
24523 +# CONFIG_BINFMT_MISC is not set
24524 +# CONFIG_MATH_EMULATION is not set
24525 +# CONFIG_8XX_MINIMAL_FPEMU is not set
24526 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
24527 +CONFIG_ARCH_FLATMEM_ENABLE=y
24528 +CONFIG_ARCH_POPULATES_NODE_MAP=y
24529 +CONFIG_SELECT_MEMORY_MODEL=y
24530 +CONFIG_FLATMEM_MANUAL=y
24531 +# CONFIG_DISCONTIGMEM_MANUAL is not set
24532 +# CONFIG_SPARSEMEM_MANUAL is not set
24533 +CONFIG_FLATMEM=y
24534 +CONFIG_FLAT_NODE_MEM_MAP=y
24535 +# CONFIG_SPARSEMEM_STATIC is not set
24536 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
24537 +CONFIG_SPLIT_PTLOCK_CPUS=4
24538 +# CONFIG_RESOURCES_64BIT is not set
24539 +CONFIG_ZONE_DMA_FLAG=1
24540 +CONFIG_BOUNCE=y
24541 +CONFIG_VIRT_TO_BUS=y
24542 +# CONFIG_PROC_DEVICETREE is not set
24543 +# CONFIG_CMDLINE_BOOL is not set
24544 +# CONFIG_PM is not set
24545 +CONFIG_SUSPEND_UP_POSSIBLE=y
24546 +CONFIG_HIBERNATION_UP_POSSIBLE=y
24547 +# CONFIG_SECCOMP is not set
24548 +CONFIG_WANT_DEVICE_TREE=y
24549 +CONFIG_DEVICE_TREE="adder875-uboot.dts"
24550 +CONFIG_ISA_DMA_API=y
24551 +
24552 +#
24553 +# Bus options
24554 +#
24555 +CONFIG_ZONE_DMA=y
24556 +CONFIG_FSL_SOC=y
24557 +# CONFIG_PCI is not set
24558 +# CONFIG_PCI_DOMAINS is not set
24559 +# CONFIG_PCI_SYSCALL is not set
24560 +# CONFIG_PCI_QSPAN is not set
24561 +# CONFIG_ARCH_SUPPORTS_MSI is not set
24562 +# CONFIG_PCCARD is not set
24563 +
24564 +#
24565 +# Advanced setup
24566 +#
24567 +# CONFIG_ADVANCED_OPTIONS is not set
24568 +
24569 +#
24570 +# Default settings for advanced configuration options are used
24571 +#
24572 +CONFIG_HIGHMEM_START=0xfe000000
24573 +CONFIG_LOWMEM_SIZE=0x30000000
24574 +CONFIG_KERNEL_START=0xc0000000
24575 +CONFIG_TASK_SIZE=0x80000000
24576 +CONFIG_CONSISTENT_START=0xfd000000
24577 +CONFIG_CONSISTENT_SIZE=0x00200000
24578 +CONFIG_BOOT_LOAD=0x00400000
24579 +
24580 +#
24581 +# Networking
24582 +#
24583 +CONFIG_NET=y
24584 +
24585 +#
24586 +# Networking options
24587 +#
24588 +CONFIG_PACKET=y
24589 +# CONFIG_PACKET_MMAP is not set
24590 +CONFIG_UNIX=y
24591 +# CONFIG_NET_KEY is not set
24592 +CONFIG_INET=y
24593 +CONFIG_IP_MULTICAST=y
24594 +# CONFIG_IP_ADVANCED_ROUTER is not set
24595 +CONFIG_IP_FIB_HASH=y
24596 +CONFIG_IP_PNP=y
24597 +# CONFIG_IP_PNP_DHCP is not set
24598 +# CONFIG_IP_PNP_BOOTP is not set
24599 +# CONFIG_IP_PNP_RARP is not set
24600 +# CONFIG_NET_IPIP is not set
24601 +# CONFIG_NET_IPGRE is not set
24602 +# CONFIG_IP_MROUTE is not set
24603 +# CONFIG_ARPD is not set
24604 +CONFIG_SYN_COOKIES=y
24605 +# CONFIG_INET_AH is not set
24606 +# CONFIG_INET_ESP is not set
24607 +# CONFIG_INET_IPCOMP is not set
24608 +# CONFIG_INET_XFRM_TUNNEL is not set
24609 +# CONFIG_INET_TUNNEL is not set
24610 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
24611 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
24612 +# CONFIG_INET_XFRM_MODE_BEET is not set
24613 +# CONFIG_INET_LRO is not set
24614 +CONFIG_INET_DIAG=y
24615 +CONFIG_INET_TCP_DIAG=y
24616 +# CONFIG_TCP_CONG_ADVANCED is not set
24617 +CONFIG_TCP_CONG_CUBIC=y
24618 +CONFIG_DEFAULT_TCP_CONG="cubic"
24619 +# CONFIG_TCP_MD5SIG is not set
24620 +# CONFIG_IPV6 is not set
24621 +# CONFIG_INET6_XFRM_TUNNEL is not set
24622 +# CONFIG_INET6_TUNNEL is not set
24623 +# CONFIG_NETWORK_SECMARK is not set
24624 +# CONFIG_NETFILTER is not set
24625 +# CONFIG_IP_DCCP is not set
24626 +# CONFIG_IP_SCTP is not set
24627 +# CONFIG_TIPC is not set
24628 +# CONFIG_ATM is not set
24629 +# CONFIG_BRIDGE is not set
24630 +# CONFIG_VLAN_8021Q is not set
24631 +# CONFIG_DECNET is not set
24632 +# CONFIG_LLC2 is not set
24633 +# CONFIG_IPX is not set
24634 +# CONFIG_ATALK is not set
24635 +# CONFIG_X25 is not set
24636 +# CONFIG_LAPB is not set
24637 +# CONFIG_ECONET is not set
24638 +# CONFIG_WAN_ROUTER is not set
24639 +# CONFIG_NET_SCHED is not set
24640 +
24641 +#
24642 +# Network testing
24643 +#
24644 +# CONFIG_NET_PKTGEN is not set
24645 +# CONFIG_HAMRADIO is not set
24646 +# CONFIG_IRDA is not set
24647 +# CONFIG_BT is not set
24648 +# CONFIG_AF_RXRPC is not set
24649 +
24650 +#
24651 +# Wireless
24652 +#
24653 +# CONFIG_CFG80211 is not set
24654 +# CONFIG_WIRELESS_EXT is not set
24655 +# CONFIG_MAC80211 is not set
24656 +# CONFIG_IEEE80211 is not set
24657 +# CONFIG_RFKILL is not set
24658 +# CONFIG_NET_9P is not set
24659 +
24660 +#
24661 +# Device Drivers
24662 +#
24663 +
24664 +#
24665 +# Generic Driver Options
24666 +#
24667 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
24668 +CONFIG_STANDALONE=y
24669 +CONFIG_PREVENT_FIRMWARE_BUILD=y
24670 +# CONFIG_FW_LOADER is not set
24671 +# CONFIG_DEBUG_DRIVER is not set
24672 +# CONFIG_DEBUG_DEVRES is not set
24673 +# CONFIG_SYS_HYPERVISOR is not set
24674 +# CONFIG_CONNECTOR is not set
24675 +CONFIG_MTD=y
24676 +# CONFIG_MTD_DEBUG is not set
24677 +# CONFIG_MTD_CONCAT is not set
24678 +# CONFIG_MTD_PARTITIONS is not set
24679 +
24680 +#
24681 +# User Modules And Translation Layers
24682 +#
24683 +CONFIG_MTD_CHAR=y
24684 +CONFIG_MTD_BLKDEVS=y
24685 +CONFIG_MTD_BLOCK=y
24686 +# CONFIG_FTL is not set
24687 +# CONFIG_NFTL is not set
24688 +# CONFIG_INFTL is not set
24689 +# CONFIG_RFD_FTL is not set
24690 +# CONFIG_SSFDC is not set
24691 +# CONFIG_MTD_OOPS is not set
24692 +
24693 +#
24694 +# RAM/ROM/Flash chip drivers
24695 +#
24696 +CONFIG_MTD_CFI=y
24697 +# CONFIG_MTD_JEDECPROBE is not set
24698 +CONFIG_MTD_GEN_PROBE=y
24699 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
24700 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
24701 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
24702 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
24703 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
24704 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
24705 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
24706 +CONFIG_MTD_CFI_I1=y
24707 +CONFIG_MTD_CFI_I2=y
24708 +# CONFIG_MTD_CFI_I4 is not set
24709 +# CONFIG_MTD_CFI_I8 is not set
24710 +# CONFIG_MTD_CFI_INTELEXT is not set
24711 +CONFIG_MTD_CFI_AMDSTD=y
24712 +# CONFIG_MTD_CFI_STAA is not set
24713 +CONFIG_MTD_CFI_UTIL=y
24714 +# CONFIG_MTD_RAM is not set
24715 +# CONFIG_MTD_ROM is not set
24716 +# CONFIG_MTD_ABSENT is not set
24717 +
24718 +#
24719 +# Mapping drivers for chip access
24720 +#
24721 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
24722 +# CONFIG_MTD_PHYSMAP is not set
24723 +CONFIG_MTD_PHYSMAP_OF=y
24724 +# CONFIG_MTD_CFI_FLAGADM is not set
24725 +# CONFIG_MTD_PLATRAM is not set
24726 +
24727 +#
24728 +# Self-contained MTD device drivers
24729 +#
24730 +# CONFIG_MTD_SLRAM is not set
24731 +# CONFIG_MTD_PHRAM is not set
24732 +# CONFIG_MTD_MTDRAM is not set
24733 +# CONFIG_MTD_BLOCK2MTD is not set
24734 +
24735 +#
24736 +# Disk-On-Chip Device Drivers
24737 +#
24738 +# CONFIG_MTD_DOC2000 is not set
24739 +# CONFIG_MTD_DOC2001 is not set
24740 +# CONFIG_MTD_DOC2001PLUS is not set
24741 +# CONFIG_MTD_NAND is not set
24742 +# CONFIG_MTD_ONENAND is not set
24743 +
24744 +#
24745 +# UBI - Unsorted block images
24746 +#
24747 +# CONFIG_MTD_UBI is not set
24748 +CONFIG_OF_DEVICE=y
24749 +# CONFIG_PARPORT is not set
24750 +# CONFIG_BLK_DEV is not set
24751 +# CONFIG_MISC_DEVICES is not set
24752 +# CONFIG_IDE is not set
24753 +
24754 +#
24755 +# SCSI device support
24756 +#
24757 +# CONFIG_RAID_ATTRS is not set
24758 +# CONFIG_SCSI is not set
24759 +# CONFIG_SCSI_DMA is not set
24760 +# CONFIG_SCSI_NETLINK is not set
24761 +# CONFIG_ATA is not set
24762 +# CONFIG_MD is not set
24763 +# CONFIG_MACINTOSH_DRIVERS is not set
24764 +CONFIG_NETDEVICES=y
24765 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
24766 +# CONFIG_DUMMY is not set
24767 +# CONFIG_BONDING is not set
24768 +# CONFIG_MACVLAN is not set
24769 +# CONFIG_EQUALIZER is not set
24770 +# CONFIG_TUN is not set
24771 +# CONFIG_VETH is not set
24772 +CONFIG_PHYLIB=y
24773 +
24774 +#
24775 +# MII PHY device drivers
24776 +#
24777 +# CONFIG_MARVELL_PHY is not set
24778 +CONFIG_DAVICOM_PHY=y
24779 +# CONFIG_QSEMI_PHY is not set
24780 +# CONFIG_LXT_PHY is not set
24781 +# CONFIG_CICADA_PHY is not set
24782 +# CONFIG_VITESSE_PHY is not set
24783 +# CONFIG_SMSC_PHY is not set
24784 +# CONFIG_BROADCOM_PHY is not set
24785 +# CONFIG_ICPLUS_PHY is not set
24786 +# CONFIG_FIXED_PHY is not set
24787 +# CONFIG_MDIO_BITBANG is not set
24788 +CONFIG_NET_ETHERNET=y
24789 +CONFIG_MII=y
24790 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
24791 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
24792 +# CONFIG_IBM_NEW_EMAC_TAH is not set
24793 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
24794 +# CONFIG_B44 is not set
24795 +CONFIG_FS_ENET=y
24796 +# CONFIG_FS_ENET_HAS_SCC is not set
24797 +CONFIG_FS_ENET_HAS_FEC=y
24798 +CONFIG_FS_ENET_MDIO_FEC=y
24799 +# CONFIG_NETDEV_1000 is not set
24800 +# CONFIG_NETDEV_10000 is not set
24801 +
24802 +#
24803 +# Wireless LAN
24804 +#
24805 +# CONFIG_WLAN_PRE80211 is not set
24806 +# CONFIG_WLAN_80211 is not set
24807 +# CONFIG_WAN is not set
24808 +# CONFIG_PPP is not set
24809 +# CONFIG_SLIP is not set
24810 +# CONFIG_SHAPER is not set
24811 +# CONFIG_NETCONSOLE is not set
24812 +# CONFIG_NETPOLL is not set
24813 +# CONFIG_NET_POLL_CONTROLLER is not set
24814 +# CONFIG_ISDN is not set
24815 +# CONFIG_PHONE is not set
24816 +
24817 +#
24818 +# Input device support
24819 +#
24820 +CONFIG_INPUT=y
24821 +# CONFIG_INPUT_FF_MEMLESS is not set
24822 +# CONFIG_INPUT_POLLDEV is not set
24823 +
24824 +#
24825 +# Userland interfaces
24826 +#
24827 +CONFIG_INPUT_MOUSEDEV=y
24828 +CONFIG_INPUT_MOUSEDEV_PSAUX=y
24829 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
24830 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
24831 +# CONFIG_INPUT_JOYDEV is not set
24832 +# CONFIG_INPUT_EVDEV is not set
24833 +# CONFIG_INPUT_EVBUG is not set
24834 +
24835 +#
24836 +# Input Device Drivers
24837 +#
24838 +CONFIG_INPUT_KEYBOARD=y
24839 +CONFIG_KEYBOARD_ATKBD=y
24840 +# CONFIG_KEYBOARD_SUNKBD is not set
24841 +# CONFIG_KEYBOARD_LKKBD is not set
24842 +# CONFIG_KEYBOARD_XTKBD is not set
24843 +# CONFIG_KEYBOARD_NEWTON is not set
24844 +# CONFIG_KEYBOARD_STOWAWAY is not set
24845 +CONFIG_INPUT_MOUSE=y
24846 +CONFIG_MOUSE_PS2=y
24847 +CONFIG_MOUSE_PS2_ALPS=y
24848 +CONFIG_MOUSE_PS2_LOGIPS2PP=y
24849 +CONFIG_MOUSE_PS2_SYNAPTICS=y
24850 +CONFIG_MOUSE_PS2_LIFEBOOK=y
24851 +CONFIG_MOUSE_PS2_TRACKPOINT=y
24852 +# CONFIG_MOUSE_PS2_TOUCHKIT is not set
24853 +# CONFIG_MOUSE_SERIAL is not set
24854 +# CONFIG_MOUSE_VSXXXAA is not set
24855 +# CONFIG_INPUT_JOYSTICK is not set
24856 +# CONFIG_INPUT_TABLET is not set
24857 +# CONFIG_INPUT_TOUCHSCREEN is not set
24858 +# CONFIG_INPUT_MISC is not set
24859 +
24860 +#
24861 +# Hardware I/O ports
24862 +#
24863 +CONFIG_SERIO=y
24864 +CONFIG_SERIO_I8042=y
24865 +CONFIG_SERIO_SERPORT=y
24866 +CONFIG_SERIO_LIBPS2=y
24867 +# CONFIG_SERIO_RAW is not set
24868 +# CONFIG_GAMEPORT is not set
24869 +
24870 +#
24871 +# Character devices
24872 +#
24873 +# CONFIG_VT is not set
24874 +# CONFIG_SERIAL_NONSTANDARD is not set
24875 +
24876 +#
24877 +# Serial drivers
24878 +#
24879 +# CONFIG_SERIAL_8250 is not set
24880 +
24881 +#
24882 +# Non-8250 serial port support
24883 +#
24884 +# CONFIG_SERIAL_UARTLITE is not set
24885 +CONFIG_SERIAL_CORE=y
24886 +CONFIG_SERIAL_CORE_CONSOLE=y
24887 +CONFIG_SERIAL_CPM=y
24888 +CONFIG_SERIAL_CPM_CONSOLE=y
24889 +# CONFIG_SERIAL_CPM_SCC1 is not set
24890 +# CONFIG_SERIAL_CPM_SCC2 is not set
24891 +# CONFIG_SERIAL_CPM_SCC3 is not set
24892 +# CONFIG_SERIAL_CPM_SCC4 is not set
24893 +CONFIG_SERIAL_CPM_SMC1=y
24894 +CONFIG_SERIAL_CPM_SMC2=y
24895 +CONFIG_UNIX98_PTYS=y
24896 +# CONFIG_LEGACY_PTYS is not set
24897 +# CONFIG_IPMI_HANDLER is not set
24898 +CONFIG_HW_RANDOM=y
24899 +# CONFIG_NVRAM is not set
24900 +CONFIG_GEN_RTC=y
24901 +# CONFIG_GEN_RTC_X is not set
24902 +# CONFIG_R3964 is not set
24903 +# CONFIG_RAW_DRIVER is not set
24904 +# CONFIG_TCG_TPM is not set
24905 +# CONFIG_I2C is not set
24906 +
24907 +#
24908 +# SPI support
24909 +#
24910 +# CONFIG_SPI is not set
24911 +# CONFIG_SPI_MASTER is not set
24912 +# CONFIG_W1 is not set
24913 +# CONFIG_POWER_SUPPLY is not set
24914 +# CONFIG_HWMON is not set
24915 +# CONFIG_WATCHDOG is not set
24916 +
24917 +#
24918 +# Sonics Silicon Backplane
24919 +#
24920 +CONFIG_SSB_POSSIBLE=y
24921 +# CONFIG_SSB is not set
24922 +
24923 +#
24924 +# Multifunction device drivers
24925 +#
24926 +# CONFIG_MFD_SM501 is not set
24927 +
24928 +#
24929 +# Multimedia devices
24930 +#
24931 +# CONFIG_VIDEO_DEV is not set
24932 +# CONFIG_DVB_CORE is not set
24933 +CONFIG_DAB=y
24934 +
24935 +#
24936 +# Graphics support
24937 +#
24938 +# CONFIG_VGASTATE is not set
24939 +CONFIG_VIDEO_OUTPUT_CONTROL=y
24940 +# CONFIG_FB is not set
24941 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
24942 +
24943 +#
24944 +# Display device support
24945 +#
24946 +# CONFIG_DISPLAY_SUPPORT is not set
24947 +
24948 +#
24949 +# Sound
24950 +#
24951 +# CONFIG_SOUND is not set
24952 +# CONFIG_HID_SUPPORT is not set
24953 +# CONFIG_USB_SUPPORT is not set
24954 +# CONFIG_MMC is not set
24955 +# CONFIG_NEW_LEDS is not set
24956 +# CONFIG_EDAC is not set
24957 +# CONFIG_RTC_CLASS is not set
24958 +
24959 +#
24960 +# Userspace I/O
24961 +#
24962 +# CONFIG_UIO is not set
24963 +
24964 +#
24965 +# File systems
24966 +#
24967 +# CONFIG_EXT2_FS is not set
24968 +# CONFIG_EXT3_FS is not set
24969 +# CONFIG_EXT4DEV_FS is not set
24970 +# CONFIG_REISERFS_FS is not set
24971 +# CONFIG_JFS_FS is not set
24972 +# CONFIG_FS_POSIX_ACL is not set
24973 +# CONFIG_XFS_FS is not set
24974 +# CONFIG_GFS2_FS is not set
24975 +# CONFIG_OCFS2_FS is not set
24976 +# CONFIG_MINIX_FS is not set
24977 +# CONFIG_ROMFS_FS is not set
24978 +# CONFIG_INOTIFY is not set
24979 +# CONFIG_QUOTA is not set
24980 +# CONFIG_DNOTIFY is not set
24981 +# CONFIG_AUTOFS_FS is not set
24982 +# CONFIG_AUTOFS4_FS is not set
24983 +# CONFIG_FUSE_FS is not set
24984 +
24985 +#
24986 +# CD-ROM/DVD Filesystems
24987 +#
24988 +# CONFIG_ISO9660_FS is not set
24989 +# CONFIG_UDF_FS is not set
24990 +
24991 +#
24992 +# DOS/FAT/NT Filesystems
24993 +#
24994 +# CONFIG_MSDOS_FS is not set
24995 +# CONFIG_VFAT_FS is not set
24996 +# CONFIG_NTFS_FS is not set
24997 +
24998 +#
24999 +# Pseudo filesystems
25000 +#
25001 +CONFIG_PROC_FS=y
25002 +# CONFIG_PROC_KCORE is not set
25003 +CONFIG_PROC_SYSCTL=y
25004 +CONFIG_SYSFS=y
25005 +CONFIG_TMPFS=y
25006 +# CONFIG_TMPFS_POSIX_ACL is not set
25007 +# CONFIG_HUGETLB_PAGE is not set
25008 +# CONFIG_CONFIGFS_FS is not set
25009 +
25010 +#
25011 +# Miscellaneous filesystems
25012 +#
25013 +# CONFIG_ADFS_FS is not set
25014 +# CONFIG_AFFS_FS is not set
25015 +# CONFIG_HFS_FS is not set
25016 +# CONFIG_HFSPLUS_FS is not set
25017 +# CONFIG_BEFS_FS is not set
25018 +# CONFIG_BFS_FS is not set
25019 +# CONFIG_EFS_FS is not set
25020 +# CONFIG_JFFS2_FS is not set
25021 +CONFIG_CRAMFS=y
25022 +# CONFIG_VXFS_FS is not set
25023 +# CONFIG_HPFS_FS is not set
25024 +# CONFIG_QNX4FS_FS is not set
25025 +# CONFIG_SYSV_FS is not set
25026 +# CONFIG_UFS_FS is not set
25027 +CONFIG_NETWORK_FILESYSTEMS=y
25028 +CONFIG_NFS_FS=y
25029 +CONFIG_NFS_V3=y
25030 +# CONFIG_NFS_V3_ACL is not set
25031 +# CONFIG_NFS_V4 is not set
25032 +# CONFIG_NFS_DIRECTIO is not set
25033 +# CONFIG_NFSD is not set
25034 +CONFIG_ROOT_NFS=y
25035 +CONFIG_LOCKD=y
25036 +CONFIG_LOCKD_V4=y
25037 +CONFIG_NFS_COMMON=y
25038 +CONFIG_SUNRPC=y
25039 +# CONFIG_SUNRPC_BIND34 is not set
25040 +# CONFIG_RPCSEC_GSS_KRB5 is not set
25041 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
25042 +# CONFIG_SMB_FS is not set
25043 +# CONFIG_CIFS is not set
25044 +# CONFIG_NCP_FS is not set
25045 +# CONFIG_CODA_FS is not set
25046 +# CONFIG_AFS_FS is not set
25047 +
25048 +#
25049 +# Partition Types
25050 +#
25051 +CONFIG_PARTITION_ADVANCED=y
25052 +# CONFIG_ACORN_PARTITION is not set
25053 +# CONFIG_OSF_PARTITION is not set
25054 +# CONFIG_AMIGA_PARTITION is not set
25055 +# CONFIG_ATARI_PARTITION is not set
25056 +# CONFIG_MAC_PARTITION is not set
25057 +CONFIG_MSDOS_PARTITION=y
25058 +# CONFIG_BSD_DISKLABEL is not set
25059 +# CONFIG_MINIX_SUBPARTITION is not set
25060 +# CONFIG_SOLARIS_X86_PARTITION is not set
25061 +# CONFIG_UNIXWARE_DISKLABEL is not set
25062 +# CONFIG_LDM_PARTITION is not set
25063 +# CONFIG_SGI_PARTITION is not set
25064 +# CONFIG_ULTRIX_PARTITION is not set
25065 +# CONFIG_SUN_PARTITION is not set
25066 +# CONFIG_KARMA_PARTITION is not set
25067 +# CONFIG_EFI_PARTITION is not set
25068 +# CONFIG_SYSV68_PARTITION is not set
25069 +# CONFIG_NLS is not set
25070 +# CONFIG_DLM is not set
25071 +# CONFIG_UCC_SLOW is not set
25072 +
25073 +#
25074 +# Library routines
25075 +#
25076 +# CONFIG_CRC_CCITT is not set
25077 +# CONFIG_CRC16 is not set
25078 +# CONFIG_CRC_ITU_T is not set
25079 +# CONFIG_CRC32 is not set
25080 +# CONFIG_CRC7 is not set
25081 +# CONFIG_LIBCRC32C is not set
25082 +CONFIG_ZLIB_INFLATE=y
25083 +CONFIG_HAS_IOMEM=y
25084 +CONFIG_HAS_IOPORT=y
25085 +CONFIG_HAS_DMA=y
25086 +CONFIG_INSTRUMENTATION=y
25087 +# CONFIG_PROFILING is not set
25088 +# CONFIG_MARKERS is not set
25089 +
25090 +#
25091 +# Kernel hacking
25092 +#
25093 +# CONFIG_PRINTK_TIME is not set
25094 +CONFIG_ENABLE_WARN_DEPRECATED=y
25095 +CONFIG_ENABLE_MUST_CHECK=y
25096 +CONFIG_MAGIC_SYSRQ=y
25097 +# CONFIG_UNUSED_SYMBOLS is not set
25098 +# CONFIG_DEBUG_FS is not set
25099 +# CONFIG_HEADERS_CHECK is not set
25100 +CONFIG_DEBUG_KERNEL=y
25101 +# CONFIG_DEBUG_SHIRQ is not set
25102 +CONFIG_DETECT_SOFTLOCKUP=y
25103 +CONFIG_SCHED_DEBUG=y
25104 +# CONFIG_SCHEDSTATS is not set
25105 +# CONFIG_TIMER_STATS is not set
25106 +# CONFIG_SLUB_DEBUG_ON is not set
25107 +# CONFIG_DEBUG_SPINLOCK is not set
25108 +# CONFIG_DEBUG_MUTEXES is not set
25109 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
25110 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
25111 +# CONFIG_DEBUG_KOBJECT is not set
25112 +CONFIG_DEBUG_BUGVERBOSE=y
25113 +CONFIG_DEBUG_INFO=y
25114 +# CONFIG_DEBUG_VM is not set
25115 +# CONFIG_DEBUG_LIST is not set
25116 +# CONFIG_DEBUG_SG is not set
25117 +CONFIG_FORCED_INLINING=y
25118 +# CONFIG_BOOT_PRINTK_DELAY is not set
25119 +# CONFIG_FAULT_INJECTION is not set
25120 +# CONFIG_SAMPLES is not set
25121 +# CONFIG_DEBUG_STACKOVERFLOW is not set
25122 +# CONFIG_DEBUG_STACK_USAGE is not set
25123 +# CONFIG_DEBUG_PAGEALLOC is not set
25124 +# CONFIG_DEBUGGER is not set
25125 +# CONFIG_BDI_SWITCH is not set
25126 +# CONFIG_PPC_EARLY_DEBUG is not set
25127 +
25128 +#
25129 +# Security options
25130 +#
25131 +# CONFIG_KEYS is not set
25132 +# CONFIG_SECURITY is not set
25133 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
25134 +# CONFIG_CRYPTO is not set
25135 +# CONFIG_PPC_CLOCK is not set
25136 +CONFIG_PPC_LIB_RHEAP=y
25137 Index: linux-2.6.24.7/arch/powerpc/configs/bamboo_defconfig
25138 ===================================================================
25139 --- linux-2.6.24.7.orig/arch/powerpc/configs/bamboo_defconfig
25140 +++ linux-2.6.24.7/arch/powerpc/configs/bamboo_defconfig
25141 @@ -1,7 +1,7 @@
25142  #
25143  # Automatically generated make config: don't edit
25144 -# Linux kernel version: 2.6.24-rc4
25145 -# Thu Dec  6 16:48:04 2007
25146 +# Linux kernel version: 2.6.24-rc6
25147 +# Mon Dec 24 10:49:50 2007
25148  #
25149  # CONFIG_PPC64 is not set
25150  
25151 @@ -131,6 +131,7 @@ CONFIG_DEFAULT_AS=y
25152  # CONFIG_DEFAULT_CFQ is not set
25153  # CONFIG_DEFAULT_NOOP is not set
25154  CONFIG_DEFAULT_IOSCHED="anticipatory"
25155 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
25156  
25157  #
25158  # Platform support
25159 @@ -143,6 +144,9 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
25160  CONFIG_BAMBOO=y
25161  # CONFIG_EBONY is not set
25162  # CONFIG_SEQUOIA is not set
25163 +# CONFIG_TAISHAN is not set
25164 +# CONFIG_KATMAI is not set
25165 +# CONFIG_RAINIER is not set
25166  CONFIG_440EP=y
25167  CONFIG_IBM440EP_ERR42=y
25168  # CONFIG_MPIC is not set
25169 @@ -372,9 +376,7 @@ CONFIG_MISC_DEVICES=y
25170  # CONFIG_FIREWIRE is not set
25171  # CONFIG_IEEE1394 is not set
25172  # CONFIG_I2O is not set
25173 -CONFIG_MACINTOSH_DRIVERS=y
25174 -# CONFIG_MAC_EMUMOUSEBTN is not set
25175 -# CONFIG_WINDFARM is not set
25176 +# CONFIG_MACINTOSH_DRIVERS is not set
25177  CONFIG_NETDEVICES=y
25178  # CONFIG_NETDEVICES_MULTIQUEUE is not set
25179  # CONFIG_DUMMY is not set
25180 @@ -736,19 +738,7 @@ CONFIG_DEBUGGER=y
25181  # CONFIG_KGDB is not set
25182  # CONFIG_XMON is not set
25183  # CONFIG_BDI_SWITCH is not set
25184 -CONFIG_PPC_EARLY_DEBUG=y
25185 -# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
25186 -# CONFIG_PPC_EARLY_DEBUG_G5 is not set
25187 -# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
25188 -# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
25189 -# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
25190 -# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
25191 -# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
25192 -# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
25193 -CONFIG_PPC_EARLY_DEBUG_44x=y
25194 -# CONFIG_PPC_EARLY_DEBUG_CPM is not set
25195 -CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
25196 -CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x0
25197 +# CONFIG_PPC_EARLY_DEBUG is not set
25198  
25199  #
25200  # Security options
25201 Index: linux-2.6.24.7/arch/powerpc/configs/celleb_defconfig
25202 ===================================================================
25203 --- linux-2.6.24.7.orig/arch/powerpc/configs/celleb_defconfig
25204 +++ linux-2.6.24.7/arch/powerpc/configs/celleb_defconfig
25205 @@ -50,7 +50,8 @@ CONFIG_AUDIT_ARCH=y
25206  CONFIG_GENERIC_BUG=y
25207  # CONFIG_DEFAULT_UIMAGE is not set
25208  # CONFIG_PPC_DCR_NATIVE is not set
25209 -# CONFIG_PPC_DCR_MMIO is not set
25210 +CONFIG_PPC_DCR_MMIO=y
25211 +CONFIG_PPC_DCR=y
25212  CONFIG_PPC_OF_PLATFORM_PCI=y
25213  CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25214  
25215 @@ -148,7 +149,7 @@ CONFIG_PPC_MULTIPLATFORM=y
25216  CONFIG_PPC_CELLEB=y
25217  # CONFIG_PPC_PS3 is not set
25218  CONFIG_PPC_CELL=y
25219 -# CONFIG_PPC_CELL_NATIVE is not set
25220 +CONFIG_PPC_CELL_NATIVE=y
25221  # CONFIG_PPC_IBM_CELL_BLADE is not set
25222  
25223  #
25224 @@ -157,13 +158,19 @@ CONFIG_PPC_CELL=y
25225  CONFIG_SPU_FS=y
25226  CONFIG_SPU_FS_64K_LS=y
25227  CONFIG_SPU_BASE=y
25228 +CONFIG_CBE_RAS=y
25229 +# CONFIG_CBE_THERM is not set
25230  # CONFIG_PQ2ADS is not set
25231 +CONFIG_PPC_NATIVE=y
25232 +CONFIG_UDBG_RTAS_CONSOLE=y
25233  CONFIG_PPC_UDBG_BEAT=y
25234 -# CONFIG_MPIC is not set
25235 +CONFIG_MPIC=y
25236  # CONFIG_MPIC_WEIRD is not set
25237  # CONFIG_PPC_I8259 is not set
25238  # CONFIG_U3_DART is not set
25239 -# CONFIG_PPC_RTAS is not set
25240 +CONFIG_PPC_RTAS=y
25241 +# CONFIG_RTAS_ERROR_LOGGING is not set
25242 +# CONFIG_RTAS_PROC is not set
25243  # CONFIG_MMIO_NVRAM is not set
25244  # CONFIG_PPC_MPC106 is not set
25245  # CONFIG_PPC_970_NAP is not set
25246 @@ -593,10 +600,11 @@ CONFIG_MII=y
25247  # CONFIG_NET_VENDOR_3COM is not set
25248  # CONFIG_NET_TULIP is not set
25249  # CONFIG_HP100 is not set
25250 -# CONFIG_IBM_NEW_EMAC_ZMII is not set
25251 -# CONFIG_IBM_NEW_EMAC_RGMII is not set
25252 -# CONFIG_IBM_NEW_EMAC_TAH is not set
25253 -# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
25254 +# CONFIG_IBM_NEW_EMAC is not set
25255 +CONFIG_IBM_NEW_EMAC_ZMII=y
25256 +CONFIG_IBM_NEW_EMAC_RGMII=y
25257 +CONFIG_IBM_NEW_EMAC_TAH=y
25258 +CONFIG_IBM_NEW_EMAC_EMAC4=y
25259  # CONFIG_NET_PCI is not set
25260  # CONFIG_B44 is not set
25261  CONFIG_NETDEV_1000=y
25262 @@ -741,6 +749,7 @@ CONFIG_SERIAL_TXX9_CONSOLE=y
25263  CONFIG_UNIX98_PTYS=y
25264  # CONFIG_LEGACY_PTYS is not set
25265  CONFIG_HVC_DRIVER=y
25266 +CONFIG_HVC_RTAS=y
25267  CONFIG_HVC_BEAT=y
25268  # CONFIG_IPMI_HANDLER is not set
25269  # CONFIG_HW_RANDOM is not set
25270 @@ -822,6 +831,7 @@ CONFIG_WATCHDOG=y
25271  # Watchdog Device Drivers
25272  #
25273  # CONFIG_SOFT_WATCHDOG is not set
25274 +# CONFIG_WATCHDOG_RTAS is not set
25275  
25276  #
25277  # PCI-based Watchdog Cards
25278 @@ -1245,17 +1255,7 @@ CONFIG_XMON_DISASSEMBLY=y
25279  CONFIG_IRQSTACKS=y
25280  # CONFIG_VIRQ_DEBUG is not set
25281  # CONFIG_BOOTX_TEXT is not set
25282 -CONFIG_PPC_EARLY_DEBUG=y
25283 -# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
25284 -# CONFIG_PPC_EARLY_DEBUG_G5 is not set
25285 -# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
25286 -# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
25287 -# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
25288 -# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
25289 -# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
25290 -CONFIG_PPC_EARLY_DEBUG_BEAT=y
25291 -# CONFIG_PPC_EARLY_DEBUG_44x is not set
25292 -# CONFIG_PPC_EARLY_DEBUG_CPM is not set
25293 +# CONFIG_PPC_EARLY_DEBUG is not set
25294  
25295  #
25296  # Security options
25297 Index: linux-2.6.24.7/arch/powerpc/configs/ebony_defconfig
25298 ===================================================================
25299 --- linux-2.6.24.7.orig/arch/powerpc/configs/ebony_defconfig
25300 +++ linux-2.6.24.7/arch/powerpc/configs/ebony_defconfig
25301 @@ -1,7 +1,7 @@
25302  #
25303  # Automatically generated make config: don't edit
25304 -# Linux kernel version: 2.6.24-rc4
25305 -# Thu Dec  6 16:48:11 2007
25306 +# Linux kernel version: 2.6.24-rc6
25307 +# Mon Dec 24 11:16:26 2007
25308  #
25309  # CONFIG_PPC64 is not set
25310  
25311 @@ -130,6 +130,7 @@ CONFIG_DEFAULT_AS=y
25312  # CONFIG_DEFAULT_CFQ is not set
25313  # CONFIG_DEFAULT_NOOP is not set
25314  CONFIG_DEFAULT_IOSCHED="anticipatory"
25315 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
25316  
25317  #
25318  # Platform support
25319 @@ -142,6 +143,9 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
25320  # CONFIG_BAMBOO is not set
25321  CONFIG_EBONY=y
25322  # CONFIG_SEQUOIA is not set
25323 +# CONFIG_TAISHAN is not set
25324 +# CONFIG_KATMAI is not set
25325 +# CONFIG_RAINIER is not set
25326  CONFIG_440GP=y
25327  # CONFIG_MPIC is not set
25328  # CONFIG_MPIC_WEIRD is not set
25329 Index: linux-2.6.24.7/arch/powerpc/configs/ep405_defconfig
25330 ===================================================================
25331 --- /dev/null
25332 +++ linux-2.6.24.7/arch/powerpc/configs/ep405_defconfig
25333 @@ -0,0 +1,952 @@
25334 +#
25335 +# Automatically generated make config: don't edit
25336 +# Linux kernel version: 2.6.24-rc6
25337 +# Mon Dec 24 11:17:13 2007
25338 +#
25339 +# CONFIG_PPC64 is not set
25340 +
25341 +#
25342 +# Processor support
25343 +#
25344 +# CONFIG_6xx is not set
25345 +# CONFIG_PPC_85xx is not set
25346 +# CONFIG_PPC_8xx is not set
25347 +CONFIG_40x=y
25348 +# CONFIG_44x is not set
25349 +# CONFIG_E200 is not set
25350 +CONFIG_4xx=y
25351 +# CONFIG_PPC_MM_SLICES is not set
25352 +CONFIG_NOT_COHERENT_CACHE=y
25353 +CONFIG_PPC32=y
25354 +CONFIG_WORD_SIZE=32
25355 +CONFIG_PPC_MERGE=y
25356 +CONFIG_MMU=y
25357 +CONFIG_GENERIC_CMOS_UPDATE=y
25358 +CONFIG_GENERIC_TIME=y
25359 +CONFIG_GENERIC_TIME_VSYSCALL=y
25360 +CONFIG_GENERIC_CLOCKEVENTS=y
25361 +CONFIG_GENERIC_HARDIRQS=y
25362 +CONFIG_IRQ_PER_CPU=y
25363 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
25364 +CONFIG_ARCH_HAS_ILOG2_U32=y
25365 +CONFIG_GENERIC_HWEIGHT=y
25366 +CONFIG_GENERIC_CALIBRATE_DELAY=y
25367 +CONFIG_GENERIC_FIND_NEXT_BIT=y
25368 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
25369 +CONFIG_PPC=y
25370 +CONFIG_EARLY_PRINTK=y
25371 +CONFIG_GENERIC_NVRAM=y
25372 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
25373 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
25374 +CONFIG_PPC_OF=y
25375 +CONFIG_OF=y
25376 +CONFIG_PPC_UDBG_16550=y
25377 +# CONFIG_GENERIC_TBSYNC is not set
25378 +CONFIG_AUDIT_ARCH=y
25379 +CONFIG_GENERIC_BUG=y
25380 +# CONFIG_DEFAULT_UIMAGE is not set
25381 +CONFIG_PPC_DCR_NATIVE=y
25382 +# CONFIG_PPC_DCR_MMIO is not set
25383 +CONFIG_PPC_DCR=y
25384 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25385 +
25386 +#
25387 +# General setup
25388 +#
25389 +CONFIG_EXPERIMENTAL=y
25390 +CONFIG_BROKEN_ON_SMP=y
25391 +CONFIG_INIT_ENV_ARG_LIMIT=32
25392 +CONFIG_LOCALVERSION=""
25393 +CONFIG_LOCALVERSION_AUTO=y
25394 +CONFIG_SWAP=y
25395 +CONFIG_SYSVIPC=y
25396 +CONFIG_SYSVIPC_SYSCTL=y
25397 +CONFIG_POSIX_MQUEUE=y
25398 +# CONFIG_BSD_PROCESS_ACCT is not set
25399 +# CONFIG_TASKSTATS is not set
25400 +# CONFIG_USER_NS is not set
25401 +# CONFIG_PID_NS is not set
25402 +# CONFIG_AUDIT is not set
25403 +# CONFIG_IKCONFIG is not set
25404 +CONFIG_LOG_BUF_SHIFT=14
25405 +# CONFIG_CGROUPS is not set
25406 +CONFIG_FAIR_GROUP_SCHED=y
25407 +CONFIG_FAIR_USER_SCHED=y
25408 +# CONFIG_FAIR_CGROUP_SCHED is not set
25409 +CONFIG_SYSFS_DEPRECATED=y
25410 +# CONFIG_RELAY is not set
25411 +CONFIG_BLK_DEV_INITRD=y
25412 +CONFIG_INITRAMFS_SOURCE=""
25413 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
25414 +CONFIG_SYSCTL=y
25415 +CONFIG_EMBEDDED=y
25416 +CONFIG_SYSCTL_SYSCALL=y
25417 +CONFIG_KALLSYMS=y
25418 +CONFIG_KALLSYMS_ALL=y
25419 +CONFIG_KALLSYMS_EXTRA_PASS=y
25420 +CONFIG_HOTPLUG=y
25421 +CONFIG_PRINTK=y
25422 +CONFIG_BUG=y
25423 +CONFIG_ELF_CORE=y
25424 +CONFIG_BASE_FULL=y
25425 +CONFIG_FUTEX=y
25426 +CONFIG_ANON_INODES=y
25427 +CONFIG_EPOLL=y
25428 +CONFIG_SIGNALFD=y
25429 +CONFIG_EVENTFD=y
25430 +CONFIG_SHMEM=y
25431 +CONFIG_VM_EVENT_COUNTERS=y
25432 +CONFIG_SLUB_DEBUG=y
25433 +# CONFIG_SLAB is not set
25434 +CONFIG_SLUB=y
25435 +# CONFIG_SLOB is not set
25436 +CONFIG_RT_MUTEXES=y
25437 +# CONFIG_TINY_SHMEM is not set
25438 +CONFIG_BASE_SMALL=0
25439 +CONFIG_MODULES=y
25440 +CONFIG_MODULE_UNLOAD=y
25441 +# CONFIG_MODULE_FORCE_UNLOAD is not set
25442 +# CONFIG_MODVERSIONS is not set
25443 +# CONFIG_MODULE_SRCVERSION_ALL is not set
25444 +CONFIG_KMOD=y
25445 +CONFIG_BLOCK=y
25446 +CONFIG_LBD=y
25447 +# CONFIG_BLK_DEV_IO_TRACE is not set
25448 +# CONFIG_LSF is not set
25449 +# CONFIG_BLK_DEV_BSG is not set
25450 +
25451 +#
25452 +# IO Schedulers
25453 +#
25454 +CONFIG_IOSCHED_NOOP=y
25455 +CONFIG_IOSCHED_AS=y
25456 +CONFIG_IOSCHED_DEADLINE=y
25457 +CONFIG_IOSCHED_CFQ=y
25458 +CONFIG_DEFAULT_AS=y
25459 +# CONFIG_DEFAULT_DEADLINE is not set
25460 +# CONFIG_DEFAULT_CFQ is not set
25461 +# CONFIG_DEFAULT_NOOP is not set
25462 +CONFIG_DEFAULT_IOSCHED="anticipatory"
25463 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
25464 +
25465 +#
25466 +# Platform support
25467 +#
25468 +# CONFIG_PPC_MPC52xx is not set
25469 +# CONFIG_PPC_MPC5200 is not set
25470 +# CONFIG_PPC_CELL is not set
25471 +# CONFIG_PPC_CELL_NATIVE is not set
25472 +# CONFIG_PQ2ADS is not set
25473 +CONFIG_EP405=y
25474 +# CONFIG_KILAUEA is not set
25475 +# CONFIG_MAKALU is not set
25476 +# CONFIG_WALNUT is not set
25477 +# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
25478 +CONFIG_405GP=y
25479 +CONFIG_IBM405_ERR77=y
25480 +CONFIG_IBM405_ERR51=y
25481 +# CONFIG_MPIC is not set
25482 +# CONFIG_MPIC_WEIRD is not set
25483 +# CONFIG_PPC_I8259 is not set
25484 +# CONFIG_PPC_RTAS is not set
25485 +# CONFIG_MMIO_NVRAM is not set
25486 +# CONFIG_PPC_MPC106 is not set
25487 +# CONFIG_PPC_970_NAP is not set
25488 +# CONFIG_PPC_INDIRECT_IO is not set
25489 +# CONFIG_GENERIC_IOMAP is not set
25490 +# CONFIG_CPU_FREQ is not set
25491 +# CONFIG_CPM2 is not set
25492 +# CONFIG_FSL_ULI1575 is not set
25493 +
25494 +#
25495 +# Kernel options
25496 +#
25497 +# CONFIG_HIGHMEM is not set
25498 +# CONFIG_TICK_ONESHOT is not set
25499 +# CONFIG_NO_HZ is not set
25500 +# CONFIG_HIGH_RES_TIMERS is not set
25501 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
25502 +# CONFIG_HZ_100 is not set
25503 +CONFIG_HZ_250=y
25504 +# CONFIG_HZ_300 is not set
25505 +# CONFIG_HZ_1000 is not set
25506 +CONFIG_HZ=250
25507 +CONFIG_PREEMPT_NONE=y
25508 +# CONFIG_PREEMPT_VOLUNTARY is not set
25509 +# CONFIG_PREEMPT is not set
25510 +CONFIG_BINFMT_ELF=y
25511 +# CONFIG_BINFMT_MISC is not set
25512 +# CONFIG_MATH_EMULATION is not set
25513 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
25514 +CONFIG_ARCH_FLATMEM_ENABLE=y
25515 +CONFIG_ARCH_POPULATES_NODE_MAP=y
25516 +CONFIG_SELECT_MEMORY_MODEL=y
25517 +CONFIG_FLATMEM_MANUAL=y
25518 +# CONFIG_DISCONTIGMEM_MANUAL is not set
25519 +# CONFIG_SPARSEMEM_MANUAL is not set
25520 +CONFIG_FLATMEM=y
25521 +CONFIG_FLAT_NODE_MEM_MAP=y
25522 +# CONFIG_SPARSEMEM_STATIC is not set
25523 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
25524 +CONFIG_SPLIT_PTLOCK_CPUS=4
25525 +# CONFIG_RESOURCES_64BIT is not set
25526 +CONFIG_ZONE_DMA_FLAG=1
25527 +CONFIG_BOUNCE=y
25528 +CONFIG_VIRT_TO_BUS=y
25529 +CONFIG_PROC_DEVICETREE=y
25530 +# CONFIG_CMDLINE_BOOL is not set
25531 +# CONFIG_PM is not set
25532 +CONFIG_SUSPEND_UP_POSSIBLE=y
25533 +CONFIG_HIBERNATION_UP_POSSIBLE=y
25534 +CONFIG_SECCOMP=y
25535 +CONFIG_WANT_DEVICE_TREE=y
25536 +CONFIG_DEVICE_TREE="ep405.dts"
25537 +CONFIG_ISA_DMA_API=y
25538 +
25539 +#
25540 +# Bus options
25541 +#
25542 +CONFIG_ZONE_DMA=y
25543 +CONFIG_PPC_INDIRECT_PCI=y
25544 +CONFIG_PCI=y
25545 +CONFIG_PCI_DOMAINS=y
25546 +CONFIG_PCI_SYSCALL=y
25547 +# CONFIG_PCIEPORTBUS is not set
25548 +CONFIG_ARCH_SUPPORTS_MSI=y
25549 +# CONFIG_PCI_MSI is not set
25550 +CONFIG_PCI_LEGACY=y
25551 +# CONFIG_PCI_DEBUG is not set
25552 +# CONFIG_PCCARD is not set
25553 +# CONFIG_HOTPLUG_PCI is not set
25554 +
25555 +#
25556 +# Advanced setup
25557 +#
25558 +# CONFIG_ADVANCED_OPTIONS is not set
25559 +
25560 +#
25561 +# Default settings for advanced configuration options are used
25562 +#
25563 +CONFIG_HIGHMEM_START=0xfe000000
25564 +CONFIG_LOWMEM_SIZE=0x30000000
25565 +CONFIG_KERNEL_START=0xc0000000
25566 +CONFIG_TASK_SIZE=0xc0000000
25567 +CONFIG_CONSISTENT_START=0xff100000
25568 +CONFIG_CONSISTENT_SIZE=0x00200000
25569 +CONFIG_BOOT_LOAD=0x00400000
25570 +
25571 +#
25572 +# Networking
25573 +#
25574 +CONFIG_NET=y
25575 +
25576 +#
25577 +# Networking options
25578 +#
25579 +CONFIG_PACKET=y
25580 +# CONFIG_PACKET_MMAP is not set
25581 +CONFIG_UNIX=y
25582 +# CONFIG_NET_KEY is not set
25583 +CONFIG_INET=y
25584 +# CONFIG_IP_MULTICAST is not set
25585 +# CONFIG_IP_ADVANCED_ROUTER is not set
25586 +CONFIG_IP_FIB_HASH=y
25587 +CONFIG_IP_PNP=y
25588 +CONFIG_IP_PNP_DHCP=y
25589 +CONFIG_IP_PNP_BOOTP=y
25590 +# CONFIG_IP_PNP_RARP is not set
25591 +# CONFIG_NET_IPIP is not set
25592 +# CONFIG_NET_IPGRE is not set
25593 +# CONFIG_ARPD is not set
25594 +# CONFIG_SYN_COOKIES is not set
25595 +# CONFIG_INET_AH is not set
25596 +# CONFIG_INET_ESP is not set
25597 +# CONFIG_INET_IPCOMP is not set
25598 +# CONFIG_INET_XFRM_TUNNEL is not set
25599 +# CONFIG_INET_TUNNEL is not set
25600 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
25601 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
25602 +# CONFIG_INET_XFRM_MODE_BEET is not set
25603 +# CONFIG_INET_LRO is not set
25604 +CONFIG_INET_DIAG=y
25605 +CONFIG_INET_TCP_DIAG=y
25606 +# CONFIG_TCP_CONG_ADVANCED is not set
25607 +CONFIG_TCP_CONG_CUBIC=y
25608 +CONFIG_DEFAULT_TCP_CONG="cubic"
25609 +# CONFIG_TCP_MD5SIG is not set
25610 +# CONFIG_IPV6 is not set
25611 +# CONFIG_INET6_XFRM_TUNNEL is not set
25612 +# CONFIG_INET6_TUNNEL is not set
25613 +# CONFIG_NETWORK_SECMARK is not set
25614 +# CONFIG_NETFILTER is not set
25615 +# CONFIG_IP_DCCP is not set
25616 +# CONFIG_IP_SCTP is not set
25617 +# CONFIG_TIPC is not set
25618 +# CONFIG_ATM is not set
25619 +# CONFIG_BRIDGE is not set
25620 +# CONFIG_VLAN_8021Q is not set
25621 +# CONFIG_DECNET is not set
25622 +# CONFIG_LLC2 is not set
25623 +# CONFIG_IPX is not set
25624 +# CONFIG_ATALK is not set
25625 +# CONFIG_X25 is not set
25626 +# CONFIG_LAPB is not set
25627 +# CONFIG_ECONET is not set
25628 +# CONFIG_WAN_ROUTER is not set
25629 +# CONFIG_NET_SCHED is not set
25630 +
25631 +#
25632 +# Network testing
25633 +#
25634 +# CONFIG_NET_PKTGEN is not set
25635 +# CONFIG_HAMRADIO is not set
25636 +# CONFIG_IRDA is not set
25637 +# CONFIG_BT is not set
25638 +# CONFIG_AF_RXRPC is not set
25639 +
25640 +#
25641 +# Wireless
25642 +#
25643 +# CONFIG_CFG80211 is not set
25644 +# CONFIG_WIRELESS_EXT is not set
25645 +# CONFIG_MAC80211 is not set
25646 +# CONFIG_IEEE80211 is not set
25647 +# CONFIG_RFKILL is not set
25648 +# CONFIG_NET_9P is not set
25649 +
25650 +#
25651 +# Device Drivers
25652 +#
25653 +
25654 +#
25655 +# Generic Driver Options
25656 +#
25657 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
25658 +CONFIG_STANDALONE=y
25659 +CONFIG_PREVENT_FIRMWARE_BUILD=y
25660 +CONFIG_FW_LOADER=y
25661 +# CONFIG_DEBUG_DRIVER is not set
25662 +# CONFIG_DEBUG_DEVRES is not set
25663 +# CONFIG_SYS_HYPERVISOR is not set
25664 +CONFIG_CONNECTOR=y
25665 +CONFIG_PROC_EVENTS=y
25666 +CONFIG_MTD=y
25667 +# CONFIG_MTD_DEBUG is not set
25668 +# CONFIG_MTD_CONCAT is not set
25669 +CONFIG_MTD_PARTITIONS=y
25670 +# CONFIG_MTD_REDBOOT_PARTS is not set
25671 +CONFIG_MTD_CMDLINE_PARTS=y
25672 +
25673 +#
25674 +# User Modules And Translation Layers
25675 +#
25676 +CONFIG_MTD_CHAR=y
25677 +CONFIG_MTD_BLKDEVS=m
25678 +CONFIG_MTD_BLOCK=m
25679 +# CONFIG_MTD_BLOCK_RO is not set
25680 +# CONFIG_FTL is not set
25681 +# CONFIG_NFTL is not set
25682 +# CONFIG_INFTL is not set
25683 +# CONFIG_RFD_FTL is not set
25684 +# CONFIG_SSFDC is not set
25685 +# CONFIG_MTD_OOPS is not set
25686 +
25687 +#
25688 +# RAM/ROM/Flash chip drivers
25689 +#
25690 +CONFIG_MTD_CFI=y
25691 +CONFIG_MTD_JEDECPROBE=y
25692 +CONFIG_MTD_GEN_PROBE=y
25693 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
25694 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
25695 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
25696 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
25697 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
25698 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
25699 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
25700 +CONFIG_MTD_CFI_I1=y
25701 +CONFIG_MTD_CFI_I2=y
25702 +# CONFIG_MTD_CFI_I4 is not set
25703 +# CONFIG_MTD_CFI_I8 is not set
25704 +# CONFIG_MTD_CFI_INTELEXT is not set
25705 +CONFIG_MTD_CFI_AMDSTD=y
25706 +# CONFIG_MTD_CFI_STAA is not set
25707 +CONFIG_MTD_CFI_UTIL=y
25708 +# CONFIG_MTD_RAM is not set
25709 +# CONFIG_MTD_ROM is not set
25710 +# CONFIG_MTD_ABSENT is not set
25711 +
25712 +#
25713 +# Mapping drivers for chip access
25714 +#
25715 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
25716 +# CONFIG_MTD_PHYSMAP is not set
25717 +CONFIG_MTD_PHYSMAP_OF=y
25718 +# CONFIG_MTD_INTEL_VR_NOR is not set
25719 +# CONFIG_MTD_PLATRAM is not set
25720 +
25721 +#
25722 +# Self-contained MTD device drivers
25723 +#
25724 +# CONFIG_MTD_PMC551 is not set
25725 +# CONFIG_MTD_SLRAM is not set
25726 +# CONFIG_MTD_PHRAM is not set
25727 +# CONFIG_MTD_MTDRAM is not set
25728 +# CONFIG_MTD_BLOCK2MTD is not set
25729 +
25730 +#
25731 +# Disk-On-Chip Device Drivers
25732 +#
25733 +# CONFIG_MTD_DOC2000 is not set
25734 +# CONFIG_MTD_DOC2001 is not set
25735 +# CONFIG_MTD_DOC2001PLUS is not set
25736 +# CONFIG_MTD_NAND is not set
25737 +# CONFIG_MTD_ONENAND is not set
25738 +
25739 +#
25740 +# UBI - Unsorted block images
25741 +#
25742 +# CONFIG_MTD_UBI is not set
25743 +CONFIG_OF_DEVICE=y
25744 +# CONFIG_PARPORT is not set
25745 +CONFIG_BLK_DEV=y
25746 +# CONFIG_BLK_DEV_FD is not set
25747 +# CONFIG_BLK_CPQ_DA is not set
25748 +# CONFIG_BLK_CPQ_CISS_DA is not set
25749 +# CONFIG_BLK_DEV_DAC960 is not set
25750 +# CONFIG_BLK_DEV_UMEM is not set
25751 +# CONFIG_BLK_DEV_COW_COMMON is not set
25752 +# CONFIG_BLK_DEV_LOOP is not set
25753 +# CONFIG_BLK_DEV_NBD is not set
25754 +# CONFIG_BLK_DEV_SX8 is not set
25755 +# CONFIG_BLK_DEV_UB is not set
25756 +CONFIG_BLK_DEV_RAM=y
25757 +CONFIG_BLK_DEV_RAM_COUNT=16
25758 +CONFIG_BLK_DEV_RAM_SIZE=35000
25759 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
25760 +# CONFIG_CDROM_PKTCDVD is not set
25761 +# CONFIG_ATA_OVER_ETH is not set
25762 +# CONFIG_XILINX_SYSACE is not set
25763 +CONFIG_MISC_DEVICES=y
25764 +# CONFIG_PHANTOM is not set
25765 +# CONFIG_EEPROM_93CX6 is not set
25766 +# CONFIG_SGI_IOC4 is not set
25767 +# CONFIG_TIFM_CORE is not set
25768 +# CONFIG_IDE is not set
25769 +
25770 +#
25771 +# SCSI device support
25772 +#
25773 +# CONFIG_RAID_ATTRS is not set
25774 +# CONFIG_SCSI is not set
25775 +# CONFIG_SCSI_DMA is not set
25776 +# CONFIG_SCSI_NETLINK is not set
25777 +# CONFIG_ATA is not set
25778 +# CONFIG_MD is not set
25779 +# CONFIG_FUSION is not set
25780 +
25781 +#
25782 +# IEEE 1394 (FireWire) support
25783 +#
25784 +# CONFIG_FIREWIRE is not set
25785 +# CONFIG_IEEE1394 is not set
25786 +# CONFIG_I2O is not set
25787 +# CONFIG_MACINTOSH_DRIVERS is not set
25788 +CONFIG_NETDEVICES=y
25789 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
25790 +# CONFIG_DUMMY is not set
25791 +# CONFIG_BONDING is not set
25792 +# CONFIG_MACVLAN is not set
25793 +# CONFIG_EQUALIZER is not set
25794 +# CONFIG_TUN is not set
25795 +# CONFIG_VETH is not set
25796 +# CONFIG_IP1000 is not set
25797 +# CONFIG_ARCNET is not set
25798 +# CONFIG_PHYLIB is not set
25799 +CONFIG_NET_ETHERNET=y
25800 +# CONFIG_MII is not set
25801 +# CONFIG_HAPPYMEAL is not set
25802 +# CONFIG_SUNGEM is not set
25803 +# CONFIG_CASSINI is not set
25804 +# CONFIG_NET_VENDOR_3COM is not set
25805 +# CONFIG_NET_TULIP is not set
25806 +# CONFIG_HP100 is not set
25807 +CONFIG_IBM_NEW_EMAC=y
25808 +CONFIG_IBM_NEW_EMAC_RXB=128
25809 +CONFIG_IBM_NEW_EMAC_TXB=64
25810 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
25811 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
25812 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
25813 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
25814 +CONFIG_IBM_NEW_EMAC_ZMII=y
25815 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
25816 +# CONFIG_IBM_NEW_EMAC_TAH is not set
25817 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
25818 +# CONFIG_NET_PCI is not set
25819 +# CONFIG_B44 is not set
25820 +CONFIG_NETDEV_1000=y
25821 +# CONFIG_ACENIC is not set
25822 +# CONFIG_DL2K is not set
25823 +# CONFIG_E1000 is not set
25824 +# CONFIG_E1000E is not set
25825 +# CONFIG_NS83820 is not set
25826 +# CONFIG_HAMACHI is not set
25827 +# CONFIG_YELLOWFIN is not set
25828 +# CONFIG_R8169 is not set
25829 +# CONFIG_SIS190 is not set
25830 +# CONFIG_SKGE is not set
25831 +# CONFIG_SKY2 is not set
25832 +# CONFIG_SK98LIN is not set
25833 +# CONFIG_VIA_VELOCITY is not set
25834 +# CONFIG_TIGON3 is not set
25835 +# CONFIG_BNX2 is not set
25836 +# CONFIG_QLA3XXX is not set
25837 +# CONFIG_ATL1 is not set
25838 +CONFIG_NETDEV_10000=y
25839 +# CONFIG_CHELSIO_T1 is not set
25840 +# CONFIG_CHELSIO_T3 is not set
25841 +# CONFIG_IXGBE is not set
25842 +# CONFIG_IXGB is not set
25843 +# CONFIG_S2IO is not set
25844 +# CONFIG_MYRI10GE is not set
25845 +# CONFIG_NETXEN_NIC is not set
25846 +# CONFIG_NIU is not set
25847 +# CONFIG_MLX4_CORE is not set
25848 +# CONFIG_TEHUTI is not set
25849 +# CONFIG_TR is not set
25850 +
25851 +#
25852 +# Wireless LAN
25853 +#
25854 +# CONFIG_WLAN_PRE80211 is not set
25855 +# CONFIG_WLAN_80211 is not set
25856 +
25857 +#
25858 +# USB Network Adapters
25859 +#
25860 +# CONFIG_USB_CATC is not set
25861 +# CONFIG_USB_KAWETH is not set
25862 +# CONFIG_USB_PEGASUS is not set
25863 +# CONFIG_USB_RTL8150 is not set
25864 +# CONFIG_USB_USBNET is not set
25865 +# CONFIG_WAN is not set
25866 +# CONFIG_FDDI is not set
25867 +# CONFIG_HIPPI is not set
25868 +# CONFIG_PPP is not set
25869 +# CONFIG_SLIP is not set
25870 +# CONFIG_SHAPER is not set
25871 +# CONFIG_NETCONSOLE is not set
25872 +# CONFIG_NETPOLL is not set
25873 +# CONFIG_NET_POLL_CONTROLLER is not set
25874 +# CONFIG_ISDN is not set
25875 +# CONFIG_PHONE is not set
25876 +
25877 +#
25878 +# Input device support
25879 +#
25880 +# CONFIG_INPUT is not set
25881 +
25882 +#
25883 +# Hardware I/O ports
25884 +#
25885 +# CONFIG_SERIO is not set
25886 +# CONFIG_GAMEPORT is not set
25887 +
25888 +#
25889 +# Character devices
25890 +#
25891 +# CONFIG_VT is not set
25892 +# CONFIG_SERIAL_NONSTANDARD is not set
25893 +
25894 +#
25895 +# Serial drivers
25896 +#
25897 +CONFIG_SERIAL_8250=y
25898 +CONFIG_SERIAL_8250_CONSOLE=y
25899 +CONFIG_SERIAL_8250_PCI=y
25900 +CONFIG_SERIAL_8250_NR_UARTS=4
25901 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
25902 +CONFIG_SERIAL_8250_EXTENDED=y
25903 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
25904 +CONFIG_SERIAL_8250_SHARE_IRQ=y
25905 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
25906 +# CONFIG_SERIAL_8250_RSA is not set
25907 +
25908 +#
25909 +# Non-8250 serial port support
25910 +#
25911 +# CONFIG_SERIAL_UARTLITE is not set
25912 +CONFIG_SERIAL_CORE=y
25913 +CONFIG_SERIAL_CORE_CONSOLE=y
25914 +# CONFIG_SERIAL_JSM is not set
25915 +CONFIG_SERIAL_OF_PLATFORM=y
25916 +CONFIG_UNIX98_PTYS=y
25917 +CONFIG_LEGACY_PTYS=y
25918 +CONFIG_LEGACY_PTY_COUNT=256
25919 +# CONFIG_IPMI_HANDLER is not set
25920 +# CONFIG_HW_RANDOM is not set
25921 +# CONFIG_NVRAM is not set
25922 +# CONFIG_GEN_RTC is not set
25923 +# CONFIG_R3964 is not set
25924 +# CONFIG_APPLICOM is not set
25925 +# CONFIG_RAW_DRIVER is not set
25926 +# CONFIG_TCG_TPM is not set
25927 +CONFIG_DEVPORT=y
25928 +# CONFIG_I2C is not set
25929 +
25930 +#
25931 +# SPI support
25932 +#
25933 +# CONFIG_SPI is not set
25934 +# CONFIG_SPI_MASTER is not set
25935 +# CONFIG_W1 is not set
25936 +# CONFIG_POWER_SUPPLY is not set
25937 +# CONFIG_HWMON is not set
25938 +# CONFIG_WATCHDOG is not set
25939 +
25940 +#
25941 +# Sonics Silicon Backplane
25942 +#
25943 +CONFIG_SSB_POSSIBLE=y
25944 +# CONFIG_SSB is not set
25945 +
25946 +#
25947 +# Multifunction device drivers
25948 +#
25949 +# CONFIG_MFD_SM501 is not set
25950 +
25951 +#
25952 +# Multimedia devices
25953 +#
25954 +# CONFIG_VIDEO_DEV is not set
25955 +# CONFIG_DVB_CORE is not set
25956 +# CONFIG_DAB is not set
25957 +
25958 +#
25959 +# Graphics support
25960 +#
25961 +# CONFIG_AGP is not set
25962 +# CONFIG_DRM is not set
25963 +# CONFIG_VGASTATE is not set
25964 +CONFIG_VIDEO_OUTPUT_CONTROL=m
25965 +# CONFIG_FB is not set
25966 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
25967 +
25968 +#
25969 +# Display device support
25970 +#
25971 +# CONFIG_DISPLAY_SUPPORT is not set
25972 +
25973 +#
25974 +# Sound
25975 +#
25976 +# CONFIG_SOUND is not set
25977 +CONFIG_USB_SUPPORT=y
25978 +CONFIG_USB_ARCH_HAS_HCD=y
25979 +CONFIG_USB_ARCH_HAS_OHCI=y
25980 +CONFIG_USB_ARCH_HAS_EHCI=y
25981 +CONFIG_USB=y
25982 +# CONFIG_USB_DEBUG is not set
25983 +
25984 +#
25985 +# Miscellaneous USB options
25986 +#
25987 +CONFIG_USB_DEVICEFS=y
25988 +CONFIG_USB_DEVICE_CLASS=y
25989 +# CONFIG_USB_DYNAMIC_MINORS is not set
25990 +# CONFIG_USB_OTG is not set
25991 +
25992 +#
25993 +# USB Host Controller Drivers
25994 +#
25995 +# CONFIG_USB_EHCI_HCD is not set
25996 +# CONFIG_USB_ISP116X_HCD is not set
25997 +CONFIG_USB_OHCI_HCD=y
25998 +CONFIG_USB_OHCI_HCD_PPC_OF=y
25999 +CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
26000 +CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
26001 +CONFIG_USB_OHCI_HCD_PCI=y
26002 +CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
26003 +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
26004 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
26005 +# CONFIG_USB_UHCI_HCD is not set
26006 +# CONFIG_USB_SL811_HCD is not set
26007 +# CONFIG_USB_R8A66597_HCD is not set
26008 +
26009 +#
26010 +# USB Device Class drivers
26011 +#
26012 +# CONFIG_USB_ACM is not set
26013 +# CONFIG_USB_PRINTER is not set
26014 +
26015 +#
26016 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
26017 +#
26018 +
26019 +#
26020 +# may also be needed; see USB_STORAGE Help for more information
26021 +#
26022 +# CONFIG_USB_LIBUSUAL is not set
26023 +
26024 +#
26025 +# USB Imaging devices
26026 +#
26027 +# CONFIG_USB_MDC800 is not set
26028 +CONFIG_USB_MON=y
26029 +
26030 +#
26031 +# USB port drivers
26032 +#
26033 +
26034 +#
26035 +# USB Serial Converter support
26036 +#
26037 +# CONFIG_USB_SERIAL is not set
26038 +
26039 +#
26040 +# USB Miscellaneous drivers
26041 +#
26042 +# CONFIG_USB_EMI62 is not set
26043 +# CONFIG_USB_EMI26 is not set
26044 +# CONFIG_USB_ADUTUX is not set
26045 +# CONFIG_USB_AUERSWALD is not set
26046 +# CONFIG_USB_RIO500 is not set
26047 +# CONFIG_USB_LEGOTOWER is not set
26048 +# CONFIG_USB_LCD is not set
26049 +# CONFIG_USB_BERRY_CHARGE is not set
26050 +# CONFIG_USB_LED is not set
26051 +# CONFIG_USB_CYPRESS_CY7C63 is not set
26052 +# CONFIG_USB_CYTHERM is not set
26053 +# CONFIG_USB_PHIDGET is not set
26054 +# CONFIG_USB_IDMOUSE is not set
26055 +# CONFIG_USB_FTDI_ELAN is not set
26056 +# CONFIG_USB_APPLEDISPLAY is not set
26057 +# CONFIG_USB_LD is not set
26058 +# CONFIG_USB_TRANCEVIBRATOR is not set
26059 +# CONFIG_USB_IOWARRIOR is not set
26060 +# CONFIG_USB_TEST is not set
26061 +
26062 +#
26063 +# USB DSL modem support
26064 +#
26065 +
26066 +#
26067 +# USB Gadget Support
26068 +#
26069 +# CONFIG_USB_GADGET is not set
26070 +# CONFIG_MMC is not set
26071 +# CONFIG_NEW_LEDS is not set
26072 +# CONFIG_INFINIBAND is not set
26073 +# CONFIG_EDAC is not set
26074 +# CONFIG_RTC_CLASS is not set
26075 +
26076 +#
26077 +# Userspace I/O
26078 +#
26079 +# CONFIG_UIO is not set
26080 +
26081 +#
26082 +# File systems
26083 +#
26084 +CONFIG_EXT2_FS=y
26085 +# CONFIG_EXT2_FS_XATTR is not set
26086 +# CONFIG_EXT2_FS_XIP is not set
26087 +# CONFIG_EXT3_FS is not set
26088 +# CONFIG_EXT4DEV_FS is not set
26089 +# CONFIG_REISERFS_FS is not set
26090 +# CONFIG_JFS_FS is not set
26091 +# CONFIG_FS_POSIX_ACL is not set
26092 +# CONFIG_XFS_FS is not set
26093 +# CONFIG_GFS2_FS is not set
26094 +# CONFIG_OCFS2_FS is not set
26095 +# CONFIG_MINIX_FS is not set
26096 +# CONFIG_ROMFS_FS is not set
26097 +CONFIG_INOTIFY=y
26098 +CONFIG_INOTIFY_USER=y
26099 +# CONFIG_QUOTA is not set
26100 +CONFIG_DNOTIFY=y
26101 +# CONFIG_AUTOFS_FS is not set
26102 +# CONFIG_AUTOFS4_FS is not set
26103 +# CONFIG_FUSE_FS is not set
26104 +
26105 +#
26106 +# CD-ROM/DVD Filesystems
26107 +#
26108 +# CONFIG_ISO9660_FS is not set
26109 +# CONFIG_UDF_FS is not set
26110 +
26111 +#
26112 +# DOS/FAT/NT Filesystems
26113 +#
26114 +# CONFIG_MSDOS_FS is not set
26115 +# CONFIG_VFAT_FS is not set
26116 +# CONFIG_NTFS_FS is not set
26117 +
26118 +#
26119 +# Pseudo filesystems
26120 +#
26121 +CONFIG_PROC_FS=y
26122 +CONFIG_PROC_KCORE=y
26123 +CONFIG_PROC_SYSCTL=y
26124 +CONFIG_SYSFS=y
26125 +CONFIG_TMPFS=y
26126 +# CONFIG_TMPFS_POSIX_ACL is not set
26127 +# CONFIG_HUGETLB_PAGE is not set
26128 +# CONFIG_CONFIGFS_FS is not set
26129 +
26130 +#
26131 +# Miscellaneous filesystems
26132 +#
26133 +# CONFIG_ADFS_FS is not set
26134 +# CONFIG_AFFS_FS is not set
26135 +# CONFIG_HFS_FS is not set
26136 +# CONFIG_HFSPLUS_FS is not set
26137 +# CONFIG_BEFS_FS is not set
26138 +# CONFIG_BFS_FS is not set
26139 +# CONFIG_EFS_FS is not set
26140 +# CONFIG_JFFS2_FS is not set
26141 +CONFIG_CRAMFS=y
26142 +# CONFIG_VXFS_FS is not set
26143 +# CONFIG_HPFS_FS is not set
26144 +# CONFIG_QNX4FS_FS is not set
26145 +# CONFIG_SYSV_FS is not set
26146 +# CONFIG_UFS_FS is not set
26147 +CONFIG_NETWORK_FILESYSTEMS=y
26148 +CONFIG_NFS_FS=y
26149 +CONFIG_NFS_V3=y
26150 +# CONFIG_NFS_V3_ACL is not set
26151 +# CONFIG_NFS_V4 is not set
26152 +# CONFIG_NFS_DIRECTIO is not set
26153 +# CONFIG_NFSD is not set
26154 +CONFIG_ROOT_NFS=y
26155 +CONFIG_LOCKD=y
26156 +CONFIG_LOCKD_V4=y
26157 +CONFIG_NFS_COMMON=y
26158 +CONFIG_SUNRPC=y
26159 +# CONFIG_SUNRPC_BIND34 is not set
26160 +# CONFIG_RPCSEC_GSS_KRB5 is not set
26161 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
26162 +# CONFIG_SMB_FS is not set
26163 +# CONFIG_CIFS is not set
26164 +# CONFIG_NCP_FS is not set
26165 +# CONFIG_CODA_FS is not set
26166 +# CONFIG_AFS_FS is not set
26167 +
26168 +#
26169 +# Partition Types
26170 +#
26171 +# CONFIG_PARTITION_ADVANCED is not set
26172 +CONFIG_MSDOS_PARTITION=y
26173 +# CONFIG_NLS is not set
26174 +# CONFIG_DLM is not set
26175 +# CONFIG_UCC_SLOW is not set
26176 +
26177 +#
26178 +# Library routines
26179 +#
26180 +CONFIG_BITREVERSE=y
26181 +# CONFIG_CRC_CCITT is not set
26182 +# CONFIG_CRC16 is not set
26183 +# CONFIG_CRC_ITU_T is not set
26184 +CONFIG_CRC32=y
26185 +# CONFIG_CRC7 is not set
26186 +# CONFIG_LIBCRC32C is not set
26187 +CONFIG_ZLIB_INFLATE=y
26188 +CONFIG_PLIST=y
26189 +CONFIG_HAS_IOMEM=y
26190 +CONFIG_HAS_IOPORT=y
26191 +CONFIG_HAS_DMA=y
26192 +CONFIG_INSTRUMENTATION=y
26193 +# CONFIG_PROFILING is not set
26194 +# CONFIG_KPROBES is not set
26195 +# CONFIG_MARKERS is not set
26196 +
26197 +#
26198 +# Kernel hacking
26199 +#
26200 +# CONFIG_PRINTK_TIME is not set
26201 +CONFIG_ENABLE_WARN_DEPRECATED=y
26202 +CONFIG_ENABLE_MUST_CHECK=y
26203 +CONFIG_MAGIC_SYSRQ=y
26204 +# CONFIG_UNUSED_SYMBOLS is not set
26205 +# CONFIG_DEBUG_FS is not set
26206 +# CONFIG_HEADERS_CHECK is not set
26207 +CONFIG_DEBUG_KERNEL=y
26208 +# CONFIG_DEBUG_SHIRQ is not set
26209 +CONFIG_DETECT_SOFTLOCKUP=y
26210 +CONFIG_SCHED_DEBUG=y
26211 +# CONFIG_SCHEDSTATS is not set
26212 +# CONFIG_TIMER_STATS is not set
26213 +# CONFIG_SLUB_DEBUG_ON is not set
26214 +# CONFIG_DEBUG_RT_MUTEXES is not set
26215 +# CONFIG_RT_MUTEX_TESTER is not set
26216 +# CONFIG_DEBUG_SPINLOCK is not set
26217 +# CONFIG_DEBUG_MUTEXES is not set
26218 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
26219 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
26220 +# CONFIG_DEBUG_KOBJECT is not set
26221 +CONFIG_DEBUG_BUGVERBOSE=y
26222 +# CONFIG_DEBUG_INFO is not set
26223 +# CONFIG_DEBUG_VM is not set
26224 +# CONFIG_DEBUG_LIST is not set
26225 +# CONFIG_DEBUG_SG is not set
26226 +CONFIG_FORCED_INLINING=y
26227 +# CONFIG_BOOT_PRINTK_DELAY is not set
26228 +# CONFIG_RCU_TORTURE_TEST is not set
26229 +# CONFIG_FAULT_INJECTION is not set
26230 +# CONFIG_SAMPLES is not set
26231 +# CONFIG_DEBUG_STACKOVERFLOW is not set
26232 +# CONFIG_DEBUG_STACK_USAGE is not set
26233 +# CONFIG_DEBUG_PAGEALLOC is not set
26234 +# CONFIG_DEBUGGER is not set
26235 +# CONFIG_BDI_SWITCH is not set
26236 +# CONFIG_PPC_EARLY_DEBUG is not set
26237 +
26238 +#
26239 +# Security options
26240 +#
26241 +# CONFIG_KEYS is not set
26242 +# CONFIG_SECURITY is not set
26243 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
26244 +CONFIG_CRYPTO=y
26245 +CONFIG_CRYPTO_ALGAPI=y
26246 +CONFIG_CRYPTO_BLKCIPHER=y
26247 +CONFIG_CRYPTO_MANAGER=y
26248 +# CONFIG_CRYPTO_HMAC is not set
26249 +# CONFIG_CRYPTO_XCBC is not set
26250 +# CONFIG_CRYPTO_NULL is not set
26251 +# CONFIG_CRYPTO_MD4 is not set
26252 +CONFIG_CRYPTO_MD5=y
26253 +# CONFIG_CRYPTO_SHA1 is not set
26254 +# CONFIG_CRYPTO_SHA256 is not set
26255 +# CONFIG_CRYPTO_SHA512 is not set
26256 +# CONFIG_CRYPTO_WP512 is not set
26257 +# CONFIG_CRYPTO_TGR192 is not set
26258 +# CONFIG_CRYPTO_GF128MUL is not set
26259 +CONFIG_CRYPTO_ECB=y
26260 +CONFIG_CRYPTO_CBC=y
26261 +CONFIG_CRYPTO_PCBC=y
26262 +# CONFIG_CRYPTO_LRW is not set
26263 +# CONFIG_CRYPTO_XTS is not set
26264 +# CONFIG_CRYPTO_CRYPTD is not set
26265 +CONFIG_CRYPTO_DES=y
26266 +# CONFIG_CRYPTO_FCRYPT is not set
26267 +# CONFIG_CRYPTO_BLOWFISH is not set
26268 +# CONFIG_CRYPTO_TWOFISH is not set
26269 +# CONFIG_CRYPTO_SERPENT is not set
26270 +# CONFIG_CRYPTO_AES is not set
26271 +# CONFIG_CRYPTO_CAST5 is not set
26272 +# CONFIG_CRYPTO_CAST6 is not set
26273 +# CONFIG_CRYPTO_TEA is not set
26274 +# CONFIG_CRYPTO_ARC4 is not set
26275 +# CONFIG_CRYPTO_KHAZAD is not set
26276 +# CONFIG_CRYPTO_ANUBIS is not set
26277 +# CONFIG_CRYPTO_SEED is not set
26278 +# CONFIG_CRYPTO_DEFLATE is not set
26279 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
26280 +# CONFIG_CRYPTO_CRC32C is not set
26281 +# CONFIG_CRYPTO_CAMELLIA is not set
26282 +# CONFIG_CRYPTO_TEST is not set
26283 +# CONFIG_CRYPTO_AUTHENC is not set
26284 +CONFIG_CRYPTO_HW=y
26285 +# CONFIG_PPC_CLOCK is not set
26286 Index: linux-2.6.24.7/arch/powerpc/configs/ep8248e_defconfig
26287 ===================================================================
26288 --- /dev/null
26289 +++ linux-2.6.24.7/arch/powerpc/configs/ep8248e_defconfig
26290 @@ -0,0 +1,821 @@
26291 +#
26292 +# Automatically generated make config: don't edit
26293 +# Linux kernel version: 2.6.24-rc6
26294 +# Fri Jan 11 14:02:06 2008
26295 +#
26296 +# CONFIG_PPC64 is not set
26297 +
26298 +#
26299 +# Processor support
26300 +#
26301 +CONFIG_6xx=y
26302 +# CONFIG_PPC_85xx is not set
26303 +# CONFIG_PPC_8xx is not set
26304 +# CONFIG_40x is not set
26305 +# CONFIG_44x is not set
26306 +# CONFIG_E200 is not set
26307 +CONFIG_PPC_FPU=y
26308 +CONFIG_PPC_STD_MMU=y
26309 +CONFIG_PPC_STD_MMU_32=y
26310 +# CONFIG_PPC_MM_SLICES is not set
26311 +# CONFIG_SMP is not set
26312 +CONFIG_PPC32=y
26313 +CONFIG_WORD_SIZE=32
26314 +CONFIG_PPC_MERGE=y
26315 +CONFIG_MMU=y
26316 +CONFIG_GENERIC_CMOS_UPDATE=y
26317 +CONFIG_GENERIC_TIME=y
26318 +CONFIG_GENERIC_TIME_VSYSCALL=y
26319 +CONFIG_GENERIC_CLOCKEVENTS=y
26320 +CONFIG_GENERIC_HARDIRQS=y
26321 +CONFIG_IRQ_PER_CPU=y
26322 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
26323 +CONFIG_ARCH_HAS_ILOG2_U32=y
26324 +CONFIG_GENERIC_HWEIGHT=y
26325 +CONFIG_GENERIC_CALIBRATE_DELAY=y
26326 +CONFIG_GENERIC_FIND_NEXT_BIT=y
26327 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
26328 +CONFIG_PPC=y
26329 +CONFIG_EARLY_PRINTK=y
26330 +CONFIG_GENERIC_NVRAM=y
26331 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
26332 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
26333 +CONFIG_PPC_OF=y
26334 +CONFIG_OF=y
26335 +# CONFIG_PPC_UDBG_16550 is not set
26336 +# CONFIG_GENERIC_TBSYNC is not set
26337 +CONFIG_AUDIT_ARCH=y
26338 +CONFIG_GENERIC_BUG=y
26339 +# CONFIG_DEFAULT_UIMAGE is not set
26340 +# CONFIG_PPC_DCR_NATIVE is not set
26341 +# CONFIG_PPC_DCR_MMIO is not set
26342 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26343 +
26344 +#
26345 +# General setup
26346 +#
26347 +# CONFIG_EXPERIMENTAL is not set
26348 +CONFIG_BROKEN_ON_SMP=y
26349 +CONFIG_INIT_ENV_ARG_LIMIT=32
26350 +CONFIG_LOCALVERSION=""
26351 +CONFIG_LOCALVERSION_AUTO=y
26352 +CONFIG_SWAP=y
26353 +CONFIG_SYSVIPC=y
26354 +CONFIG_SYSVIPC_SYSCTL=y
26355 +# CONFIG_BSD_PROCESS_ACCT is not set
26356 +# CONFIG_TASKSTATS is not set
26357 +# CONFIG_AUDIT is not set
26358 +CONFIG_IKCONFIG=y
26359 +CONFIG_IKCONFIG_PROC=y
26360 +CONFIG_LOG_BUF_SHIFT=14
26361 +# CONFIG_CGROUPS is not set
26362 +CONFIG_FAIR_GROUP_SCHED=y
26363 +CONFIG_FAIR_USER_SCHED=y
26364 +# CONFIG_FAIR_CGROUP_SCHED is not set
26365 +CONFIG_SYSFS_DEPRECATED=y
26366 +# CONFIG_RELAY is not set
26367 +# CONFIG_BLK_DEV_INITRD is not set
26368 +CONFIG_SYSCTL=y
26369 +CONFIG_EMBEDDED=y
26370 +CONFIG_SYSCTL_SYSCALL=y
26371 +CONFIG_KALLSYMS=y
26372 +CONFIG_KALLSYMS_ALL=y
26373 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
26374 +CONFIG_HOTPLUG=y
26375 +CONFIG_PRINTK=y
26376 +CONFIG_BUG=y
26377 +CONFIG_ELF_CORE=y
26378 +CONFIG_BASE_FULL=y
26379 +CONFIG_FUTEX=y
26380 +CONFIG_ANON_INODES=y
26381 +CONFIG_EPOLL=y
26382 +CONFIG_SIGNALFD=y
26383 +CONFIG_EVENTFD=y
26384 +CONFIG_SHMEM=y
26385 +CONFIG_VM_EVENT_COUNTERS=y
26386 +CONFIG_SLAB=y
26387 +# CONFIG_SLUB is not set
26388 +# CONFIG_SLOB is not set
26389 +CONFIG_RT_MUTEXES=y
26390 +# CONFIG_TINY_SHMEM is not set
26391 +CONFIG_BASE_SMALL=0
26392 +# CONFIG_MODULES is not set
26393 +CONFIG_BLOCK=y
26394 +# CONFIG_LBD is not set
26395 +# CONFIG_BLK_DEV_IO_TRACE is not set
26396 +# CONFIG_LSF is not set
26397 +
26398 +#
26399 +# IO Schedulers
26400 +#
26401 +CONFIG_IOSCHED_NOOP=y
26402 +# CONFIG_IOSCHED_AS is not set
26403 +CONFIG_IOSCHED_DEADLINE=y
26404 +# CONFIG_IOSCHED_CFQ is not set
26405 +# CONFIG_DEFAULT_AS is not set
26406 +CONFIG_DEFAULT_DEADLINE=y
26407 +# CONFIG_DEFAULT_CFQ is not set
26408 +# CONFIG_DEFAULT_NOOP is not set
26409 +CONFIG_DEFAULT_IOSCHED="deadline"
26410 +
26411 +#
26412 +# Platform support
26413 +#
26414 +# CONFIG_PPC_MULTIPLATFORM is not set
26415 +CONFIG_PPC_82xx=y
26416 +# CONFIG_PPC_83xx is not set
26417 +# CONFIG_PPC_86xx is not set
26418 +# CONFIG_PPC_MPC52xx is not set
26419 +# CONFIG_PPC_MPC5200 is not set
26420 +# CONFIG_PPC_CELL is not set
26421 +# CONFIG_PPC_CELL_NATIVE is not set
26422 +# CONFIG_MPC8272_ADS is not set
26423 +# CONFIG_PQ2FADS is not set
26424 +CONFIG_EP8248E=y
26425 +# CONFIG_PQ2ADS is not set
26426 +CONFIG_8260=y
26427 +CONFIG_8272=y
26428 +# CONFIG_MPIC is not set
26429 +# CONFIG_MPIC_WEIRD is not set
26430 +# CONFIG_PPC_I8259 is not set
26431 +# CONFIG_PPC_RTAS is not set
26432 +# CONFIG_MMIO_NVRAM is not set
26433 +# CONFIG_PPC_MPC106 is not set
26434 +# CONFIG_PPC_970_NAP is not set
26435 +# CONFIG_PPC_INDIRECT_IO is not set
26436 +# CONFIG_GENERIC_IOMAP is not set
26437 +# CONFIG_CPU_FREQ is not set
26438 +CONFIG_CPM2=y
26439 +CONFIG_PPC_CPM_NEW_BINDING=y
26440 +# CONFIG_FSL_ULI1575 is not set
26441 +CONFIG_CPM=y
26442 +
26443 +#
26444 +# Kernel options
26445 +#
26446 +# CONFIG_HIGHMEM is not set
26447 +# CONFIG_TICK_ONESHOT is not set
26448 +# CONFIG_NO_HZ is not set
26449 +# CONFIG_HIGH_RES_TIMERS is not set
26450 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
26451 +# CONFIG_HZ_100 is not set
26452 +CONFIG_HZ_250=y
26453 +# CONFIG_HZ_300 is not set
26454 +# CONFIG_HZ_1000 is not set
26455 +CONFIG_HZ=250
26456 +CONFIG_PREEMPT_NONE=y
26457 +# CONFIG_PREEMPT_VOLUNTARY is not set
26458 +# CONFIG_PREEMPT is not set
26459 +CONFIG_BINFMT_ELF=y
26460 +CONFIG_BINFMT_MISC=y
26461 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
26462 +CONFIG_ARCH_FLATMEM_ENABLE=y
26463 +CONFIG_ARCH_POPULATES_NODE_MAP=y
26464 +CONFIG_FLATMEM=y
26465 +CONFIG_FLAT_NODE_MEM_MAP=y
26466 +# CONFIG_SPARSEMEM_STATIC is not set
26467 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
26468 +CONFIG_SPLIT_PTLOCK_CPUS=4
26469 +# CONFIG_RESOURCES_64BIT is not set
26470 +CONFIG_ZONE_DMA_FLAG=1
26471 +CONFIG_BOUNCE=y
26472 +CONFIG_VIRT_TO_BUS=y
26473 +CONFIG_PROC_DEVICETREE=y
26474 +# CONFIG_CMDLINE_BOOL is not set
26475 +# CONFIG_PM is not set
26476 +CONFIG_SUSPEND_UP_POSSIBLE=y
26477 +CONFIG_HIBERNATION_UP_POSSIBLE=y
26478 +# CONFIG_SECCOMP is not set
26479 +CONFIG_WANT_DEVICE_TREE=y
26480 +CONFIG_DEVICE_TREE="ep8248e.dts"
26481 +CONFIG_ISA_DMA_API=y
26482 +
26483 +#
26484 +# Bus options
26485 +#
26486 +CONFIG_ZONE_DMA=y
26487 +CONFIG_FSL_SOC=y
26488 +# CONFIG_PCI is not set
26489 +# CONFIG_PCI_DOMAINS is not set
26490 +# CONFIG_PCI_SYSCALL is not set
26491 +# CONFIG_ARCH_SUPPORTS_MSI is not set
26492 +# CONFIG_PCCARD is not set
26493 +
26494 +#
26495 +# Advanced setup
26496 +#
26497 +# CONFIG_ADVANCED_OPTIONS is not set
26498 +
26499 +#
26500 +# Default settings for advanced configuration options are used
26501 +#
26502 +CONFIG_HIGHMEM_START=0xfe000000
26503 +CONFIG_LOWMEM_SIZE=0x30000000
26504 +CONFIG_KERNEL_START=0xc0000000
26505 +CONFIG_TASK_SIZE=0xc0000000
26506 +CONFIG_BOOT_LOAD=0x00400000
26507 +
26508 +#
26509 +# Networking
26510 +#
26511 +CONFIG_NET=y
26512 +
26513 +#
26514 +# Networking options
26515 +#
26516 +CONFIG_PACKET=y
26517 +# CONFIG_PACKET_MMAP is not set
26518 +CONFIG_UNIX=y
26519 +CONFIG_XFRM=y
26520 +# CONFIG_XFRM_USER is not set
26521 +# CONFIG_NET_KEY is not set
26522 +CONFIG_INET=y
26523 +CONFIG_IP_MULTICAST=y
26524 +# CONFIG_IP_ADVANCED_ROUTER is not set
26525 +CONFIG_IP_FIB_HASH=y
26526 +CONFIG_IP_PNP=y
26527 +CONFIG_IP_PNP_DHCP=y
26528 +CONFIG_IP_PNP_BOOTP=y
26529 +# CONFIG_IP_PNP_RARP is not set
26530 +# CONFIG_NET_IPIP is not set
26531 +# CONFIG_NET_IPGRE is not set
26532 +# CONFIG_IP_MROUTE is not set
26533 +CONFIG_SYN_COOKIES=y
26534 +# CONFIG_INET_AH is not set
26535 +# CONFIG_INET_ESP is not set
26536 +# CONFIG_INET_IPCOMP is not set
26537 +# CONFIG_INET_XFRM_TUNNEL is not set
26538 +CONFIG_INET_TUNNEL=y
26539 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
26540 +CONFIG_INET_XFRM_MODE_TUNNEL=y
26541 +CONFIG_INET_XFRM_MODE_BEET=y
26542 +# CONFIG_INET_LRO is not set
26543 +CONFIG_INET_DIAG=y
26544 +CONFIG_INET_TCP_DIAG=y
26545 +# CONFIG_TCP_CONG_ADVANCED is not set
26546 +CONFIG_TCP_CONG_CUBIC=y
26547 +CONFIG_DEFAULT_TCP_CONG="cubic"
26548 +# CONFIG_IP_VS is not set
26549 +CONFIG_IPV6=y
26550 +# CONFIG_IPV6_PRIVACY is not set
26551 +# CONFIG_IPV6_ROUTER_PREF is not set
26552 +# CONFIG_INET6_AH is not set
26553 +# CONFIG_INET6_ESP is not set
26554 +# CONFIG_INET6_IPCOMP is not set
26555 +# CONFIG_INET6_XFRM_TUNNEL is not set
26556 +# CONFIG_INET6_TUNNEL is not set
26557 +CONFIG_INET6_XFRM_MODE_TRANSPORT=y
26558 +CONFIG_INET6_XFRM_MODE_TUNNEL=y
26559 +CONFIG_INET6_XFRM_MODE_BEET=y
26560 +CONFIG_IPV6_SIT=y
26561 +# CONFIG_IPV6_TUNNEL is not set
26562 +# CONFIG_NETWORK_SECMARK is not set
26563 +CONFIG_NETFILTER=y
26564 +# CONFIG_NETFILTER_DEBUG is not set
26565 +
26566 +#
26567 +# Core Netfilter Configuration
26568 +#
26569 +# CONFIG_NETFILTER_NETLINK is not set
26570 +# CONFIG_NF_CONNTRACK_ENABLED is not set
26571 +# CONFIG_NF_CONNTRACK is not set
26572 +# CONFIG_NETFILTER_XTABLES is not set
26573 +
26574 +#
26575 +# IP: Netfilter Configuration
26576 +#
26577 +# CONFIG_IP_NF_QUEUE is not set
26578 +# CONFIG_IP_NF_IPTABLES is not set
26579 +# CONFIG_IP_NF_ARPTABLES is not set
26580 +# CONFIG_BRIDGE is not set
26581 +# CONFIG_VLAN_8021Q is not set
26582 +# CONFIG_DECNET is not set
26583 +# CONFIG_LLC2 is not set
26584 +# CONFIG_IPX is not set
26585 +# CONFIG_ATALK is not set
26586 +# CONFIG_NET_SCHED is not set
26587 +
26588 +#
26589 +# Network testing
26590 +#
26591 +# CONFIG_NET_PKTGEN is not set
26592 +# CONFIG_HAMRADIO is not set
26593 +# CONFIG_IRDA is not set
26594 +# CONFIG_BT is not set
26595 +
26596 +#
26597 +# Wireless
26598 +#
26599 +# CONFIG_CFG80211 is not set
26600 +# CONFIG_WIRELESS_EXT is not set
26601 +# CONFIG_IEEE80211 is not set
26602 +# CONFIG_RFKILL is not set
26603 +
26604 +#
26605 +# Device Drivers
26606 +#
26607 +
26608 +#
26609 +# Generic Driver Options
26610 +#
26611 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
26612 +CONFIG_STANDALONE=y
26613 +CONFIG_PREVENT_FIRMWARE_BUILD=y
26614 +# CONFIG_FW_LOADER is not set
26615 +# CONFIG_DEBUG_DRIVER is not set
26616 +# CONFIG_DEBUG_DEVRES is not set
26617 +# CONFIG_SYS_HYPERVISOR is not set
26618 +# CONFIG_CONNECTOR is not set
26619 +CONFIG_MTD=y
26620 +# CONFIG_MTD_DEBUG is not set
26621 +# CONFIG_MTD_CONCAT is not set
26622 +# CONFIG_MTD_PARTITIONS is not set
26623 +
26624 +#
26625 +# User Modules And Translation Layers
26626 +#
26627 +CONFIG_MTD_CHAR=y
26628 +CONFIG_MTD_BLKDEVS=y
26629 +CONFIG_MTD_BLOCK=y
26630 +# CONFIG_FTL is not set
26631 +# CONFIG_NFTL is not set
26632 +# CONFIG_INFTL is not set
26633 +# CONFIG_RFD_FTL is not set
26634 +# CONFIG_SSFDC is not set
26635 +# CONFIG_MTD_OOPS is not set
26636 +
26637 +#
26638 +# RAM/ROM/Flash chip drivers
26639 +#
26640 +CONFIG_MTD_CFI=y
26641 +# CONFIG_MTD_JEDECPROBE is not set
26642 +CONFIG_MTD_GEN_PROBE=y
26643 +CONFIG_MTD_CFI_ADV_OPTIONS=y
26644 +CONFIG_MTD_CFI_NOSWAP=y
26645 +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
26646 +# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
26647 +CONFIG_MTD_CFI_GEOMETRY=y
26648 +# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
26649 +# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
26650 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
26651 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
26652 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
26653 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
26654 +# CONFIG_MTD_CFI_I1 is not set
26655 +CONFIG_MTD_CFI_I2=y
26656 +# CONFIG_MTD_CFI_I4 is not set
26657 +# CONFIG_MTD_CFI_I8 is not set
26658 +# CONFIG_MTD_OTP is not set
26659 +# CONFIG_MTD_CFI_INTELEXT is not set
26660 +CONFIG_MTD_CFI_AMDSTD=y
26661 +# CONFIG_MTD_CFI_STAA is not set
26662 +CONFIG_MTD_CFI_UTIL=y
26663 +# CONFIG_MTD_RAM is not set
26664 +# CONFIG_MTD_ROM is not set
26665 +# CONFIG_MTD_ABSENT is not set
26666 +
26667 +#
26668 +# Mapping drivers for chip access
26669 +#
26670 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
26671 +# CONFIG_MTD_PHYSMAP is not set
26672 +CONFIG_MTD_PHYSMAP_OF=y
26673 +# CONFIG_MTD_PLATRAM is not set
26674 +
26675 +#
26676 +# Self-contained MTD device drivers
26677 +#
26678 +# CONFIG_MTD_SLRAM is not set
26679 +# CONFIG_MTD_PHRAM is not set
26680 +# CONFIG_MTD_MTDRAM is not set
26681 +# CONFIG_MTD_BLOCK2MTD is not set
26682 +
26683 +#
26684 +# Disk-On-Chip Device Drivers
26685 +#
26686 +# CONFIG_MTD_DOC2000 is not set
26687 +# CONFIG_MTD_DOC2001 is not set
26688 +# CONFIG_MTD_DOC2001PLUS is not set
26689 +# CONFIG_MTD_NAND is not set
26690 +# CONFIG_MTD_ONENAND is not set
26691 +
26692 +#
26693 +# UBI - Unsorted block images
26694 +#
26695 +# CONFIG_MTD_UBI is not set
26696 +CONFIG_OF_DEVICE=y
26697 +# CONFIG_PARPORT is not set
26698 +CONFIG_BLK_DEV=y
26699 +# CONFIG_BLK_DEV_FD is not set
26700 +# CONFIG_BLK_DEV_COW_COMMON is not set
26701 +CONFIG_BLK_DEV_LOOP=y
26702 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
26703 +# CONFIG_BLK_DEV_NBD is not set
26704 +# CONFIG_BLK_DEV_RAM is not set
26705 +# CONFIG_CDROM_PKTCDVD is not set
26706 +# CONFIG_ATA_OVER_ETH is not set
26707 +# CONFIG_MISC_DEVICES is not set
26708 +# CONFIG_IDE is not set
26709 +
26710 +#
26711 +# SCSI device support
26712 +#
26713 +# CONFIG_RAID_ATTRS is not set
26714 +# CONFIG_SCSI is not set
26715 +# CONFIG_SCSI_DMA is not set
26716 +# CONFIG_SCSI_NETLINK is not set
26717 +# CONFIG_ATA is not set
26718 +# CONFIG_MD is not set
26719 +# CONFIG_MACINTOSH_DRIVERS is not set
26720 +CONFIG_NETDEVICES=y
26721 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
26722 +# CONFIG_DUMMY is not set
26723 +# CONFIG_BONDING is not set
26724 +# CONFIG_EQUALIZER is not set
26725 +# CONFIG_TUN is not set
26726 +# CONFIG_VETH is not set
26727 +CONFIG_PHYLIB=y
26728 +
26729 +#
26730 +# MII PHY device drivers
26731 +#
26732 +# CONFIG_MARVELL_PHY is not set
26733 +CONFIG_DAVICOM_PHY=y
26734 +# CONFIG_QSEMI_PHY is not set
26735 +# CONFIG_LXT_PHY is not set
26736 +# CONFIG_CICADA_PHY is not set
26737 +# CONFIG_VITESSE_PHY is not set
26738 +# CONFIG_SMSC_PHY is not set
26739 +# CONFIG_BROADCOM_PHY is not set
26740 +# CONFIG_ICPLUS_PHY is not set
26741 +# CONFIG_FIXED_PHY is not set
26742 +CONFIG_MDIO_BITBANG=y
26743 +CONFIG_NET_ETHERNET=y
26744 +CONFIG_MII=y
26745 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
26746 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
26747 +# CONFIG_IBM_NEW_EMAC_TAH is not set
26748 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
26749 +# CONFIG_B44 is not set
26750 +CONFIG_FS_ENET=y
26751 +# CONFIG_FS_ENET_HAS_SCC is not set
26752 +CONFIG_FS_ENET_HAS_FCC=y
26753 +# CONFIG_FS_ENET_MDIO_FCC is not set
26754 +CONFIG_NETDEV_1000=y
26755 +CONFIG_NETDEV_10000=y
26756 +
26757 +#
26758 +# Wireless LAN
26759 +#
26760 +# CONFIG_WLAN_PRE80211 is not set
26761 +# CONFIG_WLAN_80211 is not set
26762 +# CONFIG_WAN is not set
26763 +# CONFIG_PPP is not set
26764 +# CONFIG_SLIP is not set
26765 +# CONFIG_NETPOLL is not set
26766 +# CONFIG_NET_POLL_CONTROLLER is not set
26767 +# CONFIG_ISDN is not set
26768 +# CONFIG_PHONE is not set
26769 +
26770 +#
26771 +# Input device support
26772 +#
26773 +# CONFIG_INPUT is not set
26774 +
26775 +#
26776 +# Hardware I/O ports
26777 +#
26778 +# CONFIG_SERIO is not set
26779 +# CONFIG_GAMEPORT is not set
26780 +
26781 +#
26782 +# Character devices
26783 +#
26784 +# CONFIG_VT is not set
26785 +# CONFIG_SERIAL_NONSTANDARD is not set
26786 +
26787 +#
26788 +# Serial drivers
26789 +#
26790 +# CONFIG_SERIAL_8250 is not set
26791 +
26792 +#
26793 +# Non-8250 serial port support
26794 +#
26795 +# CONFIG_SERIAL_UARTLITE is not set
26796 +CONFIG_SERIAL_CORE=y
26797 +CONFIG_SERIAL_CORE_CONSOLE=y
26798 +CONFIG_SERIAL_CPM=y
26799 +CONFIG_SERIAL_CPM_CONSOLE=y
26800 +CONFIG_SERIAL_CPM_SCC1=y
26801 +# CONFIG_SERIAL_CPM_SCC2 is not set
26802 +# CONFIG_SERIAL_CPM_SCC3 is not set
26803 +CONFIG_SERIAL_CPM_SCC4=y
26804 +# CONFIG_SERIAL_CPM_SMC1 is not set
26805 +# CONFIG_SERIAL_CPM_SMC2 is not set
26806 +CONFIG_UNIX98_PTYS=y
26807 +CONFIG_LEGACY_PTYS=y
26808 +CONFIG_LEGACY_PTY_COUNT=256
26809 +# CONFIG_IPMI_HANDLER is not set
26810 +CONFIG_HW_RANDOM=y
26811 +# CONFIG_NVRAM is not set
26812 +# CONFIG_GEN_RTC is not set
26813 +# CONFIG_R3964 is not set
26814 +# CONFIG_RAW_DRIVER is not set
26815 +# CONFIG_I2C is not set
26816 +
26817 +#
26818 +# SPI support
26819 +#
26820 +# CONFIG_SPI is not set
26821 +# CONFIG_SPI_MASTER is not set
26822 +# CONFIG_W1 is not set
26823 +# CONFIG_POWER_SUPPLY is not set
26824 +# CONFIG_HWMON is not set
26825 +# CONFIG_WATCHDOG is not set
26826 +
26827 +#
26828 +# Sonics Silicon Backplane
26829 +#
26830 +CONFIG_SSB_POSSIBLE=y
26831 +# CONFIG_SSB is not set
26832 +
26833 +#
26834 +# Multifunction device drivers
26835 +#
26836 +# CONFIG_MFD_SM501 is not set
26837 +
26838 +#
26839 +# Multimedia devices
26840 +#
26841 +# CONFIG_VIDEO_DEV is not set
26842 +# CONFIG_DVB_CORE is not set
26843 +CONFIG_DAB=y
26844 +
26845 +#
26846 +# Graphics support
26847 +#
26848 +# CONFIG_VGASTATE is not set
26849 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
26850 +# CONFIG_FB is not set
26851 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
26852 +
26853 +#
26854 +# Display device support
26855 +#
26856 +# CONFIG_DISPLAY_SUPPORT is not set
26857 +
26858 +#
26859 +# Sound
26860 +#
26861 +# CONFIG_SOUND is not set
26862 +# CONFIG_USB_SUPPORT is not set
26863 +# CONFIG_MMC is not set
26864 +# CONFIG_NEW_LEDS is not set
26865 +# CONFIG_RTC_CLASS is not set
26866 +
26867 +#
26868 +# Userspace I/O
26869 +#
26870 +# CONFIG_UIO is not set
26871 +
26872 +#
26873 +# File systems
26874 +#
26875 +CONFIG_EXT2_FS=y
26876 +# CONFIG_EXT2_FS_XATTR is not set
26877 +# CONFIG_EXT2_FS_XIP is not set
26878 +CONFIG_EXT3_FS=y
26879 +# CONFIG_EXT3_FS_XATTR is not set
26880 +CONFIG_JBD=y
26881 +# CONFIG_REISERFS_FS is not set
26882 +# CONFIG_JFS_FS is not set
26883 +# CONFIG_FS_POSIX_ACL is not set
26884 +# CONFIG_XFS_FS is not set
26885 +# CONFIG_OCFS2_FS is not set
26886 +# CONFIG_MINIX_FS is not set
26887 +# CONFIG_ROMFS_FS is not set
26888 +CONFIG_INOTIFY=y
26889 +CONFIG_INOTIFY_USER=y
26890 +# CONFIG_QUOTA is not set
26891 +CONFIG_DNOTIFY=y
26892 +# CONFIG_AUTOFS_FS is not set
26893 +CONFIG_AUTOFS4_FS=y
26894 +# CONFIG_FUSE_FS is not set
26895 +
26896 +#
26897 +# CD-ROM/DVD Filesystems
26898 +#
26899 +# CONFIG_ISO9660_FS is not set
26900 +# CONFIG_UDF_FS is not set
26901 +
26902 +#
26903 +# DOS/FAT/NT Filesystems
26904 +#
26905 +# CONFIG_MSDOS_FS is not set
26906 +# CONFIG_VFAT_FS is not set
26907 +# CONFIG_NTFS_FS is not set
26908 +
26909 +#
26910 +# Pseudo filesystems
26911 +#
26912 +CONFIG_PROC_FS=y
26913 +CONFIG_PROC_KCORE=y
26914 +CONFIG_PROC_SYSCTL=y
26915 +CONFIG_SYSFS=y
26916 +CONFIG_TMPFS=y
26917 +# CONFIG_TMPFS_POSIX_ACL is not set
26918 +# CONFIG_HUGETLB_PAGE is not set
26919 +
26920 +#
26921 +# Miscellaneous filesystems
26922 +#
26923 +# CONFIG_HFSPLUS_FS is not set
26924 +# CONFIG_JFFS2_FS is not set
26925 +CONFIG_CRAMFS=y
26926 +# CONFIG_VXFS_FS is not set
26927 +# CONFIG_HPFS_FS is not set
26928 +# CONFIG_QNX4FS_FS is not set
26929 +# CONFIG_SYSV_FS is not set
26930 +# CONFIG_UFS_FS is not set
26931 +CONFIG_NETWORK_FILESYSTEMS=y
26932 +CONFIG_NFS_FS=y
26933 +CONFIG_NFS_V3=y
26934 +# CONFIG_NFS_V3_ACL is not set
26935 +# CONFIG_NFS_DIRECTIO is not set
26936 +# CONFIG_NFSD is not set
26937 +CONFIG_ROOT_NFS=y
26938 +CONFIG_LOCKD=y
26939 +CONFIG_LOCKD_V4=y
26940 +CONFIG_NFS_COMMON=y
26941 +CONFIG_SUNRPC=y
26942 +# CONFIG_SMB_FS is not set
26943 +# CONFIG_CIFS is not set
26944 +# CONFIG_NCP_FS is not set
26945 +# CONFIG_CODA_FS is not set
26946 +
26947 +#
26948 +# Partition Types
26949 +#
26950 +CONFIG_PARTITION_ADVANCED=y
26951 +# CONFIG_ACORN_PARTITION is not set
26952 +# CONFIG_OSF_PARTITION is not set
26953 +# CONFIG_AMIGA_PARTITION is not set
26954 +# CONFIG_ATARI_PARTITION is not set
26955 +# CONFIG_MAC_PARTITION is not set
26956 +CONFIG_MSDOS_PARTITION=y
26957 +# CONFIG_BSD_DISKLABEL is not set
26958 +# CONFIG_MINIX_SUBPARTITION is not set
26959 +# CONFIG_SOLARIS_X86_PARTITION is not set
26960 +# CONFIG_UNIXWARE_DISKLABEL is not set
26961 +# CONFIG_LDM_PARTITION is not set
26962 +# CONFIG_SGI_PARTITION is not set
26963 +# CONFIG_ULTRIX_PARTITION is not set
26964 +# CONFIG_SUN_PARTITION is not set
26965 +# CONFIG_KARMA_PARTITION is not set
26966 +# CONFIG_EFI_PARTITION is not set
26967 +# CONFIG_SYSV68_PARTITION is not set
26968 +CONFIG_NLS=y
26969 +CONFIG_NLS_DEFAULT="iso8859-1"
26970 +CONFIG_NLS_CODEPAGE_437=y
26971 +# CONFIG_NLS_CODEPAGE_737 is not set
26972 +# CONFIG_NLS_CODEPAGE_775 is not set
26973 +# CONFIG_NLS_CODEPAGE_850 is not set
26974 +# CONFIG_NLS_CODEPAGE_852 is not set
26975 +# CONFIG_NLS_CODEPAGE_855 is not set
26976 +# CONFIG_NLS_CODEPAGE_857 is not set
26977 +# CONFIG_NLS_CODEPAGE_860 is not set
26978 +# CONFIG_NLS_CODEPAGE_861 is not set
26979 +# CONFIG_NLS_CODEPAGE_862 is not set
26980 +# CONFIG_NLS_CODEPAGE_863 is not set
26981 +# CONFIG_NLS_CODEPAGE_864 is not set
26982 +# CONFIG_NLS_CODEPAGE_865 is not set
26983 +# CONFIG_NLS_CODEPAGE_866 is not set
26984 +# CONFIG_NLS_CODEPAGE_869 is not set
26985 +# CONFIG_NLS_CODEPAGE_936 is not set
26986 +# CONFIG_NLS_CODEPAGE_950 is not set
26987 +# CONFIG_NLS_CODEPAGE_932 is not set
26988 +# CONFIG_NLS_CODEPAGE_949 is not set
26989 +# CONFIG_NLS_CODEPAGE_874 is not set
26990 +# CONFIG_NLS_ISO8859_8 is not set
26991 +# CONFIG_NLS_CODEPAGE_1250 is not set
26992 +# CONFIG_NLS_CODEPAGE_1251 is not set
26993 +CONFIG_NLS_ASCII=y
26994 +CONFIG_NLS_ISO8859_1=y
26995 +# CONFIG_NLS_ISO8859_2 is not set
26996 +# CONFIG_NLS_ISO8859_3 is not set
26997 +# CONFIG_NLS_ISO8859_4 is not set
26998 +# CONFIG_NLS_ISO8859_5 is not set
26999 +# CONFIG_NLS_ISO8859_6 is not set
27000 +# CONFIG_NLS_ISO8859_7 is not set
27001 +# CONFIG_NLS_ISO8859_9 is not set
27002 +# CONFIG_NLS_ISO8859_13 is not set
27003 +# CONFIG_NLS_ISO8859_14 is not set
27004 +# CONFIG_NLS_ISO8859_15 is not set
27005 +# CONFIG_NLS_KOI8_R is not set
27006 +# CONFIG_NLS_KOI8_U is not set
27007 +CONFIG_NLS_UTF8=y
27008 +# CONFIG_UCC_SLOW is not set
27009 +
27010 +#
27011 +# Library routines
27012 +#
27013 +# CONFIG_CRC_CCITT is not set
27014 +# CONFIG_CRC16 is not set
27015 +# CONFIG_CRC_ITU_T is not set
27016 +# CONFIG_CRC32 is not set
27017 +# CONFIG_CRC7 is not set
27018 +# CONFIG_LIBCRC32C is not set
27019 +CONFIG_ZLIB_INFLATE=y
27020 +CONFIG_PLIST=y
27021 +CONFIG_HAS_IOMEM=y
27022 +CONFIG_HAS_IOPORT=y
27023 +CONFIG_HAS_DMA=y
27024 +CONFIG_INSTRUMENTATION=y
27025 +# CONFIG_PROFILING is not set
27026 +# CONFIG_MARKERS is not set
27027 +
27028 +#
27029 +# Kernel hacking
27030 +#
27031 +# CONFIG_PRINTK_TIME is not set
27032 +CONFIG_ENABLE_WARN_DEPRECATED=y
27033 +CONFIG_ENABLE_MUST_CHECK=y
27034 +CONFIG_MAGIC_SYSRQ=y
27035 +# CONFIG_UNUSED_SYMBOLS is not set
27036 +# CONFIG_DEBUG_FS is not set
27037 +# CONFIG_HEADERS_CHECK is not set
27038 +CONFIG_DEBUG_KERNEL=y
27039 +# CONFIG_DEBUG_SHIRQ is not set
27040 +# CONFIG_DETECT_SOFTLOCKUP is not set
27041 +# CONFIG_SCHED_DEBUG is not set
27042 +# CONFIG_SCHEDSTATS is not set
27043 +# CONFIG_TIMER_STATS is not set
27044 +# CONFIG_DEBUG_SLAB is not set
27045 +# CONFIG_DEBUG_RT_MUTEXES is not set
27046 +# CONFIG_RT_MUTEX_TESTER is not set
27047 +# CONFIG_DEBUG_SPINLOCK is not set
27048 +# CONFIG_DEBUG_MUTEXES is not set
27049 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
27050 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
27051 +# CONFIG_DEBUG_KOBJECT is not set
27052 +CONFIG_DEBUG_BUGVERBOSE=y
27053 +CONFIG_DEBUG_INFO=y
27054 +# CONFIG_DEBUG_VM is not set
27055 +# CONFIG_DEBUG_LIST is not set
27056 +# CONFIG_DEBUG_SG is not set
27057 +CONFIG_FORCED_INLINING=y
27058 +# CONFIG_BOOT_PRINTK_DELAY is not set
27059 +# CONFIG_FAULT_INJECTION is not set
27060 +# CONFIG_SAMPLES is not set
27061 +# CONFIG_DEBUG_STACKOVERFLOW is not set
27062 +# CONFIG_DEBUG_STACK_USAGE is not set
27063 +# CONFIG_DEBUG_PAGEALLOC is not set
27064 +# CONFIG_DEBUGGER is not set
27065 +# CONFIG_KGDB_CONSOLE is not set
27066 +CONFIG_BDI_SWITCH=y
27067 +# CONFIG_PPC_EARLY_DEBUG is not set
27068 +
27069 +#
27070 +# Security options
27071 +#
27072 +# CONFIG_KEYS is not set
27073 +# CONFIG_SECURITY is not set
27074 +CONFIG_CRYPTO=y
27075 +CONFIG_CRYPTO_ALGAPI=y
27076 +CONFIG_CRYPTO_BLKCIPHER=y
27077 +CONFIG_CRYPTO_MANAGER=y
27078 +# CONFIG_CRYPTO_HMAC is not set
27079 +# CONFIG_CRYPTO_NULL is not set
27080 +# CONFIG_CRYPTO_MD4 is not set
27081 +CONFIG_CRYPTO_MD5=y
27082 +# CONFIG_CRYPTO_SHA1 is not set
27083 +# CONFIG_CRYPTO_SHA256 is not set
27084 +# CONFIG_CRYPTO_SHA512 is not set
27085 +# CONFIG_CRYPTO_WP512 is not set
27086 +# CONFIG_CRYPTO_TGR192 is not set
27087 +CONFIG_CRYPTO_ECB=y
27088 +CONFIG_CRYPTO_CBC=y
27089 +CONFIG_CRYPTO_PCBC=y
27090 +# CONFIG_CRYPTO_CRYPTD is not set
27091 +CONFIG_CRYPTO_DES=y
27092 +# CONFIG_CRYPTO_FCRYPT is not set
27093 +# CONFIG_CRYPTO_BLOWFISH is not set
27094 +# CONFIG_CRYPTO_TWOFISH is not set
27095 +# CONFIG_CRYPTO_SERPENT is not set
27096 +# CONFIG_CRYPTO_AES is not set
27097 +# CONFIG_CRYPTO_CAST5 is not set
27098 +# CONFIG_CRYPTO_CAST6 is not set
27099 +# CONFIG_CRYPTO_TEA is not set
27100 +# CONFIG_CRYPTO_ARC4 is not set
27101 +# CONFIG_CRYPTO_KHAZAD is not set
27102 +# CONFIG_CRYPTO_ANUBIS is not set
27103 +# CONFIG_CRYPTO_SEED is not set
27104 +# CONFIG_CRYPTO_DEFLATE is not set
27105 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
27106 +# CONFIG_CRYPTO_CRC32C is not set
27107 +# CONFIG_CRYPTO_CAMELLIA is not set
27108 +# CONFIG_CRYPTO_AUTHENC is not set
27109 +# CONFIG_CRYPTO_HW is not set
27110 +# CONFIG_PPC_CLOCK is not set
27111 +CONFIG_PPC_LIB_RHEAP=y
27112 Index: linux-2.6.24.7/arch/powerpc/configs/katmai_defconfig
27113 ===================================================================
27114 --- /dev/null
27115 +++ linux-2.6.24.7/arch/powerpc/configs/katmai_defconfig
27116 @@ -0,0 +1,790 @@
27117 +#
27118 +# Automatically generated make config: don't edit
27119 +# Linux kernel version: 2.6.24-rc6
27120 +# Mon Dec 24 11:17:43 2007
27121 +#
27122 +# CONFIG_PPC64 is not set
27123 +
27124 +#
27125 +# Processor support
27126 +#
27127 +# CONFIG_6xx is not set
27128 +# CONFIG_PPC_85xx is not set
27129 +# CONFIG_PPC_8xx is not set
27130 +# CONFIG_40x is not set
27131 +CONFIG_44x=y
27132 +# CONFIG_E200 is not set
27133 +CONFIG_4xx=y
27134 +CONFIG_BOOKE=y
27135 +CONFIG_PTE_64BIT=y
27136 +CONFIG_PHYS_64BIT=y
27137 +# CONFIG_PPC_MM_SLICES is not set
27138 +CONFIG_NOT_COHERENT_CACHE=y
27139 +CONFIG_PPC32=y
27140 +CONFIG_WORD_SIZE=32
27141 +CONFIG_PPC_MERGE=y
27142 +CONFIG_MMU=y
27143 +CONFIG_GENERIC_CMOS_UPDATE=y
27144 +CONFIG_GENERIC_TIME=y
27145 +CONFIG_GENERIC_TIME_VSYSCALL=y
27146 +CONFIG_GENERIC_CLOCKEVENTS=y
27147 +CONFIG_GENERIC_HARDIRQS=y
27148 +CONFIG_IRQ_PER_CPU=y
27149 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
27150 +CONFIG_ARCH_HAS_ILOG2_U32=y
27151 +CONFIG_GENERIC_HWEIGHT=y
27152 +CONFIG_GENERIC_CALIBRATE_DELAY=y
27153 +CONFIG_GENERIC_FIND_NEXT_BIT=y
27154 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
27155 +CONFIG_PPC=y
27156 +CONFIG_EARLY_PRINTK=y
27157 +CONFIG_GENERIC_NVRAM=y
27158 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
27159 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
27160 +CONFIG_PPC_OF=y
27161 +CONFIG_OF=y
27162 +CONFIG_PPC_UDBG_16550=y
27163 +# CONFIG_GENERIC_TBSYNC is not set
27164 +CONFIG_AUDIT_ARCH=y
27165 +CONFIG_GENERIC_BUG=y
27166 +# CONFIG_DEFAULT_UIMAGE is not set
27167 +CONFIG_PPC_DCR_NATIVE=y
27168 +# CONFIG_PPC_DCR_MMIO is not set
27169 +CONFIG_PPC_DCR=y
27170 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
27171 +
27172 +#
27173 +# General setup
27174 +#
27175 +CONFIG_EXPERIMENTAL=y
27176 +CONFIG_BROKEN_ON_SMP=y
27177 +CONFIG_INIT_ENV_ARG_LIMIT=32
27178 +CONFIG_LOCALVERSION=""
27179 +CONFIG_LOCALVERSION_AUTO=y
27180 +CONFIG_SWAP=y
27181 +CONFIG_SYSVIPC=y
27182 +CONFIG_SYSVIPC_SYSCTL=y
27183 +CONFIG_POSIX_MQUEUE=y
27184 +# CONFIG_BSD_PROCESS_ACCT is not set
27185 +# CONFIG_TASKSTATS is not set
27186 +# CONFIG_USER_NS is not set
27187 +# CONFIG_PID_NS is not set
27188 +# CONFIG_AUDIT is not set
27189 +# CONFIG_IKCONFIG is not set
27190 +CONFIG_LOG_BUF_SHIFT=14
27191 +# CONFIG_CGROUPS is not set
27192 +CONFIG_FAIR_GROUP_SCHED=y
27193 +CONFIG_FAIR_USER_SCHED=y
27194 +# CONFIG_FAIR_CGROUP_SCHED is not set
27195 +CONFIG_SYSFS_DEPRECATED=y
27196 +# CONFIG_RELAY is not set
27197 +CONFIG_BLK_DEV_INITRD=y
27198 +CONFIG_INITRAMFS_SOURCE=""
27199 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
27200 +CONFIG_SYSCTL=y
27201 +CONFIG_EMBEDDED=y
27202 +CONFIG_SYSCTL_SYSCALL=y
27203 +CONFIG_KALLSYMS=y
27204 +# CONFIG_KALLSYMS_ALL is not set
27205 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
27206 +CONFIG_HOTPLUG=y
27207 +CONFIG_PRINTK=y
27208 +CONFIG_BUG=y
27209 +CONFIG_ELF_CORE=y
27210 +CONFIG_BASE_FULL=y
27211 +CONFIG_FUTEX=y
27212 +CONFIG_ANON_INODES=y
27213 +CONFIG_EPOLL=y
27214 +CONFIG_SIGNALFD=y
27215 +CONFIG_EVENTFD=y
27216 +CONFIG_SHMEM=y
27217 +CONFIG_VM_EVENT_COUNTERS=y
27218 +CONFIG_SLUB_DEBUG=y
27219 +# CONFIG_SLAB is not set
27220 +CONFIG_SLUB=y
27221 +# CONFIG_SLOB is not set
27222 +CONFIG_RT_MUTEXES=y
27223 +# CONFIG_TINY_SHMEM is not set
27224 +CONFIG_BASE_SMALL=0
27225 +CONFIG_MODULES=y
27226 +CONFIG_MODULE_UNLOAD=y
27227 +# CONFIG_MODULE_FORCE_UNLOAD is not set
27228 +# CONFIG_MODVERSIONS is not set
27229 +# CONFIG_MODULE_SRCVERSION_ALL is not set
27230 +CONFIG_KMOD=y
27231 +CONFIG_BLOCK=y
27232 +CONFIG_LBD=y
27233 +# CONFIG_BLK_DEV_IO_TRACE is not set
27234 +# CONFIG_LSF is not set
27235 +# CONFIG_BLK_DEV_BSG is not set
27236 +
27237 +#
27238 +# IO Schedulers
27239 +#
27240 +CONFIG_IOSCHED_NOOP=y
27241 +CONFIG_IOSCHED_AS=y
27242 +CONFIG_IOSCHED_DEADLINE=y
27243 +CONFIG_IOSCHED_CFQ=y
27244 +CONFIG_DEFAULT_AS=y
27245 +# CONFIG_DEFAULT_DEADLINE is not set
27246 +# CONFIG_DEFAULT_CFQ is not set
27247 +# CONFIG_DEFAULT_NOOP is not set
27248 +CONFIG_DEFAULT_IOSCHED="anticipatory"
27249 +CONFIG_PPC4xx_PCI_EXPRESS=y
27250 +
27251 +#
27252 +# Platform support
27253 +#
27254 +# CONFIG_PPC_MPC52xx is not set
27255 +# CONFIG_PPC_MPC5200 is not set
27256 +# CONFIG_PPC_CELL is not set
27257 +# CONFIG_PPC_CELL_NATIVE is not set
27258 +# CONFIG_PQ2ADS is not set
27259 +# CONFIG_BAMBOO is not set
27260 +# CONFIG_EBONY is not set
27261 +# CONFIG_SEQUOIA is not set
27262 +# CONFIG_TAISHAN is not set
27263 +CONFIG_KATMAI=y
27264 +# CONFIG_RAINIER is not set
27265 +CONFIG_440SPe=y
27266 +# CONFIG_MPIC is not set
27267 +# CONFIG_MPIC_WEIRD is not set
27268 +# CONFIG_PPC_I8259 is not set
27269 +# CONFIG_PPC_RTAS is not set
27270 +# CONFIG_MMIO_NVRAM is not set
27271 +# CONFIG_PPC_MPC106 is not set
27272 +# CONFIG_PPC_970_NAP is not set
27273 +# CONFIG_PPC_INDIRECT_IO is not set
27274 +# CONFIG_GENERIC_IOMAP is not set
27275 +# CONFIG_CPU_FREQ is not set
27276 +# CONFIG_CPM2 is not set
27277 +# CONFIG_FSL_ULI1575 is not set
27278 +
27279 +#
27280 +# Kernel options
27281 +#
27282 +# CONFIG_HIGHMEM is not set
27283 +# CONFIG_TICK_ONESHOT is not set
27284 +# CONFIG_NO_HZ is not set
27285 +# CONFIG_HIGH_RES_TIMERS is not set
27286 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
27287 +# CONFIG_HZ_100 is not set
27288 +CONFIG_HZ_250=y
27289 +# CONFIG_HZ_300 is not set
27290 +# CONFIG_HZ_1000 is not set
27291 +CONFIG_HZ=250
27292 +CONFIG_PREEMPT_NONE=y
27293 +# CONFIG_PREEMPT_VOLUNTARY is not set
27294 +# CONFIG_PREEMPT is not set
27295 +CONFIG_BINFMT_ELF=y
27296 +# CONFIG_BINFMT_MISC is not set
27297 +# CONFIG_MATH_EMULATION is not set
27298 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
27299 +CONFIG_ARCH_FLATMEM_ENABLE=y
27300 +CONFIG_ARCH_POPULATES_NODE_MAP=y
27301 +CONFIG_SELECT_MEMORY_MODEL=y
27302 +CONFIG_FLATMEM_MANUAL=y
27303 +# CONFIG_DISCONTIGMEM_MANUAL is not set
27304 +# CONFIG_SPARSEMEM_MANUAL is not set
27305 +CONFIG_FLATMEM=y
27306 +CONFIG_FLAT_NODE_MEM_MAP=y
27307 +# CONFIG_SPARSEMEM_STATIC is not set
27308 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
27309 +CONFIG_SPLIT_PTLOCK_CPUS=4
27310 +CONFIG_RESOURCES_64BIT=y
27311 +CONFIG_ZONE_DMA_FLAG=1
27312 +CONFIG_BOUNCE=y
27313 +CONFIG_VIRT_TO_BUS=y
27314 +CONFIG_PROC_DEVICETREE=y
27315 +CONFIG_CMDLINE_BOOL=y
27316 +CONFIG_CMDLINE=""
27317 +CONFIG_SECCOMP=y
27318 +CONFIG_WANT_DEVICE_TREE=y
27319 +CONFIG_DEVICE_TREE="katmai.dts"
27320 +CONFIG_ISA_DMA_API=y
27321 +
27322 +#
27323 +# Bus options
27324 +#
27325 +CONFIG_ZONE_DMA=y
27326 +CONFIG_PPC_INDIRECT_PCI=y
27327 +CONFIG_PCI=y
27328 +CONFIG_PCI_DOMAINS=y
27329 +CONFIG_PCI_SYSCALL=y
27330 +# CONFIG_PCIEPORTBUS is not set
27331 +CONFIG_ARCH_SUPPORTS_MSI=y
27332 +# CONFIG_PCI_MSI is not set
27333 +CONFIG_PCI_LEGACY=y
27334 +# CONFIG_PCI_DEBUG is not set
27335 +# CONFIG_PCCARD is not set
27336 +# CONFIG_HOTPLUG_PCI is not set
27337 +
27338 +#
27339 +# Advanced setup
27340 +#
27341 +# CONFIG_ADVANCED_OPTIONS is not set
27342 +
27343 +#
27344 +# Default settings for advanced configuration options are used
27345 +#
27346 +CONFIG_HIGHMEM_START=0xfe000000
27347 +CONFIG_LOWMEM_SIZE=0x30000000
27348 +CONFIG_KERNEL_START=0xc0000000
27349 +CONFIG_TASK_SIZE=0xc0000000
27350 +CONFIG_CONSISTENT_START=0xff100000
27351 +CONFIG_CONSISTENT_SIZE=0x00200000
27352 +CONFIG_BOOT_LOAD=0x01000000
27353 +
27354 +#
27355 +# Networking
27356 +#
27357 +CONFIG_NET=y
27358 +
27359 +#
27360 +# Networking options
27361 +#
27362 +CONFIG_PACKET=y
27363 +# CONFIG_PACKET_MMAP is not set
27364 +CONFIG_UNIX=y
27365 +# CONFIG_NET_KEY is not set
27366 +CONFIG_INET=y
27367 +# CONFIG_IP_MULTICAST is not set
27368 +# CONFIG_IP_ADVANCED_ROUTER is not set
27369 +CONFIG_IP_FIB_HASH=y
27370 +CONFIG_IP_PNP=y
27371 +CONFIG_IP_PNP_DHCP=y
27372 +CONFIG_IP_PNP_BOOTP=y
27373 +# CONFIG_IP_PNP_RARP is not set
27374 +# CONFIG_NET_IPIP is not set
27375 +# CONFIG_NET_IPGRE is not set
27376 +# CONFIG_ARPD is not set
27377 +# CONFIG_SYN_COOKIES is not set
27378 +# CONFIG_INET_AH is not set
27379 +# CONFIG_INET_ESP is not set
27380 +# CONFIG_INET_IPCOMP is not set
27381 +# CONFIG_INET_XFRM_TUNNEL is not set
27382 +# CONFIG_INET_TUNNEL is not set
27383 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
27384 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
27385 +# CONFIG_INET_XFRM_MODE_BEET is not set
27386 +# CONFIG_INET_LRO is not set
27387 +CONFIG_INET_DIAG=y
27388 +CONFIG_INET_TCP_DIAG=y
27389 +# CONFIG_TCP_CONG_ADVANCED is not set
27390 +CONFIG_TCP_CONG_CUBIC=y
27391 +CONFIG_DEFAULT_TCP_CONG="cubic"
27392 +# CONFIG_TCP_MD5SIG is not set
27393 +# CONFIG_IPV6 is not set
27394 +# CONFIG_INET6_XFRM_TUNNEL is not set
27395 +# CONFIG_INET6_TUNNEL is not set
27396 +# CONFIG_NETWORK_SECMARK is not set
27397 +# CONFIG_NETFILTER is not set
27398 +# CONFIG_IP_DCCP is not set
27399 +# CONFIG_IP_SCTP is not set
27400 +# CONFIG_TIPC is not set
27401 +# CONFIG_ATM is not set
27402 +# CONFIG_BRIDGE is not set
27403 +# CONFIG_VLAN_8021Q is not set
27404 +# CONFIG_DECNET is not set
27405 +# CONFIG_LLC2 is not set
27406 +# CONFIG_IPX is not set
27407 +# CONFIG_ATALK is not set
27408 +# CONFIG_X25 is not set
27409 +# CONFIG_LAPB is not set
27410 +# CONFIG_ECONET is not set
27411 +# CONFIG_WAN_ROUTER is not set
27412 +# CONFIG_NET_SCHED is not set
27413 +
27414 +#
27415 +# Network testing
27416 +#
27417 +# CONFIG_NET_PKTGEN is not set
27418 +# CONFIG_HAMRADIO is not set
27419 +# CONFIG_IRDA is not set
27420 +# CONFIG_BT is not set
27421 +# CONFIG_AF_RXRPC is not set
27422 +
27423 +#
27424 +# Wireless
27425 +#
27426 +# CONFIG_CFG80211 is not set
27427 +# CONFIG_WIRELESS_EXT is not set
27428 +# CONFIG_MAC80211 is not set
27429 +# CONFIG_IEEE80211 is not set
27430 +# CONFIG_RFKILL is not set
27431 +# CONFIG_NET_9P is not set
27432 +
27433 +#
27434 +# Device Drivers
27435 +#
27436 +
27437 +#
27438 +# Generic Driver Options
27439 +#
27440 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
27441 +CONFIG_STANDALONE=y
27442 +CONFIG_PREVENT_FIRMWARE_BUILD=y
27443 +CONFIG_FW_LOADER=y
27444 +# CONFIG_DEBUG_DRIVER is not set
27445 +# CONFIG_DEBUG_DEVRES is not set
27446 +# CONFIG_SYS_HYPERVISOR is not set
27447 +CONFIG_CONNECTOR=y
27448 +CONFIG_PROC_EVENTS=y
27449 +# CONFIG_MTD is not set
27450 +CONFIG_OF_DEVICE=y
27451 +# CONFIG_PARPORT is not set
27452 +CONFIG_BLK_DEV=y
27453 +# CONFIG_BLK_DEV_FD is not set
27454 +# CONFIG_BLK_CPQ_DA is not set
27455 +# CONFIG_BLK_CPQ_CISS_DA is not set
27456 +# CONFIG_BLK_DEV_DAC960 is not set
27457 +# CONFIG_BLK_DEV_UMEM is not set
27458 +# CONFIG_BLK_DEV_COW_COMMON is not set
27459 +# CONFIG_BLK_DEV_LOOP is not set
27460 +# CONFIG_BLK_DEV_NBD is not set
27461 +# CONFIG_BLK_DEV_SX8 is not set
27462 +CONFIG_BLK_DEV_RAM=y
27463 +CONFIG_BLK_DEV_RAM_COUNT=16
27464 +CONFIG_BLK_DEV_RAM_SIZE=35000
27465 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
27466 +# CONFIG_CDROM_PKTCDVD is not set
27467 +# CONFIG_ATA_OVER_ETH is not set
27468 +# CONFIG_XILINX_SYSACE is not set
27469 +CONFIG_MISC_DEVICES=y
27470 +# CONFIG_PHANTOM is not set
27471 +# CONFIG_EEPROM_93CX6 is not set
27472 +# CONFIG_SGI_IOC4 is not set
27473 +# CONFIG_TIFM_CORE is not set
27474 +# CONFIG_IDE is not set
27475 +
27476 +#
27477 +# SCSI device support
27478 +#
27479 +# CONFIG_RAID_ATTRS is not set
27480 +# CONFIG_SCSI is not set
27481 +# CONFIG_SCSI_DMA is not set
27482 +# CONFIG_SCSI_NETLINK is not set
27483 +# CONFIG_ATA is not set
27484 +# CONFIG_MD is not set
27485 +# CONFIG_FUSION is not set
27486 +
27487 +#
27488 +# IEEE 1394 (FireWire) support
27489 +#
27490 +# CONFIG_FIREWIRE is not set
27491 +# CONFIG_IEEE1394 is not set
27492 +# CONFIG_I2O is not set
27493 +CONFIG_MACINTOSH_DRIVERS=y
27494 +# CONFIG_MAC_EMUMOUSEBTN is not set
27495 +# CONFIG_WINDFARM is not set
27496 +CONFIG_NETDEVICES=y
27497 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
27498 +# CONFIG_DUMMY is not set
27499 +# CONFIG_BONDING is not set
27500 +# CONFIG_MACVLAN is not set
27501 +# CONFIG_EQUALIZER is not set
27502 +# CONFIG_TUN is not set
27503 +# CONFIG_VETH is not set
27504 +# CONFIG_IP1000 is not set
27505 +# CONFIG_ARCNET is not set
27506 +# CONFIG_PHYLIB is not set
27507 +CONFIG_NET_ETHERNET=y
27508 +# CONFIG_MII is not set
27509 +# CONFIG_HAPPYMEAL is not set
27510 +# CONFIG_SUNGEM is not set
27511 +# CONFIG_CASSINI is not set
27512 +# CONFIG_NET_VENDOR_3COM is not set
27513 +# CONFIG_NET_TULIP is not set
27514 +# CONFIG_HP100 is not set
27515 +CONFIG_IBM_NEW_EMAC=y
27516 +CONFIG_IBM_NEW_EMAC_RXB=128
27517 +CONFIG_IBM_NEW_EMAC_TXB=64
27518 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
27519 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
27520 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
27521 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
27522 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
27523 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
27524 +# CONFIG_IBM_NEW_EMAC_TAH is not set
27525 +CONFIG_IBM_NEW_EMAC_EMAC4=y
27526 +# CONFIG_NET_PCI is not set
27527 +# CONFIG_B44 is not set
27528 +CONFIG_NETDEV_1000=y
27529 +# CONFIG_ACENIC is not set
27530 +# CONFIG_DL2K is not set
27531 +# CONFIG_E1000 is not set
27532 +# CONFIG_E1000E is not set
27533 +# CONFIG_NS83820 is not set
27534 +# CONFIG_HAMACHI is not set
27535 +# CONFIG_YELLOWFIN is not set
27536 +# CONFIG_R8169 is not set
27537 +# CONFIG_SIS190 is not set
27538 +# CONFIG_SKGE is not set
27539 +# CONFIG_SKY2 is not set
27540 +# CONFIG_SK98LIN is not set
27541 +# CONFIG_VIA_VELOCITY is not set
27542 +# CONFIG_TIGON3 is not set
27543 +# CONFIG_BNX2 is not set
27544 +# CONFIG_QLA3XXX is not set
27545 +# CONFIG_ATL1 is not set
27546 +CONFIG_NETDEV_10000=y
27547 +# CONFIG_CHELSIO_T1 is not set
27548 +# CONFIG_CHELSIO_T3 is not set
27549 +# CONFIG_IXGBE is not set
27550 +# CONFIG_IXGB is not set
27551 +# CONFIG_S2IO is not set
27552 +# CONFIG_MYRI10GE is not set
27553 +# CONFIG_NETXEN_NIC is not set
27554 +# CONFIG_NIU is not set
27555 +# CONFIG_MLX4_CORE is not set
27556 +# CONFIG_TEHUTI is not set
27557 +# CONFIG_TR is not set
27558 +
27559 +#
27560 +# Wireless LAN
27561 +#
27562 +# CONFIG_WLAN_PRE80211 is not set
27563 +# CONFIG_WLAN_80211 is not set
27564 +# CONFIG_WAN is not set
27565 +# CONFIG_FDDI is not set
27566 +# CONFIG_HIPPI is not set
27567 +# CONFIG_PPP is not set
27568 +# CONFIG_SLIP is not set
27569 +# CONFIG_SHAPER is not set
27570 +# CONFIG_NETCONSOLE is not set
27571 +# CONFIG_NETPOLL is not set
27572 +# CONFIG_NET_POLL_CONTROLLER is not set
27573 +# CONFIG_ISDN is not set
27574 +# CONFIG_PHONE is not set
27575 +
27576 +#
27577 +# Input device support
27578 +#
27579 +# CONFIG_INPUT is not set
27580 +
27581 +#
27582 +# Hardware I/O ports
27583 +#
27584 +# CONFIG_SERIO is not set
27585 +# CONFIG_GAMEPORT is not set
27586 +
27587 +#
27588 +# Character devices
27589 +#
27590 +# CONFIG_VT is not set
27591 +# CONFIG_SERIAL_NONSTANDARD is not set
27592 +
27593 +#
27594 +# Serial drivers
27595 +#
27596 +CONFIG_SERIAL_8250=y
27597 +CONFIG_SERIAL_8250_CONSOLE=y
27598 +# CONFIG_SERIAL_8250_PCI is not set
27599 +CONFIG_SERIAL_8250_NR_UARTS=4
27600 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
27601 +CONFIG_SERIAL_8250_EXTENDED=y
27602 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
27603 +CONFIG_SERIAL_8250_SHARE_IRQ=y
27604 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
27605 +# CONFIG_SERIAL_8250_RSA is not set
27606 +
27607 +#
27608 +# Non-8250 serial port support
27609 +#
27610 +# CONFIG_SERIAL_UARTLITE is not set
27611 +CONFIG_SERIAL_CORE=y
27612 +CONFIG_SERIAL_CORE_CONSOLE=y
27613 +# CONFIG_SERIAL_JSM is not set
27614 +CONFIG_SERIAL_OF_PLATFORM=y
27615 +CONFIG_UNIX98_PTYS=y
27616 +CONFIG_LEGACY_PTYS=y
27617 +CONFIG_LEGACY_PTY_COUNT=256
27618 +# CONFIG_IPMI_HANDLER is not set
27619 +# CONFIG_HW_RANDOM is not set
27620 +# CONFIG_NVRAM is not set
27621 +# CONFIG_GEN_RTC is not set
27622 +# CONFIG_R3964 is not set
27623 +# CONFIG_APPLICOM is not set
27624 +# CONFIG_RAW_DRIVER is not set
27625 +# CONFIG_TCG_TPM is not set
27626 +CONFIG_DEVPORT=y
27627 +# CONFIG_I2C is not set
27628 +
27629 +#
27630 +# SPI support
27631 +#
27632 +# CONFIG_SPI is not set
27633 +# CONFIG_SPI_MASTER is not set
27634 +# CONFIG_W1 is not set
27635 +# CONFIG_POWER_SUPPLY is not set
27636 +# CONFIG_HWMON is not set
27637 +# CONFIG_WATCHDOG is not set
27638 +
27639 +#
27640 +# Sonics Silicon Backplane
27641 +#
27642 +CONFIG_SSB_POSSIBLE=y
27643 +# CONFIG_SSB is not set
27644 +
27645 +#
27646 +# Multifunction device drivers
27647 +#
27648 +# CONFIG_MFD_SM501 is not set
27649 +
27650 +#
27651 +# Multimedia devices
27652 +#
27653 +# CONFIG_VIDEO_DEV is not set
27654 +# CONFIG_DVB_CORE is not set
27655 +CONFIG_DAB=y
27656 +
27657 +#
27658 +# Graphics support
27659 +#
27660 +# CONFIG_AGP is not set
27661 +# CONFIG_DRM is not set
27662 +# CONFIG_VGASTATE is not set
27663 +CONFIG_VIDEO_OUTPUT_CONTROL=m
27664 +# CONFIG_FB is not set
27665 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
27666 +
27667 +#
27668 +# Display device support
27669 +#
27670 +# CONFIG_DISPLAY_SUPPORT is not set
27671 +
27672 +#
27673 +# Sound
27674 +#
27675 +# CONFIG_SOUND is not set
27676 +CONFIG_USB_SUPPORT=y
27677 +CONFIG_USB_ARCH_HAS_HCD=y
27678 +CONFIG_USB_ARCH_HAS_OHCI=y
27679 +CONFIG_USB_ARCH_HAS_EHCI=y
27680 +# CONFIG_USB is not set
27681 +
27682 +#
27683 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
27684 +#
27685 +
27686 +#
27687 +# USB Gadget Support
27688 +#
27689 +# CONFIG_USB_GADGET is not set
27690 +# CONFIG_MMC is not set
27691 +# CONFIG_NEW_LEDS is not set
27692 +# CONFIG_INFINIBAND is not set
27693 +# CONFIG_EDAC is not set
27694 +# CONFIG_RTC_CLASS is not set
27695 +
27696 +#
27697 +# Userspace I/O
27698 +#
27699 +# CONFIG_UIO is not set
27700 +
27701 +#
27702 +# File systems
27703 +#
27704 +CONFIG_EXT2_FS=y
27705 +# CONFIG_EXT2_FS_XATTR is not set
27706 +# CONFIG_EXT2_FS_XIP is not set
27707 +# CONFIG_EXT3_FS is not set
27708 +# CONFIG_EXT4DEV_FS is not set
27709 +# CONFIG_REISERFS_FS is not set
27710 +# CONFIG_JFS_FS is not set
27711 +# CONFIG_FS_POSIX_ACL is not set
27712 +# CONFIG_XFS_FS is not set
27713 +# CONFIG_GFS2_FS is not set
27714 +# CONFIG_OCFS2_FS is not set
27715 +# CONFIG_MINIX_FS is not set
27716 +# CONFIG_ROMFS_FS is not set
27717 +CONFIG_INOTIFY=y
27718 +CONFIG_INOTIFY_USER=y
27719 +# CONFIG_QUOTA is not set
27720 +CONFIG_DNOTIFY=y
27721 +# CONFIG_AUTOFS_FS is not set
27722 +# CONFIG_AUTOFS4_FS is not set
27723 +# CONFIG_FUSE_FS is not set
27724 +
27725 +#
27726 +# CD-ROM/DVD Filesystems
27727 +#
27728 +# CONFIG_ISO9660_FS is not set
27729 +# CONFIG_UDF_FS is not set
27730 +
27731 +#
27732 +# DOS/FAT/NT Filesystems
27733 +#
27734 +# CONFIG_MSDOS_FS is not set
27735 +# CONFIG_VFAT_FS is not set
27736 +# CONFIG_NTFS_FS is not set
27737 +
27738 +#
27739 +# Pseudo filesystems
27740 +#
27741 +CONFIG_PROC_FS=y
27742 +CONFIG_PROC_KCORE=y
27743 +CONFIG_PROC_SYSCTL=y
27744 +CONFIG_SYSFS=y
27745 +CONFIG_TMPFS=y
27746 +# CONFIG_TMPFS_POSIX_ACL is not set
27747 +# CONFIG_HUGETLB_PAGE is not set
27748 +# CONFIG_CONFIGFS_FS is not set
27749 +
27750 +#
27751 +# Miscellaneous filesystems
27752 +#
27753 +# CONFIG_ADFS_FS is not set
27754 +# CONFIG_AFFS_FS is not set
27755 +# CONFIG_HFS_FS is not set
27756 +# CONFIG_HFSPLUS_FS is not set
27757 +# CONFIG_BEFS_FS is not set
27758 +# CONFIG_BFS_FS is not set
27759 +# CONFIG_EFS_FS is not set
27760 +CONFIG_CRAMFS=y
27761 +# CONFIG_VXFS_FS is not set
27762 +# CONFIG_HPFS_FS is not set
27763 +# CONFIG_QNX4FS_FS is not set
27764 +# CONFIG_SYSV_FS is not set
27765 +# CONFIG_UFS_FS is not set
27766 +CONFIG_NETWORK_FILESYSTEMS=y
27767 +CONFIG_NFS_FS=y
27768 +CONFIG_NFS_V3=y
27769 +# CONFIG_NFS_V3_ACL is not set
27770 +# CONFIG_NFS_V4 is not set
27771 +# CONFIG_NFS_DIRECTIO is not set
27772 +# CONFIG_NFSD is not set
27773 +CONFIG_ROOT_NFS=y
27774 +CONFIG_LOCKD=y
27775 +CONFIG_LOCKD_V4=y
27776 +CONFIG_NFS_COMMON=y
27777 +CONFIG_SUNRPC=y
27778 +# CONFIG_SUNRPC_BIND34 is not set
27779 +# CONFIG_RPCSEC_GSS_KRB5 is not set
27780 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
27781 +# CONFIG_SMB_FS is not set
27782 +# CONFIG_CIFS is not set
27783 +# CONFIG_NCP_FS is not set
27784 +# CONFIG_CODA_FS is not set
27785 +# CONFIG_AFS_FS is not set
27786 +
27787 +#
27788 +# Partition Types
27789 +#
27790 +# CONFIG_PARTITION_ADVANCED is not set
27791 +CONFIG_MSDOS_PARTITION=y
27792 +# CONFIG_NLS is not set
27793 +# CONFIG_DLM is not set
27794 +# CONFIG_UCC_SLOW is not set
27795 +
27796 +#
27797 +# Library routines
27798 +#
27799 +CONFIG_BITREVERSE=y
27800 +# CONFIG_CRC_CCITT is not set
27801 +# CONFIG_CRC16 is not set
27802 +# CONFIG_CRC_ITU_T is not set
27803 +CONFIG_CRC32=y
27804 +# CONFIG_CRC7 is not set
27805 +# CONFIG_LIBCRC32C is not set
27806 +CONFIG_ZLIB_INFLATE=y
27807 +CONFIG_PLIST=y
27808 +CONFIG_HAS_IOMEM=y
27809 +CONFIG_HAS_IOPORT=y
27810 +CONFIG_HAS_DMA=y
27811 +CONFIG_INSTRUMENTATION=y
27812 +# CONFIG_PROFILING is not set
27813 +# CONFIG_KPROBES is not set
27814 +# CONFIG_MARKERS is not set
27815 +
27816 +#
27817 +# Kernel hacking
27818 +#
27819 +# CONFIG_PRINTK_TIME is not set
27820 +CONFIG_ENABLE_WARN_DEPRECATED=y
27821 +CONFIG_ENABLE_MUST_CHECK=y
27822 +CONFIG_MAGIC_SYSRQ=y
27823 +# CONFIG_UNUSED_SYMBOLS is not set
27824 +# CONFIG_DEBUG_FS is not set
27825 +# CONFIG_HEADERS_CHECK is not set
27826 +CONFIG_DEBUG_KERNEL=y
27827 +# CONFIG_DEBUG_SHIRQ is not set
27828 +CONFIG_DETECT_SOFTLOCKUP=y
27829 +CONFIG_SCHED_DEBUG=y
27830 +# CONFIG_SCHEDSTATS is not set
27831 +# CONFIG_TIMER_STATS is not set
27832 +# CONFIG_SLUB_DEBUG_ON is not set
27833 +# CONFIG_DEBUG_RT_MUTEXES is not set
27834 +# CONFIG_RT_MUTEX_TESTER is not set
27835 +# CONFIG_DEBUG_SPINLOCK is not set
27836 +# CONFIG_DEBUG_MUTEXES is not set
27837 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
27838 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
27839 +# CONFIG_DEBUG_KOBJECT is not set
27840 +# CONFIG_DEBUG_BUGVERBOSE is not set
27841 +# CONFIG_DEBUG_INFO is not set
27842 +# CONFIG_DEBUG_VM is not set
27843 +# CONFIG_DEBUG_LIST is not set
27844 +# CONFIG_DEBUG_SG is not set
27845 +CONFIG_FORCED_INLINING=y
27846 +# CONFIG_BOOT_PRINTK_DELAY is not set
27847 +# CONFIG_RCU_TORTURE_TEST is not set
27848 +# CONFIG_FAULT_INJECTION is not set
27849 +# CONFIG_SAMPLES is not set
27850 +# CONFIG_DEBUG_STACKOVERFLOW is not set
27851 +# CONFIG_DEBUG_STACK_USAGE is not set
27852 +# CONFIG_DEBUG_PAGEALLOC is not set
27853 +CONFIG_DEBUGGER=y
27854 +# CONFIG_KGDB is not set
27855 +# CONFIG_XMON is not set
27856 +# CONFIG_BDI_SWITCH is not set
27857 +# CONFIG_PPC_EARLY_DEBUG is not set
27858 +
27859 +#
27860 +# Security options
27861 +#
27862 +# CONFIG_KEYS is not set
27863 +# CONFIG_SECURITY is not set
27864 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
27865 +CONFIG_CRYPTO=y
27866 +CONFIG_CRYPTO_ALGAPI=y
27867 +CONFIG_CRYPTO_BLKCIPHER=y
27868 +CONFIG_CRYPTO_MANAGER=y
27869 +# CONFIG_CRYPTO_HMAC is not set
27870 +# CONFIG_CRYPTO_XCBC is not set
27871 +# CONFIG_CRYPTO_NULL is not set
27872 +# CONFIG_CRYPTO_MD4 is not set
27873 +CONFIG_CRYPTO_MD5=y
27874 +# CONFIG_CRYPTO_SHA1 is not set
27875 +# CONFIG_CRYPTO_SHA256 is not set
27876 +# CONFIG_CRYPTO_SHA512 is not set
27877 +# CONFIG_CRYPTO_WP512 is not set
27878 +# CONFIG_CRYPTO_TGR192 is not set
27879 +# CONFIG_CRYPTO_GF128MUL is not set
27880 +CONFIG_CRYPTO_ECB=y
27881 +CONFIG_CRYPTO_CBC=y
27882 +CONFIG_CRYPTO_PCBC=y
27883 +# CONFIG_CRYPTO_LRW is not set
27884 +# CONFIG_CRYPTO_XTS is not set
27885 +# CONFIG_CRYPTO_CRYPTD is not set
27886 +CONFIG_CRYPTO_DES=y
27887 +# CONFIG_CRYPTO_FCRYPT is not set
27888 +# CONFIG_CRYPTO_BLOWFISH is not set
27889 +# CONFIG_CRYPTO_TWOFISH is not set
27890 +# CONFIG_CRYPTO_SERPENT is not set
27891 +# CONFIG_CRYPTO_AES is not set
27892 +# CONFIG_CRYPTO_CAST5 is not set
27893 +# CONFIG_CRYPTO_CAST6 is not set
27894 +# CONFIG_CRYPTO_TEA is not set
27895 +# CONFIG_CRYPTO_ARC4 is not set
27896 +# CONFIG_CRYPTO_KHAZAD is not set
27897 +# CONFIG_CRYPTO_ANUBIS is not set
27898 +# CONFIG_CRYPTO_SEED is not set
27899 +# CONFIG_CRYPTO_DEFLATE is not set
27900 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
27901 +# CONFIG_CRYPTO_CRC32C is not set
27902 +# CONFIG_CRYPTO_CAMELLIA is not set
27903 +# CONFIG_CRYPTO_TEST is not set
27904 +# CONFIG_CRYPTO_AUTHENC is not set
27905 +CONFIG_CRYPTO_HW=y
27906 +# CONFIG_PPC_CLOCK is not set
27907 Index: linux-2.6.24.7/arch/powerpc/configs/kilauea_defconfig
27908 ===================================================================
27909 --- linux-2.6.24.7.orig/arch/powerpc/configs/kilauea_defconfig
27910 +++ linux-2.6.24.7/arch/powerpc/configs/kilauea_defconfig
27911 @@ -1,7 +1,7 @@
27912  #
27913  # Automatically generated make config: don't edit
27914 -# Linux kernel version: 2.6.24-rc4
27915 -# Thu Dec  6 16:48:20 2007
27916 +# Linux kernel version: 2.6.24-rc6
27917 +# Thu Jan  3 14:21:31 2008
27918  #
27919  # CONFIG_PPC64 is not set
27920  
27921 @@ -40,7 +40,7 @@ CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
27922  CONFIG_ARCH_MAY_HAVE_PC_FDC=y
27923  CONFIG_PPC_OF=y
27924  CONFIG_OF=y
27925 -# CONFIG_PPC_UDBG_16550 is not set
27926 +CONFIG_PPC_UDBG_16550=y
27927  # CONFIG_GENERIC_TBSYNC is not set
27928  CONFIG_AUDIT_ARCH=y
27929  CONFIG_GENERIC_BUG=y
27930 @@ -125,6 +125,7 @@ CONFIG_DEFAULT_AS=y
27931  # CONFIG_DEFAULT_CFQ is not set
27932  # CONFIG_DEFAULT_NOOP is not set
27933  CONFIG_DEFAULT_IOSCHED="anticipatory"
27934 +CONFIG_PPC4xx_PCI_EXPRESS=y
27935  
27936  #
27937  # Platform support
27938 @@ -134,9 +135,12 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
27939  # CONFIG_PPC_CELL is not set
27940  # CONFIG_PPC_CELL_NATIVE is not set
27941  # CONFIG_PQ2ADS is not set
27942 +# CONFIG_EP405 is not set
27943  CONFIG_KILAUEA=y
27944 +# CONFIG_MAKALU is not set
27945  # CONFIG_WALNUT is not set
27946  # CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
27947 +CONFIG_405EX=y
27948  # CONFIG_MPIC is not set
27949  # CONFIG_MPIC_WEIRD is not set
27950  # CONFIG_PPC_I8259 is not set
27951 @@ -199,11 +203,17 @@ CONFIG_ISA_DMA_API=y
27952  # Bus options
27953  #
27954  CONFIG_ZONE_DMA=y
27955 -# CONFIG_PCI is not set
27956 -# CONFIG_PCI_DOMAINS is not set
27957 -# CONFIG_PCI_SYSCALL is not set
27958 -# CONFIG_ARCH_SUPPORTS_MSI is not set
27959 +CONFIG_PPC_INDIRECT_PCI=y
27960 +CONFIG_PCI=y
27961 +CONFIG_PCI_DOMAINS=y
27962 +CONFIG_PCI_SYSCALL=y
27963 +# CONFIG_PCIEPORTBUS is not set
27964 +CONFIG_ARCH_SUPPORTS_MSI=y
27965 +# CONFIG_PCI_MSI is not set
27966 +CONFIG_PCI_LEGACY=y
27967 +# CONFIG_PCI_DEBUG is not set
27968  # CONFIG_PCCARD is not set
27969 +# CONFIG_HOTPLUG_PCI is not set
27970  
27971  #
27972  # Advanced setup
27973 @@ -368,11 +378,13 @@ CONFIG_MTD_CFI_UTIL=y
27974  # CONFIG_MTD_COMPLEX_MAPPINGS is not set
27975  # CONFIG_MTD_PHYSMAP is not set
27976  CONFIG_MTD_PHYSMAP_OF=y
27977 +# CONFIG_MTD_INTEL_VR_NOR is not set
27978  # CONFIG_MTD_PLATRAM is not set
27979  
27980  #
27981  # Self-contained MTD device drivers
27982  #
27983 +# CONFIG_MTD_PMC551 is not set
27984  # CONFIG_MTD_SLRAM is not set
27985  # CONFIG_MTD_PHRAM is not set
27986  # CONFIG_MTD_MTDRAM is not set
27987 @@ -395,9 +407,14 @@ CONFIG_OF_DEVICE=y
27988  # CONFIG_PARPORT is not set
27989  CONFIG_BLK_DEV=y
27990  # CONFIG_BLK_DEV_FD is not set
27991 +# CONFIG_BLK_CPQ_DA is not set
27992 +# CONFIG_BLK_CPQ_CISS_DA is not set
27993 +# CONFIG_BLK_DEV_DAC960 is not set
27994 +# CONFIG_BLK_DEV_UMEM is not set
27995  # CONFIG_BLK_DEV_COW_COMMON is not set
27996  # CONFIG_BLK_DEV_LOOP is not set
27997  # CONFIG_BLK_DEV_NBD is not set
27998 +# CONFIG_BLK_DEV_SX8 is not set
27999  CONFIG_BLK_DEV_RAM=y
28000  CONFIG_BLK_DEV_RAM_COUNT=16
28001  CONFIG_BLK_DEV_RAM_SIZE=35000
28002 @@ -417,6 +434,14 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
28003  # CONFIG_SCSI_NETLINK is not set
28004  # CONFIG_ATA is not set
28005  # CONFIG_MD is not set
28006 +# CONFIG_FUSION is not set
28007 +
28008 +#
28009 +# IEEE 1394 (FireWire) support
28010 +#
28011 +# CONFIG_FIREWIRE is not set
28012 +# CONFIG_IEEE1394 is not set
28013 +# CONFIG_I2O is not set
28014  # CONFIG_MACINTOSH_DRIVERS is not set
28015  CONFIG_NETDEVICES=y
28016  # CONFIG_NETDEVICES_MULTIQUEUE is not set
28017 @@ -426,9 +451,33 @@ CONFIG_NETDEVICES=y
28018  # CONFIG_EQUALIZER is not set
28019  # CONFIG_TUN is not set
28020  # CONFIG_VETH is not set
28021 -# CONFIG_NET_ETHERNET is not set
28022 +# CONFIG_IP1000 is not set
28023 +# CONFIG_ARCNET is not set
28024 +# CONFIG_PHYLIB is not set
28025 +CONFIG_NET_ETHERNET=y
28026 +# CONFIG_MII is not set
28027 +# CONFIG_HAPPYMEAL is not set
28028 +# CONFIG_SUNGEM is not set
28029 +# CONFIG_CASSINI is not set
28030 +# CONFIG_NET_VENDOR_3COM is not set
28031 +# CONFIG_NET_TULIP is not set
28032 +# CONFIG_HP100 is not set
28033 +CONFIG_IBM_NEW_EMAC=y
28034 +CONFIG_IBM_NEW_EMAC_RXB=256
28035 +CONFIG_IBM_NEW_EMAC_TXB=256
28036 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
28037 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
28038 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
28039 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
28040 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
28041 +CONFIG_IBM_NEW_EMAC_RGMII=y
28042 +# CONFIG_IBM_NEW_EMAC_TAH is not set
28043 +CONFIG_IBM_NEW_EMAC_EMAC4=y
28044 +# CONFIG_NET_PCI is not set
28045 +# CONFIG_B44 is not set
28046  # CONFIG_NETDEV_1000 is not set
28047  # CONFIG_NETDEV_10000 is not set
28048 +# CONFIG_TR is not set
28049  
28050  #
28051  # Wireless LAN
28052 @@ -436,6 +485,8 @@ CONFIG_NETDEVICES=y
28053  # CONFIG_WLAN_PRE80211 is not set
28054  # CONFIG_WLAN_80211 is not set
28055  # CONFIG_WAN is not set
28056 +# CONFIG_FDDI is not set
28057 +# CONFIG_HIPPI is not set
28058  # CONFIG_PPP is not set
28059  # CONFIG_SLIP is not set
28060  # CONFIG_SHAPER is not set
28061 @@ -467,6 +518,7 @@ CONFIG_NETDEVICES=y
28062  #
28063  CONFIG_SERIAL_8250=y
28064  CONFIG_SERIAL_8250_CONSOLE=y
28065 +CONFIG_SERIAL_8250_PCI=y
28066  CONFIG_SERIAL_8250_NR_UARTS=4
28067  CONFIG_SERIAL_8250_RUNTIME_UARTS=4
28068  CONFIG_SERIAL_8250_EXTENDED=y
28069 @@ -481,6 +533,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
28070  # CONFIG_SERIAL_UARTLITE is not set
28071  CONFIG_SERIAL_CORE=y
28072  CONFIG_SERIAL_CORE_CONSOLE=y
28073 +# CONFIG_SERIAL_JSM is not set
28074  CONFIG_SERIAL_OF_PLATFORM=y
28075  CONFIG_UNIX98_PTYS=y
28076  CONFIG_LEGACY_PTYS=y
28077 @@ -490,8 +543,10 @@ CONFIG_LEGACY_PTY_COUNT=256
28078  # CONFIG_NVRAM is not set
28079  # CONFIG_GEN_RTC is not set
28080  # CONFIG_R3964 is not set
28081 +# CONFIG_APPLICOM is not set
28082  # CONFIG_RAW_DRIVER is not set
28083  # CONFIG_TCG_TPM is not set
28084 +CONFIG_DEVPORT=y
28085  # CONFIG_I2C is not set
28086  
28087  #
28088 @@ -525,6 +580,8 @@ CONFIG_SSB_POSSIBLE=y
28089  #
28090  # Graphics support
28091  #
28092 +# CONFIG_AGP is not set
28093 +# CONFIG_DRM is not set
28094  # CONFIG_VGASTATE is not set
28095  # CONFIG_VIDEO_OUTPUT_CONTROL is not set
28096  # CONFIG_FB is not set
28097 @@ -542,6 +599,7 @@ CONFIG_SSB_POSSIBLE=y
28098  # CONFIG_USB_SUPPORT is not set
28099  # CONFIG_MMC is not set
28100  # CONFIG_NEW_LEDS is not set
28101 +# CONFIG_INFINIBAND is not set
28102  # CONFIG_EDAC is not set
28103  # CONFIG_RTC_CLASS is not set
28104  
28105 Index: linux-2.6.24.7/arch/powerpc/configs/lite5200_defconfig
28106 ===================================================================
28107 --- linux-2.6.24.7.orig/arch/powerpc/configs/lite5200_defconfig
28108 +++ /dev/null
28109 @@ -1,847 +0,0 @@
28110 -#
28111 -# Automatically generated make config: don't edit
28112 -# Linux kernel version: 2.6.24-rc4
28113 -# Thu Dec  6 16:48:24 2007
28114 -#
28115 -# CONFIG_PPC64 is not set
28116 -
28117 -#
28118 -# Processor support
28119 -#
28120 -CONFIG_6xx=y
28121 -# CONFIG_PPC_85xx is not set
28122 -# CONFIG_PPC_8xx is not set
28123 -# CONFIG_40x is not set
28124 -# CONFIG_44x is not set
28125 -# CONFIG_E200 is not set
28126 -CONFIG_PPC_FPU=y
28127 -# CONFIG_ALTIVEC is not set
28128 -CONFIG_PPC_STD_MMU=y
28129 -CONFIG_PPC_STD_MMU_32=y
28130 -# CONFIG_PPC_MM_SLICES is not set
28131 -# CONFIG_SMP is not set
28132 -CONFIG_PPC32=y
28133 -CONFIG_WORD_SIZE=32
28134 -CONFIG_PPC_MERGE=y
28135 -CONFIG_MMU=y
28136 -CONFIG_GENERIC_CMOS_UPDATE=y
28137 -CONFIG_GENERIC_TIME=y
28138 -CONFIG_GENERIC_TIME_VSYSCALL=y
28139 -CONFIG_GENERIC_CLOCKEVENTS=y
28140 -CONFIG_GENERIC_HARDIRQS=y
28141 -CONFIG_IRQ_PER_CPU=y
28142 -CONFIG_RWSEM_XCHGADD_ALGORITHM=y
28143 -CONFIG_ARCH_HAS_ILOG2_U32=y
28144 -CONFIG_GENERIC_HWEIGHT=y
28145 -CONFIG_GENERIC_CALIBRATE_DELAY=y
28146 -CONFIG_GENERIC_FIND_NEXT_BIT=y
28147 -# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
28148 -CONFIG_PPC=y
28149 -CONFIG_EARLY_PRINTK=y
28150 -CONFIG_GENERIC_NVRAM=y
28151 -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
28152 -CONFIG_ARCH_MAY_HAVE_PC_FDC=y
28153 -CONFIG_PPC_OF=y
28154 -CONFIG_OF=y
28155 -# CONFIG_PPC_UDBG_16550 is not set
28156 -# CONFIG_GENERIC_TBSYNC is not set
28157 -CONFIG_AUDIT_ARCH=y
28158 -CONFIG_GENERIC_BUG=y
28159 -# CONFIG_DEFAULT_UIMAGE is not set
28160 -# CONFIG_PPC_DCR_NATIVE is not set
28161 -# CONFIG_PPC_DCR_MMIO is not set
28162 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28163 -
28164 -#
28165 -# General setup
28166 -#
28167 -CONFIG_EXPERIMENTAL=y
28168 -CONFIG_BROKEN_ON_SMP=y
28169 -CONFIG_INIT_ENV_ARG_LIMIT=32
28170 -CONFIG_LOCALVERSION=""
28171 -CONFIG_LOCALVERSION_AUTO=y
28172 -CONFIG_SWAP=y
28173 -CONFIG_SYSVIPC=y
28174 -CONFIG_SYSVIPC_SYSCTL=y
28175 -# CONFIG_POSIX_MQUEUE is not set
28176 -# CONFIG_BSD_PROCESS_ACCT is not set
28177 -# CONFIG_TASKSTATS is not set
28178 -# CONFIG_USER_NS is not set
28179 -# CONFIG_PID_NS is not set
28180 -# CONFIG_AUDIT is not set
28181 -# CONFIG_IKCONFIG is not set
28182 -CONFIG_LOG_BUF_SHIFT=14
28183 -# CONFIG_CGROUPS is not set
28184 -# CONFIG_FAIR_GROUP_SCHED is not set
28185 -CONFIG_SYSFS_DEPRECATED=y
28186 -# CONFIG_RELAY is not set
28187 -CONFIG_BLK_DEV_INITRD=y
28188 -CONFIG_INITRAMFS_SOURCE=""
28189 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
28190 -CONFIG_SYSCTL=y
28191 -CONFIG_EMBEDDED=y
28192 -# CONFIG_SYSCTL_SYSCALL is not set
28193 -# CONFIG_KALLSYMS is not set
28194 -CONFIG_HOTPLUG=y
28195 -CONFIG_PRINTK=y
28196 -CONFIG_BUG=y
28197 -CONFIG_ELF_CORE=y
28198 -CONFIG_BASE_FULL=y
28199 -CONFIG_FUTEX=y
28200 -CONFIG_ANON_INODES=y
28201 -# CONFIG_EPOLL is not set
28202 -CONFIG_SIGNALFD=y
28203 -CONFIG_EVENTFD=y
28204 -CONFIG_SHMEM=y
28205 -CONFIG_VM_EVENT_COUNTERS=y
28206 -CONFIG_SLUB_DEBUG=y
28207 -# CONFIG_SLAB is not set
28208 -CONFIG_SLUB=y
28209 -# CONFIG_SLOB is not set
28210 -CONFIG_RT_MUTEXES=y
28211 -# CONFIG_TINY_SHMEM is not set
28212 -CONFIG_BASE_SMALL=0
28213 -CONFIG_MODULES=y
28214 -CONFIG_MODULE_UNLOAD=y
28215 -# CONFIG_MODULE_FORCE_UNLOAD is not set
28216 -# CONFIG_MODVERSIONS is not set
28217 -# CONFIG_MODULE_SRCVERSION_ALL is not set
28218 -# CONFIG_KMOD is not set
28219 -CONFIG_BLOCK=y
28220 -# CONFIG_LBD is not set
28221 -# CONFIG_BLK_DEV_IO_TRACE is not set
28222 -# CONFIG_LSF is not set
28223 -# CONFIG_BLK_DEV_BSG is not set
28224 -
28225 -#
28226 -# IO Schedulers
28227 -#
28228 -CONFIG_IOSCHED_NOOP=y
28229 -CONFIG_IOSCHED_AS=y
28230 -CONFIG_IOSCHED_DEADLINE=y
28231 -CONFIG_IOSCHED_CFQ=y
28232 -CONFIG_DEFAULT_AS=y
28233 -# CONFIG_DEFAULT_DEADLINE is not set
28234 -# CONFIG_DEFAULT_CFQ is not set
28235 -# CONFIG_DEFAULT_NOOP is not set
28236 -CONFIG_DEFAULT_IOSCHED="anticipatory"
28237 -
28238 -#
28239 -# Platform support
28240 -#
28241 -CONFIG_PPC_MULTIPLATFORM=y
28242 -# CONFIG_PPC_82xx is not set
28243 -# CONFIG_PPC_83xx is not set
28244 -# CONFIG_PPC_86xx is not set
28245 -CONFIG_CLASSIC32=y
28246 -# CONFIG_PPC_CHRP is not set
28247 -CONFIG_PPC_MPC52xx=y
28248 -CONFIG_PPC_MPC5200=y
28249 -CONFIG_PPC_MPC5200_BUGFIX=y
28250 -# CONFIG_PPC_EFIKA is not set
28251 -CONFIG_PPC_LITE5200=y
28252 -# CONFIG_PPC_PMAC is not set
28253 -# CONFIG_PPC_CELL is not set
28254 -# CONFIG_PPC_CELL_NATIVE is not set
28255 -# CONFIG_PQ2ADS is not set
28256 -# CONFIG_EMBEDDED6xx is not set
28257 -# CONFIG_MPIC is not set
28258 -# CONFIG_MPIC_WEIRD is not set
28259 -# CONFIG_PPC_I8259 is not set
28260 -# CONFIG_PPC_RTAS is not set
28261 -# CONFIG_MMIO_NVRAM is not set
28262 -# CONFIG_PPC_MPC106 is not set
28263 -# CONFIG_PPC_970_NAP is not set
28264 -# CONFIG_PPC_INDIRECT_IO is not set
28265 -# CONFIG_GENERIC_IOMAP is not set
28266 -# CONFIG_CPU_FREQ is not set
28267 -# CONFIG_TAU is not set
28268 -# CONFIG_CPM2 is not set
28269 -# CONFIG_FSL_ULI1575 is not set
28270 -CONFIG_PPC_BESTCOMM=y
28271 -CONFIG_PPC_BESTCOMM_ATA=y
28272 -CONFIG_PPC_BESTCOMM_FEC=y
28273 -CONFIG_PPC_BESTCOMM_GEN_BD=y
28274 -
28275 -#
28276 -# Kernel options
28277 -#
28278 -# CONFIG_HIGHMEM is not set
28279 -CONFIG_TICK_ONESHOT=y
28280 -CONFIG_NO_HZ=y
28281 -CONFIG_HIGH_RES_TIMERS=y
28282 -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
28283 -# CONFIG_HZ_100 is not set
28284 -CONFIG_HZ_250=y
28285 -# CONFIG_HZ_300 is not set
28286 -# CONFIG_HZ_1000 is not set
28287 -CONFIG_HZ=250
28288 -CONFIG_PREEMPT_NONE=y
28289 -# CONFIG_PREEMPT_VOLUNTARY is not set
28290 -# CONFIG_PREEMPT is not set
28291 -CONFIG_BINFMT_ELF=y
28292 -# CONFIG_BINFMT_MISC is not set
28293 -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
28294 -# CONFIG_KEXEC is not set
28295 -CONFIG_ARCH_FLATMEM_ENABLE=y
28296 -CONFIG_ARCH_POPULATES_NODE_MAP=y
28297 -CONFIG_SELECT_MEMORY_MODEL=y
28298 -CONFIG_FLATMEM_MANUAL=y
28299 -# CONFIG_DISCONTIGMEM_MANUAL is not set
28300 -# CONFIG_SPARSEMEM_MANUAL is not set
28301 -CONFIG_FLATMEM=y
28302 -CONFIG_FLAT_NODE_MEM_MAP=y
28303 -# CONFIG_SPARSEMEM_STATIC is not set
28304 -# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
28305 -CONFIG_SPLIT_PTLOCK_CPUS=4
28306 -# CONFIG_RESOURCES_64BIT is not set
28307 -CONFIG_ZONE_DMA_FLAG=1
28308 -CONFIG_BOUNCE=y
28309 -CONFIG_VIRT_TO_BUS=y
28310 -CONFIG_PROC_DEVICETREE=y
28311 -# CONFIG_CMDLINE_BOOL is not set
28312 -CONFIG_PM=y
28313 -# CONFIG_PM_LEGACY is not set
28314 -# CONFIG_PM_DEBUG is not set
28315 -CONFIG_PM_SLEEP=y
28316 -CONFIG_SUSPEND_UP_POSSIBLE=y
28317 -CONFIG_SUSPEND=y
28318 -CONFIG_HIBERNATION_UP_POSSIBLE=y
28319 -# CONFIG_HIBERNATION is not set
28320 -CONFIG_SECCOMP=y
28321 -CONFIG_WANT_DEVICE_TREE=y
28322 -CONFIG_DEVICE_TREE=""
28323 -CONFIG_ISA_DMA_API=y
28324 -
28325 -#
28326 -# Bus options
28327 -#
28328 -CONFIG_ZONE_DMA=y
28329 -CONFIG_GENERIC_ISA_DMA=y
28330 -# CONFIG_PPC_INDIRECT_PCI is not set
28331 -CONFIG_FSL_SOC=y
28332 -CONFIG_PCI=y
28333 -CONFIG_PCI_DOMAINS=y
28334 -CONFIG_PCI_SYSCALL=y
28335 -# CONFIG_PCIEPORTBUS is not set
28336 -CONFIG_ARCH_SUPPORTS_MSI=y
28337 -# CONFIG_PCI_MSI is not set
28338 -CONFIG_PCI_LEGACY=y
28339 -# CONFIG_PCI_DEBUG is not set
28340 -# CONFIG_PCCARD is not set
28341 -# CONFIG_HOTPLUG_PCI is not set
28342 -
28343 -#
28344 -# Advanced setup
28345 -#
28346 -# CONFIG_ADVANCED_OPTIONS is not set
28347 -
28348 -#
28349 -# Default settings for advanced configuration options are used
28350 -#
28351 -CONFIG_HIGHMEM_START=0xfe000000
28352 -CONFIG_LOWMEM_SIZE=0x30000000
28353 -CONFIG_KERNEL_START=0xc0000000
28354 -CONFIG_TASK_SIZE=0xc0000000
28355 -CONFIG_BOOT_LOAD=0x00800000
28356 -
28357 -#
28358 -# Networking
28359 -#
28360 -CONFIG_NET=y
28361 -
28362 -#
28363 -# Networking options
28364 -#
28365 -CONFIG_PACKET=y
28366 -# CONFIG_PACKET_MMAP is not set
28367 -CONFIG_UNIX=y
28368 -CONFIG_XFRM=y
28369 -CONFIG_XFRM_USER=m
28370 -# CONFIG_XFRM_SUB_POLICY is not set
28371 -# CONFIG_XFRM_MIGRATE is not set
28372 -# CONFIG_NET_KEY is not set
28373 -CONFIG_INET=y
28374 -CONFIG_IP_MULTICAST=y
28375 -# CONFIG_IP_ADVANCED_ROUTER is not set
28376 -CONFIG_IP_FIB_HASH=y
28377 -CONFIG_IP_PNP=y
28378 -CONFIG_IP_PNP_DHCP=y
28379 -CONFIG_IP_PNP_BOOTP=y
28380 -# CONFIG_IP_PNP_RARP is not set
28381 -# CONFIG_NET_IPIP is not set
28382 -# CONFIG_NET_IPGRE is not set
28383 -# CONFIG_IP_MROUTE is not set
28384 -# CONFIG_ARPD is not set
28385 -CONFIG_SYN_COOKIES=y
28386 -# CONFIG_INET_AH is not set
28387 -# CONFIG_INET_ESP is not set
28388 -# CONFIG_INET_IPCOMP is not set
28389 -# CONFIG_INET_XFRM_TUNNEL is not set
28390 -# CONFIG_INET_TUNNEL is not set
28391 -CONFIG_INET_XFRM_MODE_TRANSPORT=y
28392 -CONFIG_INET_XFRM_MODE_TUNNEL=y
28393 -CONFIG_INET_XFRM_MODE_BEET=y
28394 -# CONFIG_INET_LRO is not set
28395 -CONFIG_INET_DIAG=y
28396 -CONFIG_INET_TCP_DIAG=y
28397 -# CONFIG_TCP_CONG_ADVANCED is not set
28398 -CONFIG_TCP_CONG_CUBIC=y
28399 -CONFIG_DEFAULT_TCP_CONG="cubic"
28400 -# CONFIG_TCP_MD5SIG is not set
28401 -# CONFIG_IPV6 is not set
28402 -# CONFIG_INET6_XFRM_TUNNEL is not set
28403 -# CONFIG_INET6_TUNNEL is not set
28404 -# CONFIG_NETWORK_SECMARK is not set
28405 -# CONFIG_NETFILTER is not set
28406 -# CONFIG_IP_DCCP is not set
28407 -# CONFIG_IP_SCTP is not set
28408 -# CONFIG_TIPC is not set
28409 -# CONFIG_ATM is not set
28410 -# CONFIG_BRIDGE is not set
28411 -# CONFIG_VLAN_8021Q is not set
28412 -# CONFIG_DECNET is not set
28413 -# CONFIG_LLC2 is not set
28414 -# CONFIG_IPX is not set
28415 -# CONFIG_ATALK is not set
28416 -# CONFIG_X25 is not set
28417 -# CONFIG_LAPB is not set
28418 -# CONFIG_ECONET is not set
28419 -# CONFIG_WAN_ROUTER is not set
28420 -# CONFIG_NET_SCHED is not set
28421 -
28422 -#
28423 -# Network testing
28424 -#
28425 -# CONFIG_NET_PKTGEN is not set
28426 -# CONFIG_HAMRADIO is not set
28427 -# CONFIG_IRDA is not set
28428 -# CONFIG_BT is not set
28429 -# CONFIG_AF_RXRPC is not set
28430 -
28431 -#
28432 -# Wireless
28433 -#
28434 -# CONFIG_CFG80211 is not set
28435 -# CONFIG_WIRELESS_EXT is not set
28436 -# CONFIG_MAC80211 is not set
28437 -# CONFIG_IEEE80211 is not set
28438 -# CONFIG_RFKILL is not set
28439 -# CONFIG_NET_9P is not set
28440 -
28441 -#
28442 -# Device Drivers
28443 -#
28444 -
28445 -#
28446 -# Generic Driver Options
28447 -#
28448 -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
28449 -CONFIG_STANDALONE=y
28450 -CONFIG_PREVENT_FIRMWARE_BUILD=y
28451 -# CONFIG_FW_LOADER is not set
28452 -# CONFIG_DEBUG_DRIVER is not set
28453 -# CONFIG_DEBUG_DEVRES is not set
28454 -# CONFIG_SYS_HYPERVISOR is not set
28455 -# CONFIG_CONNECTOR is not set
28456 -# CONFIG_MTD is not set
28457 -CONFIG_OF_DEVICE=y
28458 -# CONFIG_PARPORT is not set
28459 -CONFIG_BLK_DEV=y
28460 -# CONFIG_BLK_DEV_FD is not set
28461 -# CONFIG_BLK_CPQ_DA is not set
28462 -# CONFIG_BLK_CPQ_CISS_DA is not set
28463 -# CONFIG_BLK_DEV_DAC960 is not set
28464 -# CONFIG_BLK_DEV_UMEM is not set
28465 -# CONFIG_BLK_DEV_COW_COMMON is not set
28466 -CONFIG_BLK_DEV_LOOP=y
28467 -# CONFIG_BLK_DEV_CRYPTOLOOP is not set
28468 -# CONFIG_BLK_DEV_NBD is not set
28469 -# CONFIG_BLK_DEV_SX8 is not set
28470 -CONFIG_BLK_DEV_RAM=y
28471 -CONFIG_BLK_DEV_RAM_COUNT=16
28472 -CONFIG_BLK_DEV_RAM_SIZE=32768
28473 -CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
28474 -# CONFIG_CDROM_PKTCDVD is not set
28475 -# CONFIG_ATA_OVER_ETH is not set
28476 -CONFIG_MISC_DEVICES=y
28477 -# CONFIG_PHANTOM is not set
28478 -# CONFIG_EEPROM_93CX6 is not set
28479 -# CONFIG_SGI_IOC4 is not set
28480 -# CONFIG_TIFM_CORE is not set
28481 -# CONFIG_IDE is not set
28482 -
28483 -#
28484 -# SCSI device support
28485 -#
28486 -# CONFIG_RAID_ATTRS is not set
28487 -CONFIG_SCSI=y
28488 -CONFIG_SCSI_DMA=y
28489 -# CONFIG_SCSI_TGT is not set
28490 -# CONFIG_SCSI_NETLINK is not set
28491 -# CONFIG_SCSI_PROC_FS is not set
28492 -
28493 -#
28494 -# SCSI support type (disk, tape, CD-ROM)
28495 -#
28496 -# CONFIG_BLK_DEV_SD is not set
28497 -# CONFIG_CHR_DEV_ST is not set
28498 -# CONFIG_CHR_DEV_OSST is not set
28499 -# CONFIG_BLK_DEV_SR is not set
28500 -# CONFIG_CHR_DEV_SG is not set
28501 -# CONFIG_CHR_DEV_SCH is not set
28502 -
28503 -#
28504 -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
28505 -#
28506 -# CONFIG_SCSI_MULTI_LUN is not set
28507 -# CONFIG_SCSI_CONSTANTS is not set
28508 -# CONFIG_SCSI_LOGGING is not set
28509 -# CONFIG_SCSI_SCAN_ASYNC is not set
28510 -CONFIG_SCSI_WAIT_SCAN=m
28511 -
28512 -#
28513 -# SCSI Transports
28514 -#
28515 -# CONFIG_SCSI_SPI_ATTRS is not set
28516 -# CONFIG_SCSI_FC_ATTRS is not set
28517 -# CONFIG_SCSI_ISCSI_ATTRS is not set
28518 -# CONFIG_SCSI_SAS_LIBSAS is not set
28519 -# CONFIG_SCSI_SRP_ATTRS is not set
28520 -CONFIG_SCSI_LOWLEVEL=y
28521 -# CONFIG_ISCSI_TCP is not set
28522 -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
28523 -# CONFIG_SCSI_3W_9XXX is not set
28524 -# CONFIG_SCSI_ACARD is not set
28525 -# CONFIG_SCSI_AACRAID is not set
28526 -# CONFIG_SCSI_AIC7XXX is not set
28527 -# CONFIG_SCSI_AIC7XXX_OLD is not set
28528 -# CONFIG_SCSI_AIC79XX is not set
28529 -# CONFIG_SCSI_AIC94XX is not set
28530 -# CONFIG_SCSI_DPT_I2O is not set
28531 -# CONFIG_SCSI_ADVANSYS is not set
28532 -# CONFIG_SCSI_ARCMSR is not set
28533 -# CONFIG_MEGARAID_NEWGEN is not set
28534 -# CONFIG_MEGARAID_LEGACY is not set
28535 -# CONFIG_MEGARAID_SAS is not set
28536 -# CONFIG_SCSI_HPTIOP is not set
28537 -# CONFIG_SCSI_BUSLOGIC is not set
28538 -# CONFIG_SCSI_DMX3191D is not set
28539 -# CONFIG_SCSI_EATA is not set
28540 -# CONFIG_SCSI_FUTURE_DOMAIN is not set
28541 -# CONFIG_SCSI_GDTH is not set
28542 -# CONFIG_SCSI_IPS is not set
28543 -# CONFIG_SCSI_INITIO is not set
28544 -# CONFIG_SCSI_INIA100 is not set
28545 -# CONFIG_SCSI_STEX is not set
28546 -# CONFIG_SCSI_SYM53C8XX_2 is not set
28547 -# CONFIG_SCSI_IPR is not set
28548 -# CONFIG_SCSI_QLOGIC_1280 is not set
28549 -# CONFIG_SCSI_QLA_FC is not set
28550 -# CONFIG_SCSI_QLA_ISCSI is not set
28551 -# CONFIG_SCSI_LPFC is not set
28552 -# CONFIG_SCSI_DC395x is not set
28553 -# CONFIG_SCSI_DC390T is not set
28554 -# CONFIG_SCSI_NSP32 is not set
28555 -# CONFIG_SCSI_DEBUG is not set
28556 -# CONFIG_SCSI_SRP is not set
28557 -CONFIG_ATA=y
28558 -# CONFIG_ATA_NONSTANDARD is not set
28559 -# CONFIG_SATA_AHCI is not set
28560 -# CONFIG_SATA_SVW is not set
28561 -# CONFIG_ATA_PIIX is not set
28562 -# CONFIG_SATA_MV is not set
28563 -# CONFIG_SATA_NV is not set
28564 -# CONFIG_PDC_ADMA is not set
28565 -# CONFIG_SATA_QSTOR is not set
28566 -# CONFIG_SATA_PROMISE is not set
28567 -# CONFIG_SATA_SX4 is not set
28568 -# CONFIG_SATA_SIL is not set
28569 -# CONFIG_SATA_SIL24 is not set
28570 -# CONFIG_SATA_SIS is not set
28571 -# CONFIG_SATA_ULI is not set
28572 -# CONFIG_SATA_VIA is not set
28573 -# CONFIG_SATA_VITESSE is not set
28574 -# CONFIG_SATA_INIC162X is not set
28575 -# CONFIG_PATA_ALI is not set
28576 -# CONFIG_PATA_AMD is not set
28577 -# CONFIG_PATA_ARTOP is not set
28578 -# CONFIG_PATA_ATIIXP is not set
28579 -# CONFIG_PATA_CMD640_PCI is not set
28580 -# CONFIG_PATA_CMD64X is not set
28581 -# CONFIG_PATA_CS5520 is not set
28582 -# CONFIG_PATA_CS5530 is not set
28583 -# CONFIG_PATA_CYPRESS is not set
28584 -# CONFIG_PATA_EFAR is not set
28585 -# CONFIG_ATA_GENERIC is not set
28586 -# CONFIG_PATA_HPT366 is not set
28587 -# CONFIG_PATA_HPT37X is not set
28588 -# CONFIG_PATA_HPT3X2N is not set
28589 -# CONFIG_PATA_HPT3X3 is not set
28590 -# CONFIG_PATA_IT821X is not set
28591 -# CONFIG_PATA_IT8213 is not set
28592 -# CONFIG_PATA_JMICRON is not set
28593 -# CONFIG_PATA_TRIFLEX is not set
28594 -# CONFIG_PATA_MARVELL is not set
28595 -CONFIG_PATA_MPC52xx=y
28596 -# CONFIG_PATA_MPIIX is not set
28597 -# CONFIG_PATA_OLDPIIX is not set
28598 -# CONFIG_PATA_NETCELL is not set
28599 -# CONFIG_PATA_NS87410 is not set
28600 -# CONFIG_PATA_NS87415 is not set
28601 -# CONFIG_PATA_OPTI is not set
28602 -# CONFIG_PATA_OPTIDMA is not set
28603 -# CONFIG_PATA_PDC_OLD is not set
28604 -# CONFIG_PATA_RADISYS is not set
28605 -# CONFIG_PATA_RZ1000 is not set
28606 -# CONFIG_PATA_SC1200 is not set
28607 -# CONFIG_PATA_SERVERWORKS is not set
28608 -# CONFIG_PATA_PDC2027X is not set
28609 -# CONFIG_PATA_SIL680 is not set
28610 -# CONFIG_PATA_SIS is not set
28611 -# CONFIG_PATA_VIA is not set
28612 -# CONFIG_PATA_WINBOND is not set
28613 -# CONFIG_PATA_PLATFORM is not set
28614 -# CONFIG_MD is not set
28615 -# CONFIG_FUSION is not set
28616 -
28617 -#
28618 -# IEEE 1394 (FireWire) support
28619 -#
28620 -# CONFIG_FIREWIRE is not set
28621 -# CONFIG_IEEE1394 is not set
28622 -# CONFIG_I2O is not set
28623 -# CONFIG_MACINTOSH_DRIVERS is not set
28624 -CONFIG_NETDEVICES=y
28625 -# CONFIG_NETDEVICES_MULTIQUEUE is not set
28626 -# CONFIG_DUMMY is not set
28627 -# CONFIG_BONDING is not set
28628 -# CONFIG_MACVLAN is not set
28629 -# CONFIG_EQUALIZER is not set
28630 -# CONFIG_TUN is not set
28631 -# CONFIG_VETH is not set
28632 -# CONFIG_IP1000 is not set
28633 -# CONFIG_ARCNET is not set
28634 -# CONFIG_NET_ETHERNET is not set
28635 -CONFIG_NETDEV_1000=y
28636 -# CONFIG_ACENIC is not set
28637 -# CONFIG_DL2K is not set
28638 -# CONFIG_E1000 is not set
28639 -# CONFIG_E1000E is not set
28640 -# CONFIG_NS83820 is not set
28641 -# CONFIG_HAMACHI is not set
28642 -# CONFIG_YELLOWFIN is not set
28643 -# CONFIG_R8169 is not set
28644 -# CONFIG_SIS190 is not set
28645 -# CONFIG_SKGE is not set
28646 -# CONFIG_SKY2 is not set
28647 -# CONFIG_SK98LIN is not set
28648 -# CONFIG_VIA_VELOCITY is not set
28649 -# CONFIG_TIGON3 is not set
28650 -# CONFIG_BNX2 is not set
28651 -# CONFIG_MV643XX_ETH is not set
28652 -# CONFIG_QLA3XXX is not set
28653 -# CONFIG_ATL1 is not set
28654 -CONFIG_NETDEV_10000=y
28655 -# CONFIG_CHELSIO_T1 is not set
28656 -# CONFIG_CHELSIO_T3 is not set
28657 -# CONFIG_IXGBE is not set
28658 -# CONFIG_IXGB is not set
28659 -# CONFIG_S2IO is not set
28660 -# CONFIG_MYRI10GE is not set
28661 -# CONFIG_NETXEN_NIC is not set
28662 -# CONFIG_NIU is not set
28663 -# CONFIG_MLX4_CORE is not set
28664 -# CONFIG_TEHUTI is not set
28665 -# CONFIG_TR is not set
28666 -
28667 -#
28668 -# Wireless LAN
28669 -#
28670 -# CONFIG_WLAN_PRE80211 is not set
28671 -# CONFIG_WLAN_80211 is not set
28672 -# CONFIG_WAN is not set
28673 -# CONFIG_FDDI is not set
28674 -# CONFIG_HIPPI is not set
28675 -# CONFIG_PPP is not set
28676 -# CONFIG_SLIP is not set
28677 -# CONFIG_NET_FC is not set
28678 -# CONFIG_SHAPER is not set
28679 -# CONFIG_NETCONSOLE is not set
28680 -# CONFIG_NETPOLL is not set
28681 -# CONFIG_NET_POLL_CONTROLLER is not set
28682 -# CONFIG_ISDN is not set
28683 -# CONFIG_PHONE is not set
28684 -
28685 -#
28686 -# Input device support
28687 -#
28688 -# CONFIG_INPUT is not set
28689 -
28690 -#
28691 -# Hardware I/O ports
28692 -#
28693 -# CONFIG_SERIO is not set
28694 -# CONFIG_GAMEPORT is not set
28695 -
28696 -#
28697 -# Character devices
28698 -#
28699 -# CONFIG_VT is not set
28700 -# CONFIG_SERIAL_NONSTANDARD is not set
28701 -
28702 -#
28703 -# Serial drivers
28704 -#
28705 -# CONFIG_SERIAL_8250 is not set
28706 -
28707 -#
28708 -# Non-8250 serial port support
28709 -#
28710 -# CONFIG_SERIAL_UARTLITE is not set
28711 -CONFIG_SERIAL_CORE=y
28712 -CONFIG_SERIAL_CORE_CONSOLE=y
28713 -CONFIG_SERIAL_MPC52xx=y
28714 -CONFIG_SERIAL_MPC52xx_CONSOLE=y
28715 -CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=9600
28716 -# CONFIG_SERIAL_JSM is not set
28717 -CONFIG_UNIX98_PTYS=y
28718 -CONFIG_LEGACY_PTYS=y
28719 -CONFIG_LEGACY_PTY_COUNT=256
28720 -# CONFIG_IPMI_HANDLER is not set
28721 -# CONFIG_HW_RANDOM is not set
28722 -# CONFIG_NVRAM is not set
28723 -# CONFIG_GEN_RTC is not set
28724 -# CONFIG_R3964 is not set
28725 -# CONFIG_APPLICOM is not set
28726 -# CONFIG_RAW_DRIVER is not set
28727 -# CONFIG_TCG_TPM is not set
28728 -CONFIG_DEVPORT=y
28729 -# CONFIG_I2C is not set
28730 -
28731 -#
28732 -# SPI support
28733 -#
28734 -# CONFIG_SPI is not set
28735 -# CONFIG_SPI_MASTER is not set
28736 -# CONFIG_W1 is not set
28737 -# CONFIG_POWER_SUPPLY is not set
28738 -# CONFIG_HWMON is not set
28739 -# CONFIG_WATCHDOG is not set
28740 -
28741 -#
28742 -# Sonics Silicon Backplane
28743 -#
28744 -CONFIG_SSB_POSSIBLE=y
28745 -# CONFIG_SSB is not set
28746 -
28747 -#
28748 -# Multifunction device drivers
28749 -#
28750 -# CONFIG_MFD_SM501 is not set
28751 -
28752 -#
28753 -# Multimedia devices
28754 -#
28755 -# CONFIG_VIDEO_DEV is not set
28756 -# CONFIG_DVB_CORE is not set
28757 -# CONFIG_DAB is not set
28758 -
28759 -#
28760 -# Graphics support
28761 -#
28762 -# CONFIG_AGP is not set
28763 -# CONFIG_DRM is not set
28764 -# CONFIG_VGASTATE is not set
28765 -CONFIG_VIDEO_OUTPUT_CONTROL=m
28766 -# CONFIG_FB is not set
28767 -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
28768 -
28769 -#
28770 -# Display device support
28771 -#
28772 -# CONFIG_DISPLAY_SUPPORT is not set
28773 -
28774 -#
28775 -# Sound
28776 -#
28777 -# CONFIG_SOUND is not set
28778 -CONFIG_USB_SUPPORT=y
28779 -CONFIG_USB_ARCH_HAS_HCD=y
28780 -CONFIG_USB_ARCH_HAS_OHCI=y
28781 -CONFIG_USB_ARCH_HAS_EHCI=y
28782 -# CONFIG_USB is not set
28783 -
28784 -#
28785 -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
28786 -#
28787 -
28788 -#
28789 -# USB Gadget Support
28790 -#
28791 -# CONFIG_USB_GADGET is not set
28792 -# CONFIG_MMC is not set
28793 -# CONFIG_NEW_LEDS is not set
28794 -# CONFIG_INFINIBAND is not set
28795 -# CONFIG_EDAC is not set
28796 -# CONFIG_RTC_CLASS is not set
28797 -
28798 -#
28799 -# Userspace I/O
28800 -#
28801 -# CONFIG_UIO is not set
28802 -
28803 -#
28804 -# File systems
28805 -#
28806 -CONFIG_EXT2_FS=y
28807 -# CONFIG_EXT2_FS_XATTR is not set
28808 -# CONFIG_EXT2_FS_XIP is not set
28809 -CONFIG_EXT3_FS=y
28810 -CONFIG_EXT3_FS_XATTR=y
28811 -# CONFIG_EXT3_FS_POSIX_ACL is not set
28812 -# CONFIG_EXT3_FS_SECURITY is not set
28813 -# CONFIG_EXT4DEV_FS is not set
28814 -CONFIG_JBD=y
28815 -CONFIG_FS_MBCACHE=y
28816 -# CONFIG_REISERFS_FS is not set
28817 -# CONFIG_JFS_FS is not set
28818 -# CONFIG_FS_POSIX_ACL is not set
28819 -# CONFIG_XFS_FS is not set
28820 -# CONFIG_GFS2_FS is not set
28821 -# CONFIG_OCFS2_FS is not set
28822 -# CONFIG_MINIX_FS is not set
28823 -# CONFIG_ROMFS_FS is not set
28824 -CONFIG_INOTIFY=y
28825 -CONFIG_INOTIFY_USER=y
28826 -# CONFIG_QUOTA is not set
28827 -CONFIG_DNOTIFY=y
28828 -# CONFIG_AUTOFS_FS is not set
28829 -# CONFIG_AUTOFS4_FS is not set
28830 -# CONFIG_FUSE_FS is not set
28831 -
28832 -#
28833 -# CD-ROM/DVD Filesystems
28834 -#
28835 -# CONFIG_ISO9660_FS is not set
28836 -# CONFIG_UDF_FS is not set
28837 -
28838 -#
28839 -# DOS/FAT/NT Filesystems
28840 -#
28841 -# CONFIG_MSDOS_FS is not set
28842 -# CONFIG_VFAT_FS is not set
28843 -# CONFIG_NTFS_FS is not set
28844 -
28845 -#
28846 -# Pseudo filesystems
28847 -#
28848 -CONFIG_PROC_FS=y
28849 -CONFIG_PROC_KCORE=y
28850 -CONFIG_PROC_SYSCTL=y
28851 -CONFIG_SYSFS=y
28852 -CONFIG_TMPFS=y
28853 -# CONFIG_TMPFS_POSIX_ACL is not set
28854 -# CONFIG_HUGETLB_PAGE is not set
28855 -# CONFIG_CONFIGFS_FS is not set
28856 -
28857 -#
28858 -# Miscellaneous filesystems
28859 -#
28860 -# CONFIG_ADFS_FS is not set
28861 -# CONFIG_AFFS_FS is not set
28862 -# CONFIG_HFS_FS is not set
28863 -# CONFIG_HFSPLUS_FS is not set
28864 -# CONFIG_BEFS_FS is not set
28865 -# CONFIG_BFS_FS is not set
28866 -# CONFIG_EFS_FS is not set
28867 -# CONFIG_CRAMFS is not set
28868 -# CONFIG_VXFS_FS is not set
28869 -# CONFIG_HPFS_FS is not set
28870 -# CONFIG_QNX4FS_FS is not set
28871 -# CONFIG_SYSV_FS is not set
28872 -# CONFIG_UFS_FS is not set
28873 -CONFIG_NETWORK_FILESYSTEMS=y
28874 -# CONFIG_NFS_FS is not set
28875 -# CONFIG_NFSD is not set
28876 -# CONFIG_SMB_FS is not set
28877 -# CONFIG_CIFS is not set
28878 -# CONFIG_NCP_FS is not set
28879 -# CONFIG_CODA_FS is not set
28880 -# CONFIG_AFS_FS is not set
28881 -
28882 -#
28883 -# Partition Types
28884 -#
28885 -# CONFIG_PARTITION_ADVANCED is not set
28886 -CONFIG_MSDOS_PARTITION=y
28887 -# CONFIG_NLS is not set
28888 -# CONFIG_DLM is not set
28889 -# CONFIG_UCC_SLOW is not set
28890 -
28891 -#
28892 -# Library routines
28893 -#
28894 -# CONFIG_CRC_CCITT is not set
28895 -# CONFIG_CRC16 is not set
28896 -# CONFIG_CRC_ITU_T is not set
28897 -# CONFIG_CRC32 is not set
28898 -# CONFIG_CRC7 is not set
28899 -# CONFIG_LIBCRC32C is not set
28900 -CONFIG_PLIST=y
28901 -CONFIG_HAS_IOMEM=y
28902 -CONFIG_HAS_IOPORT=y
28903 -CONFIG_HAS_DMA=y
28904 -# CONFIG_INSTRUMENTATION is not set
28905 -
28906 -#
28907 -# Kernel hacking
28908 -#
28909 -CONFIG_PRINTK_TIME=y
28910 -CONFIG_ENABLE_WARN_DEPRECATED=y
28911 -CONFIG_ENABLE_MUST_CHECK=y
28912 -# CONFIG_MAGIC_SYSRQ is not set
28913 -# CONFIG_UNUSED_SYMBOLS is not set
28914 -# CONFIG_DEBUG_FS is not set
28915 -# CONFIG_HEADERS_CHECK is not set
28916 -CONFIG_DEBUG_KERNEL=y
28917 -# CONFIG_DEBUG_SHIRQ is not set
28918 -CONFIG_DETECT_SOFTLOCKUP=y
28919 -CONFIG_SCHED_DEBUG=y
28920 -# CONFIG_SCHEDSTATS is not set
28921 -# CONFIG_TIMER_STATS is not set
28922 -# CONFIG_SLUB_DEBUG_ON is not set
28923 -# CONFIG_DEBUG_RT_MUTEXES is not set
28924 -# CONFIG_RT_MUTEX_TESTER is not set
28925 -# CONFIG_DEBUG_SPINLOCK is not set
28926 -# CONFIG_DEBUG_MUTEXES is not set
28927 -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
28928 -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
28929 -# CONFIG_DEBUG_KOBJECT is not set
28930 -# CONFIG_DEBUG_BUGVERBOSE is not set
28931 -CONFIG_DEBUG_INFO=y
28932 -# CONFIG_DEBUG_VM is not set
28933 -# CONFIG_DEBUG_LIST is not set
28934 -# CONFIG_DEBUG_SG is not set
28935 -CONFIG_FORCED_INLINING=y
28936 -# CONFIG_BOOT_PRINTK_DELAY is not set
28937 -# CONFIG_RCU_TORTURE_TEST is not set
28938 -# CONFIG_FAULT_INJECTION is not set
28939 -# CONFIG_SAMPLES is not set
28940 -# CONFIG_DEBUG_STACKOVERFLOW is not set
28941 -# CONFIG_DEBUG_STACK_USAGE is not set
28942 -# CONFIG_DEBUG_PAGEALLOC is not set
28943 -# CONFIG_DEBUGGER is not set
28944 -# CONFIG_BDI_SWITCH is not set
28945 -# CONFIG_BOOTX_TEXT is not set
28946 -# CONFIG_PPC_EARLY_DEBUG is not set
28947 -
28948 -#
28949 -# Security options
28950 -#
28951 -# CONFIG_KEYS is not set
28952 -# CONFIG_SECURITY is not set
28953 -# CONFIG_SECURITY_FILE_CAPABILITIES is not set
28954 -# CONFIG_CRYPTO is not set
28955 -CONFIG_PPC_CLOCK=y
28956 -CONFIG_PPC_LIB_RHEAP=y
28957 Index: linux-2.6.24.7/arch/powerpc/configs/makalu_defconfig
28958 ===================================================================
28959 --- /dev/null
28960 +++ linux-2.6.24.7/arch/powerpc/configs/makalu_defconfig
28961 @@ -0,0 +1,812 @@
28962 +#
28963 +# Automatically generated make config: don't edit
28964 +# Linux kernel version: 2.6.24-rc6
28965 +# Mon Dec 24 11:18:32 2007
28966 +#
28967 +# CONFIG_PPC64 is not set
28968 +
28969 +#
28970 +# Processor support
28971 +#
28972 +# CONFIG_6xx is not set
28973 +# CONFIG_PPC_85xx is not set
28974 +# CONFIG_PPC_8xx is not set
28975 +CONFIG_40x=y
28976 +# CONFIG_44x is not set
28977 +# CONFIG_E200 is not set
28978 +CONFIG_4xx=y
28979 +# CONFIG_PPC_MM_SLICES is not set
28980 +CONFIG_NOT_COHERENT_CACHE=y
28981 +CONFIG_PPC32=y
28982 +CONFIG_WORD_SIZE=32
28983 +CONFIG_PPC_MERGE=y
28984 +CONFIG_MMU=y
28985 +CONFIG_GENERIC_CMOS_UPDATE=y
28986 +CONFIG_GENERIC_TIME=y
28987 +CONFIG_GENERIC_TIME_VSYSCALL=y
28988 +CONFIG_GENERIC_CLOCKEVENTS=y
28989 +CONFIG_GENERIC_HARDIRQS=y
28990 +CONFIG_IRQ_PER_CPU=y
28991 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
28992 +CONFIG_ARCH_HAS_ILOG2_U32=y
28993 +CONFIG_GENERIC_HWEIGHT=y
28994 +CONFIG_GENERIC_CALIBRATE_DELAY=y
28995 +CONFIG_GENERIC_FIND_NEXT_BIT=y
28996 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
28997 +CONFIG_PPC=y
28998 +CONFIG_EARLY_PRINTK=y
28999 +CONFIG_GENERIC_NVRAM=y
29000 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
29001 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
29002 +CONFIG_PPC_OF=y
29003 +CONFIG_OF=y
29004 +CONFIG_PPC_UDBG_16550=y
29005 +# CONFIG_GENERIC_TBSYNC is not set
29006 +CONFIG_AUDIT_ARCH=y
29007 +CONFIG_GENERIC_BUG=y
29008 +# CONFIG_DEFAULT_UIMAGE is not set
29009 +CONFIG_PPC_DCR_NATIVE=y
29010 +# CONFIG_PPC_DCR_MMIO is not set
29011 +CONFIG_PPC_DCR=y
29012 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29013 +
29014 +#
29015 +# General setup
29016 +#
29017 +CONFIG_EXPERIMENTAL=y
29018 +CONFIG_BROKEN_ON_SMP=y
29019 +CONFIG_INIT_ENV_ARG_LIMIT=32
29020 +CONFIG_LOCALVERSION=""
29021 +CONFIG_LOCALVERSION_AUTO=y
29022 +CONFIG_SWAP=y
29023 +CONFIG_SYSVIPC=y
29024 +CONFIG_SYSVIPC_SYSCTL=y
29025 +CONFIG_POSIX_MQUEUE=y
29026 +# CONFIG_BSD_PROCESS_ACCT is not set
29027 +# CONFIG_TASKSTATS is not set
29028 +# CONFIG_USER_NS is not set
29029 +# CONFIG_PID_NS is not set
29030 +# CONFIG_AUDIT is not set
29031 +# CONFIG_IKCONFIG is not set
29032 +CONFIG_LOG_BUF_SHIFT=14
29033 +# CONFIG_CGROUPS is not set
29034 +# CONFIG_FAIR_GROUP_SCHED is not set
29035 +CONFIG_SYSFS_DEPRECATED=y
29036 +# CONFIG_RELAY is not set
29037 +CONFIG_BLK_DEV_INITRD=y
29038 +CONFIG_INITRAMFS_SOURCE=""
29039 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
29040 +CONFIG_SYSCTL=y
29041 +CONFIG_EMBEDDED=y
29042 +CONFIG_SYSCTL_SYSCALL=y
29043 +CONFIG_KALLSYMS=y
29044 +CONFIG_KALLSYMS_ALL=y
29045 +CONFIG_KALLSYMS_EXTRA_PASS=y
29046 +CONFIG_HOTPLUG=y
29047 +CONFIG_PRINTK=y
29048 +CONFIG_BUG=y
29049 +CONFIG_ELF_CORE=y
29050 +CONFIG_BASE_FULL=y
29051 +CONFIG_FUTEX=y
29052 +CONFIG_ANON_INODES=y
29053 +CONFIG_EPOLL=y
29054 +CONFIG_SIGNALFD=y
29055 +CONFIG_EVENTFD=y
29056 +CONFIG_SHMEM=y
29057 +CONFIG_VM_EVENT_COUNTERS=y
29058 +CONFIG_SLUB_DEBUG=y
29059 +# CONFIG_SLAB is not set
29060 +CONFIG_SLUB=y
29061 +# CONFIG_SLOB is not set
29062 +CONFIG_RT_MUTEXES=y
29063 +# CONFIG_TINY_SHMEM is not set
29064 +CONFIG_BASE_SMALL=0
29065 +CONFIG_MODULES=y
29066 +CONFIG_MODULE_UNLOAD=y
29067 +# CONFIG_MODULE_FORCE_UNLOAD is not set
29068 +# CONFIG_MODVERSIONS is not set
29069 +# CONFIG_MODULE_SRCVERSION_ALL is not set
29070 +CONFIG_KMOD=y
29071 +CONFIG_BLOCK=y
29072 +CONFIG_LBD=y
29073 +# CONFIG_BLK_DEV_IO_TRACE is not set
29074 +# CONFIG_LSF is not set
29075 +# CONFIG_BLK_DEV_BSG is not set
29076 +
29077 +#
29078 +# IO Schedulers
29079 +#
29080 +CONFIG_IOSCHED_NOOP=y
29081 +CONFIG_IOSCHED_AS=y
29082 +CONFIG_IOSCHED_DEADLINE=y
29083 +CONFIG_IOSCHED_CFQ=y
29084 +CONFIG_DEFAULT_AS=y
29085 +# CONFIG_DEFAULT_DEADLINE is not set
29086 +# CONFIG_DEFAULT_CFQ is not set
29087 +# CONFIG_DEFAULT_NOOP is not set
29088 +CONFIG_DEFAULT_IOSCHED="anticipatory"
29089 +CONFIG_PPC4xx_PCI_EXPRESS=y
29090 +
29091 +#
29092 +# Platform support
29093 +#
29094 +# CONFIG_PPC_MPC52xx is not set
29095 +# CONFIG_PPC_MPC5200 is not set
29096 +# CONFIG_PPC_CELL is not set
29097 +# CONFIG_PPC_CELL_NATIVE is not set
29098 +# CONFIG_PQ2ADS is not set
29099 +# CONFIG_EP405 is not set
29100 +# CONFIG_KILAUEA is not set
29101 +CONFIG_MAKALU=y
29102 +# CONFIG_WALNUT is not set
29103 +# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
29104 +CONFIG_405EX=y
29105 +# CONFIG_MPIC is not set
29106 +# CONFIG_MPIC_WEIRD is not set
29107 +# CONFIG_PPC_I8259 is not set
29108 +# CONFIG_PPC_RTAS is not set
29109 +# CONFIG_MMIO_NVRAM is not set
29110 +# CONFIG_PPC_MPC106 is not set
29111 +# CONFIG_PPC_970_NAP is not set
29112 +# CONFIG_PPC_INDIRECT_IO is not set
29113 +# CONFIG_GENERIC_IOMAP is not set
29114 +# CONFIG_CPU_FREQ is not set
29115 +# CONFIG_CPM2 is not set
29116 +# CONFIG_FSL_ULI1575 is not set
29117 +
29118 +#
29119 +# Kernel options
29120 +#
29121 +# CONFIG_HIGHMEM is not set
29122 +# CONFIG_TICK_ONESHOT is not set
29123 +# CONFIG_NO_HZ is not set
29124 +# CONFIG_HIGH_RES_TIMERS is not set
29125 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
29126 +# CONFIG_HZ_100 is not set
29127 +CONFIG_HZ_250=y
29128 +# CONFIG_HZ_300 is not set
29129 +# CONFIG_HZ_1000 is not set
29130 +CONFIG_HZ=250
29131 +CONFIG_PREEMPT_NONE=y
29132 +# CONFIG_PREEMPT_VOLUNTARY is not set
29133 +# CONFIG_PREEMPT is not set
29134 +CONFIG_BINFMT_ELF=y
29135 +# CONFIG_BINFMT_MISC is not set
29136 +# CONFIG_MATH_EMULATION is not set
29137 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
29138 +CONFIG_ARCH_FLATMEM_ENABLE=y
29139 +CONFIG_ARCH_POPULATES_NODE_MAP=y
29140 +CONFIG_SELECT_MEMORY_MODEL=y
29141 +CONFIG_FLATMEM_MANUAL=y
29142 +# CONFIG_DISCONTIGMEM_MANUAL is not set
29143 +# CONFIG_SPARSEMEM_MANUAL is not set
29144 +CONFIG_FLATMEM=y
29145 +CONFIG_FLAT_NODE_MEM_MAP=y
29146 +# CONFIG_SPARSEMEM_STATIC is not set
29147 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
29148 +CONFIG_SPLIT_PTLOCK_CPUS=4
29149 +# CONFIG_RESOURCES_64BIT is not set
29150 +CONFIG_ZONE_DMA_FLAG=1
29151 +CONFIG_BOUNCE=y
29152 +CONFIG_VIRT_TO_BUS=y
29153 +CONFIG_PROC_DEVICETREE=y
29154 +# CONFIG_CMDLINE_BOOL is not set
29155 +# CONFIG_PM is not set
29156 +CONFIG_SUSPEND_UP_POSSIBLE=y
29157 +CONFIG_HIBERNATION_UP_POSSIBLE=y
29158 +CONFIG_SECCOMP=y
29159 +CONFIG_WANT_DEVICE_TREE=y
29160 +CONFIG_DEVICE_TREE="kilauea.dts"
29161 +CONFIG_ISA_DMA_API=y
29162 +
29163 +#
29164 +# Bus options
29165 +#
29166 +CONFIG_ZONE_DMA=y
29167 +CONFIG_PPC_INDIRECT_PCI=y
29168 +CONFIG_PCI=y
29169 +CONFIG_PCI_DOMAINS=y
29170 +CONFIG_PCI_SYSCALL=y
29171 +# CONFIG_PCIEPORTBUS is not set
29172 +CONFIG_ARCH_SUPPORTS_MSI=y
29173 +# CONFIG_PCI_MSI is not set
29174 +CONFIG_PCI_LEGACY=y
29175 +# CONFIG_PCI_DEBUG is not set
29176 +# CONFIG_PCCARD is not set
29177 +# CONFIG_HOTPLUG_PCI is not set
29178 +
29179 +#
29180 +# Advanced setup
29181 +#
29182 +# CONFIG_ADVANCED_OPTIONS is not set
29183 +
29184 +#
29185 +# Default settings for advanced configuration options are used
29186 +#
29187 +CONFIG_HIGHMEM_START=0xfe000000
29188 +CONFIG_LOWMEM_SIZE=0x30000000
29189 +CONFIG_KERNEL_START=0xc0000000
29190 +CONFIG_TASK_SIZE=0xc0000000
29191 +CONFIG_CONSISTENT_START=0xff100000
29192 +CONFIG_CONSISTENT_SIZE=0x00200000
29193 +CONFIG_BOOT_LOAD=0x00400000
29194 +
29195 +#
29196 +# Networking
29197 +#
29198 +CONFIG_NET=y
29199 +
29200 +#
29201 +# Networking options
29202 +#
29203 +CONFIG_PACKET=y
29204 +# CONFIG_PACKET_MMAP is not set
29205 +CONFIG_UNIX=y
29206 +# CONFIG_NET_KEY is not set
29207 +CONFIG_INET=y
29208 +# CONFIG_IP_MULTICAST is not set
29209 +# CONFIG_IP_ADVANCED_ROUTER is not set
29210 +CONFIG_IP_FIB_HASH=y
29211 +CONFIG_IP_PNP=y
29212 +CONFIG_IP_PNP_DHCP=y
29213 +CONFIG_IP_PNP_BOOTP=y
29214 +# CONFIG_IP_PNP_RARP is not set
29215 +# CONFIG_NET_IPIP is not set
29216 +# CONFIG_NET_IPGRE is not set
29217 +# CONFIG_ARPD is not set
29218 +# CONFIG_SYN_COOKIES is not set
29219 +# CONFIG_INET_AH is not set
29220 +# CONFIG_INET_ESP is not set
29221 +# CONFIG_INET_IPCOMP is not set
29222 +# CONFIG_INET_XFRM_TUNNEL is not set
29223 +# CONFIG_INET_TUNNEL is not set
29224 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
29225 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
29226 +# CONFIG_INET_XFRM_MODE_BEET is not set
29227 +# CONFIG_INET_LRO is not set
29228 +CONFIG_INET_DIAG=y
29229 +CONFIG_INET_TCP_DIAG=y
29230 +# CONFIG_TCP_CONG_ADVANCED is not set
29231 +CONFIG_TCP_CONG_CUBIC=y
29232 +CONFIG_DEFAULT_TCP_CONG="cubic"
29233 +# CONFIG_TCP_MD5SIG is not set
29234 +# CONFIG_IPV6 is not set
29235 +# CONFIG_INET6_XFRM_TUNNEL is not set
29236 +# CONFIG_INET6_TUNNEL is not set
29237 +# CONFIG_NETWORK_SECMARK is not set
29238 +# CONFIG_NETFILTER is not set
29239 +# CONFIG_IP_DCCP is not set
29240 +# CONFIG_IP_SCTP is not set
29241 +# CONFIG_TIPC is not set
29242 +# CONFIG_ATM is not set
29243 +# CONFIG_BRIDGE is not set
29244 +# CONFIG_VLAN_8021Q is not set
29245 +# CONFIG_DECNET is not set
29246 +# CONFIG_LLC2 is not set
29247 +# CONFIG_IPX is not set
29248 +# CONFIG_ATALK is not set
29249 +# CONFIG_X25 is not set
29250 +# CONFIG_LAPB is not set
29251 +# CONFIG_ECONET is not set
29252 +# CONFIG_WAN_ROUTER is not set
29253 +# CONFIG_NET_SCHED is not set
29254 +
29255 +#
29256 +# Network testing
29257 +#
29258 +# CONFIG_NET_PKTGEN is not set
29259 +# CONFIG_HAMRADIO is not set
29260 +# CONFIG_IRDA is not set
29261 +# CONFIG_BT is not set
29262 +# CONFIG_AF_RXRPC is not set
29263 +
29264 +#
29265 +# Wireless
29266 +#
29267 +# CONFIG_CFG80211 is not set
29268 +# CONFIG_WIRELESS_EXT is not set
29269 +# CONFIG_MAC80211 is not set
29270 +# CONFIG_IEEE80211 is not set
29271 +# CONFIG_RFKILL is not set
29272 +# CONFIG_NET_9P is not set
29273 +
29274 +#
29275 +# Device Drivers
29276 +#
29277 +
29278 +#
29279 +# Generic Driver Options
29280 +#
29281 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
29282 +CONFIG_STANDALONE=y
29283 +CONFIG_PREVENT_FIRMWARE_BUILD=y
29284 +CONFIG_FW_LOADER=y
29285 +# CONFIG_DEBUG_DRIVER is not set
29286 +# CONFIG_DEBUG_DEVRES is not set
29287 +# CONFIG_SYS_HYPERVISOR is not set
29288 +CONFIG_CONNECTOR=y
29289 +CONFIG_PROC_EVENTS=y
29290 +CONFIG_MTD=y
29291 +# CONFIG_MTD_DEBUG is not set
29292 +# CONFIG_MTD_CONCAT is not set
29293 +CONFIG_MTD_PARTITIONS=y
29294 +# CONFIG_MTD_REDBOOT_PARTS is not set
29295 +CONFIG_MTD_CMDLINE_PARTS=y
29296 +
29297 +#
29298 +# User Modules And Translation Layers
29299 +#
29300 +CONFIG_MTD_CHAR=y
29301 +CONFIG_MTD_BLKDEVS=m
29302 +CONFIG_MTD_BLOCK=m
29303 +# CONFIG_MTD_BLOCK_RO is not set
29304 +# CONFIG_FTL is not set
29305 +# CONFIG_NFTL is not set
29306 +# CONFIG_INFTL is not set
29307 +# CONFIG_RFD_FTL is not set
29308 +# CONFIG_SSFDC is not set
29309 +# CONFIG_MTD_OOPS is not set
29310 +
29311 +#
29312 +# RAM/ROM/Flash chip drivers
29313 +#
29314 +CONFIG_MTD_CFI=y
29315 +CONFIG_MTD_JEDECPROBE=y
29316 +CONFIG_MTD_GEN_PROBE=y
29317 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
29318 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
29319 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
29320 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
29321 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
29322 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
29323 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
29324 +CONFIG_MTD_CFI_I1=y
29325 +CONFIG_MTD_CFI_I2=y
29326 +# CONFIG_MTD_CFI_I4 is not set
29327 +# CONFIG_MTD_CFI_I8 is not set
29328 +# CONFIG_MTD_CFI_INTELEXT is not set
29329 +CONFIG_MTD_CFI_AMDSTD=y
29330 +# CONFIG_MTD_CFI_STAA is not set
29331 +CONFIG_MTD_CFI_UTIL=y
29332 +# CONFIG_MTD_RAM is not set
29333 +# CONFIG_MTD_ROM is not set
29334 +# CONFIG_MTD_ABSENT is not set
29335 +
29336 +#
29337 +# Mapping drivers for chip access
29338 +#
29339 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
29340 +# CONFIG_MTD_PHYSMAP is not set
29341 +CONFIG_MTD_PHYSMAP_OF=y
29342 +# CONFIG_MTD_INTEL_VR_NOR is not set
29343 +# CONFIG_MTD_PLATRAM is not set
29344 +
29345 +#
29346 +# Self-contained MTD device drivers
29347 +#
29348 +# CONFIG_MTD_PMC551 is not set
29349 +# CONFIG_MTD_SLRAM is not set
29350 +# CONFIG_MTD_PHRAM is not set
29351 +# CONFIG_MTD_MTDRAM is not set
29352 +# CONFIG_MTD_BLOCK2MTD is not set
29353 +
29354 +#
29355 +# Disk-On-Chip Device Drivers
29356 +#
29357 +# CONFIG_MTD_DOC2000 is not set
29358 +# CONFIG_MTD_DOC2001 is not set
29359 +# CONFIG_MTD_DOC2001PLUS is not set
29360 +# CONFIG_MTD_NAND is not set
29361 +# CONFIG_MTD_ONENAND is not set
29362 +
29363 +#
29364 +# UBI - Unsorted block images
29365 +#
29366 +# CONFIG_MTD_UBI is not set
29367 +CONFIG_OF_DEVICE=y
29368 +# CONFIG_PARPORT is not set
29369 +CONFIG_BLK_DEV=y
29370 +# CONFIG_BLK_DEV_FD is not set
29371 +# CONFIG_BLK_CPQ_DA is not set
29372 +# CONFIG_BLK_CPQ_CISS_DA is not set
29373 +# CONFIG_BLK_DEV_DAC960 is not set
29374 +# CONFIG_BLK_DEV_UMEM is not set
29375 +# CONFIG_BLK_DEV_COW_COMMON is not set
29376 +# CONFIG_BLK_DEV_LOOP is not set
29377 +# CONFIG_BLK_DEV_NBD is not set
29378 +# CONFIG_BLK_DEV_SX8 is not set
29379 +CONFIG_BLK_DEV_RAM=y
29380 +CONFIG_BLK_DEV_RAM_COUNT=16
29381 +CONFIG_BLK_DEV_RAM_SIZE=35000
29382 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
29383 +# CONFIG_CDROM_PKTCDVD is not set
29384 +# CONFIG_ATA_OVER_ETH is not set
29385 +# CONFIG_XILINX_SYSACE is not set
29386 +# CONFIG_MISC_DEVICES is not set
29387 +# CONFIG_IDE is not set
29388 +
29389 +#
29390 +# SCSI device support
29391 +#
29392 +# CONFIG_RAID_ATTRS is not set
29393 +# CONFIG_SCSI is not set
29394 +# CONFIG_SCSI_DMA is not set
29395 +# CONFIG_SCSI_NETLINK is not set
29396 +# CONFIG_ATA is not set
29397 +# CONFIG_MD is not set
29398 +# CONFIG_FUSION is not set
29399 +
29400 +#
29401 +# IEEE 1394 (FireWire) support
29402 +#
29403 +# CONFIG_FIREWIRE is not set
29404 +# CONFIG_IEEE1394 is not set
29405 +# CONFIG_I2O is not set
29406 +# CONFIG_MACINTOSH_DRIVERS is not set
29407 +CONFIG_NETDEVICES=y
29408 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
29409 +# CONFIG_DUMMY is not set
29410 +# CONFIG_BONDING is not set
29411 +# CONFIG_MACVLAN is not set
29412 +# CONFIG_EQUALIZER is not set
29413 +# CONFIG_TUN is not set
29414 +# CONFIG_VETH is not set
29415 +# CONFIG_IP1000 is not set
29416 +# CONFIG_ARCNET is not set
29417 +# CONFIG_PHYLIB is not set
29418 +CONFIG_NET_ETHERNET=y
29419 +# CONFIG_MII is not set
29420 +# CONFIG_HAPPYMEAL is not set
29421 +# CONFIG_SUNGEM is not set
29422 +# CONFIG_CASSINI is not set
29423 +# CONFIG_NET_VENDOR_3COM is not set
29424 +# CONFIG_NET_TULIP is not set
29425 +# CONFIG_HP100 is not set
29426 +CONFIG_IBM_NEW_EMAC=y
29427 +CONFIG_IBM_NEW_EMAC_RXB=256
29428 +CONFIG_IBM_NEW_EMAC_TXB=256
29429 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
29430 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
29431 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
29432 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
29433 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
29434 +CONFIG_IBM_NEW_EMAC_RGMII=y
29435 +# CONFIG_IBM_NEW_EMAC_TAH is not set
29436 +CONFIG_IBM_NEW_EMAC_EMAC4=y
29437 +# CONFIG_NET_PCI is not set
29438 +# CONFIG_B44 is not set
29439 +# CONFIG_NETDEV_1000 is not set
29440 +# CONFIG_NETDEV_10000 is not set
29441 +# CONFIG_TR is not set
29442 +
29443 +#
29444 +# Wireless LAN
29445 +#
29446 +# CONFIG_WLAN_PRE80211 is not set
29447 +# CONFIG_WLAN_80211 is not set
29448 +# CONFIG_WAN is not set
29449 +# CONFIG_FDDI is not set
29450 +# CONFIG_HIPPI is not set
29451 +# CONFIG_PPP is not set
29452 +# CONFIG_SLIP is not set
29453 +# CONFIG_SHAPER is not set
29454 +# CONFIG_NETCONSOLE is not set
29455 +# CONFIG_NETPOLL is not set
29456 +# CONFIG_NET_POLL_CONTROLLER is not set
29457 +# CONFIG_ISDN is not set
29458 +# CONFIG_PHONE is not set
29459 +
29460 +#
29461 +# Input device support
29462 +#
29463 +# CONFIG_INPUT is not set
29464 +
29465 +#
29466 +# Hardware I/O ports
29467 +#
29468 +# CONFIG_SERIO is not set
29469 +# CONFIG_GAMEPORT is not set
29470 +
29471 +#
29472 +# Character devices
29473 +#
29474 +# CONFIG_VT is not set
29475 +# CONFIG_SERIAL_NONSTANDARD is not set
29476 +
29477 +#
29478 +# Serial drivers
29479 +#
29480 +CONFIG_SERIAL_8250=y
29481 +CONFIG_SERIAL_8250_CONSOLE=y
29482 +CONFIG_SERIAL_8250_PCI=y
29483 +CONFIG_SERIAL_8250_NR_UARTS=4
29484 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
29485 +CONFIG_SERIAL_8250_EXTENDED=y
29486 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
29487 +CONFIG_SERIAL_8250_SHARE_IRQ=y
29488 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
29489 +# CONFIG_SERIAL_8250_RSA is not set
29490 +
29491 +#
29492 +# Non-8250 serial port support
29493 +#
29494 +# CONFIG_SERIAL_UARTLITE is not set
29495 +CONFIG_SERIAL_CORE=y
29496 +CONFIG_SERIAL_CORE_CONSOLE=y
29497 +# CONFIG_SERIAL_JSM is not set
29498 +CONFIG_SERIAL_OF_PLATFORM=y
29499 +CONFIG_UNIX98_PTYS=y
29500 +CONFIG_LEGACY_PTYS=y
29501 +CONFIG_LEGACY_PTY_COUNT=256
29502 +# CONFIG_IPMI_HANDLER is not set
29503 +# CONFIG_HW_RANDOM is not set
29504 +# CONFIG_NVRAM is not set
29505 +# CONFIG_GEN_RTC is not set
29506 +# CONFIG_R3964 is not set
29507 +# CONFIG_APPLICOM is not set
29508 +# CONFIG_RAW_DRIVER is not set
29509 +# CONFIG_TCG_TPM is not set
29510 +CONFIG_DEVPORT=y
29511 +# CONFIG_I2C is not set
29512 +
29513 +#
29514 +# SPI support
29515 +#
29516 +# CONFIG_SPI is not set
29517 +# CONFIG_SPI_MASTER is not set
29518 +# CONFIG_W1 is not set
29519 +# CONFIG_POWER_SUPPLY is not set
29520 +# CONFIG_HWMON is not set
29521 +# CONFIG_WATCHDOG is not set
29522 +
29523 +#
29524 +# Sonics Silicon Backplane
29525 +#
29526 +CONFIG_SSB_POSSIBLE=y
29527 +# CONFIG_SSB is not set
29528 +
29529 +#
29530 +# Multifunction device drivers
29531 +#
29532 +# CONFIG_MFD_SM501 is not set
29533 +
29534 +#
29535 +# Multimedia devices
29536 +#
29537 +# CONFIG_VIDEO_DEV is not set
29538 +# CONFIG_DVB_CORE is not set
29539 +# CONFIG_DAB is not set
29540 +
29541 +#
29542 +# Graphics support
29543 +#
29544 +# CONFIG_AGP is not set
29545 +# CONFIG_DRM is not set
29546 +# CONFIG_VGASTATE is not set
29547 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
29548 +# CONFIG_FB is not set
29549 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
29550 +
29551 +#
29552 +# Display device support
29553 +#
29554 +# CONFIG_DISPLAY_SUPPORT is not set
29555 +
29556 +#
29557 +# Sound
29558 +#
29559 +# CONFIG_SOUND is not set
29560 +# CONFIG_USB_SUPPORT is not set
29561 +# CONFIG_MMC is not set
29562 +# CONFIG_NEW_LEDS is not set
29563 +# CONFIG_INFINIBAND is not set
29564 +# CONFIG_EDAC is not set
29565 +# CONFIG_RTC_CLASS is not set
29566 +
29567 +#
29568 +# Userspace I/O
29569 +#
29570 +# CONFIG_UIO is not set
29571 +
29572 +#
29573 +# File systems
29574 +#
29575 +CONFIG_EXT2_FS=y
29576 +# CONFIG_EXT2_FS_XATTR is not set
29577 +# CONFIG_EXT2_FS_XIP is not set
29578 +# CONFIG_EXT3_FS is not set
29579 +# CONFIG_EXT4DEV_FS is not set
29580 +# CONFIG_REISERFS_FS is not set
29581 +# CONFIG_JFS_FS is not set
29582 +# CONFIG_FS_POSIX_ACL is not set
29583 +# CONFIG_XFS_FS is not set
29584 +# CONFIG_GFS2_FS is not set
29585 +# CONFIG_OCFS2_FS is not set
29586 +# CONFIG_MINIX_FS is not set
29587 +# CONFIG_ROMFS_FS is not set
29588 +CONFIG_INOTIFY=y
29589 +CONFIG_INOTIFY_USER=y
29590 +# CONFIG_QUOTA is not set
29591 +CONFIG_DNOTIFY=y
29592 +# CONFIG_AUTOFS_FS is not set
29593 +# CONFIG_AUTOFS4_FS is not set
29594 +# CONFIG_FUSE_FS is not set
29595 +
29596 +#
29597 +# CD-ROM/DVD Filesystems
29598 +#
29599 +# CONFIG_ISO9660_FS is not set
29600 +# CONFIG_UDF_FS is not set
29601 +
29602 +#
29603 +# DOS/FAT/NT Filesystems
29604 +#
29605 +# CONFIG_MSDOS_FS is not set
29606 +# CONFIG_VFAT_FS is not set
29607 +# CONFIG_NTFS_FS is not set
29608 +
29609 +#
29610 +# Pseudo filesystems
29611 +#
29612 +CONFIG_PROC_FS=y
29613 +CONFIG_PROC_KCORE=y
29614 +CONFIG_PROC_SYSCTL=y
29615 +CONFIG_SYSFS=y
29616 +CONFIG_TMPFS=y
29617 +# CONFIG_TMPFS_POSIX_ACL is not set
29618 +# CONFIG_HUGETLB_PAGE is not set
29619 +# CONFIG_CONFIGFS_FS is not set
29620 +
29621 +#
29622 +# Miscellaneous filesystems
29623 +#
29624 +# CONFIG_ADFS_FS is not set
29625 +# CONFIG_AFFS_FS is not set
29626 +# CONFIG_HFS_FS is not set
29627 +# CONFIG_HFSPLUS_FS is not set
29628 +# CONFIG_BEFS_FS is not set
29629 +# CONFIG_BFS_FS is not set
29630 +# CONFIG_EFS_FS is not set
29631 +# CONFIG_JFFS2_FS is not set
29632 +CONFIG_CRAMFS=y
29633 +# CONFIG_VXFS_FS is not set
29634 +# CONFIG_HPFS_FS is not set
29635 +# CONFIG_QNX4FS_FS is not set
29636 +# CONFIG_SYSV_FS is not set
29637 +# CONFIG_UFS_FS is not set
29638 +CONFIG_NETWORK_FILESYSTEMS=y
29639 +CONFIG_NFS_FS=y
29640 +CONFIG_NFS_V3=y
29641 +# CONFIG_NFS_V3_ACL is not set
29642 +# CONFIG_NFS_V4 is not set
29643 +# CONFIG_NFS_DIRECTIO is not set
29644 +# CONFIG_NFSD is not set
29645 +CONFIG_ROOT_NFS=y
29646 +CONFIG_LOCKD=y
29647 +CONFIG_LOCKD_V4=y
29648 +CONFIG_NFS_COMMON=y
29649 +CONFIG_SUNRPC=y
29650 +# CONFIG_SUNRPC_BIND34 is not set
29651 +# CONFIG_RPCSEC_GSS_KRB5 is not set
29652 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
29653 +# CONFIG_SMB_FS is not set
29654 +# CONFIG_CIFS is not set
29655 +# CONFIG_NCP_FS is not set
29656 +# CONFIG_CODA_FS is not set
29657 +# CONFIG_AFS_FS is not set
29658 +
29659 +#
29660 +# Partition Types
29661 +#
29662 +# CONFIG_PARTITION_ADVANCED is not set
29663 +CONFIG_MSDOS_PARTITION=y
29664 +# CONFIG_NLS is not set
29665 +# CONFIG_DLM is not set
29666 +# CONFIG_UCC_SLOW is not set
29667 +
29668 +#
29669 +# Library routines
29670 +#
29671 +CONFIG_BITREVERSE=y
29672 +# CONFIG_CRC_CCITT is not set
29673 +# CONFIG_CRC16 is not set
29674 +# CONFIG_CRC_ITU_T is not set
29675 +CONFIG_CRC32=y
29676 +# CONFIG_CRC7 is not set
29677 +# CONFIG_LIBCRC32C is not set
29678 +CONFIG_ZLIB_INFLATE=y
29679 +CONFIG_PLIST=y
29680 +CONFIG_HAS_IOMEM=y
29681 +CONFIG_HAS_IOPORT=y
29682 +CONFIG_HAS_DMA=y
29683 +# CONFIG_INSTRUMENTATION is not set
29684 +
29685 +#
29686 +# Kernel hacking
29687 +#
29688 +# CONFIG_PRINTK_TIME is not set
29689 +CONFIG_ENABLE_WARN_DEPRECATED=y
29690 +CONFIG_ENABLE_MUST_CHECK=y
29691 +CONFIG_MAGIC_SYSRQ=y
29692 +# CONFIG_UNUSED_SYMBOLS is not set
29693 +# CONFIG_DEBUG_FS is not set
29694 +# CONFIG_HEADERS_CHECK is not set
29695 +CONFIG_DEBUG_KERNEL=y
29696 +# CONFIG_DEBUG_SHIRQ is not set
29697 +CONFIG_DETECT_SOFTLOCKUP=y
29698 +CONFIG_SCHED_DEBUG=y
29699 +# CONFIG_SCHEDSTATS is not set
29700 +# CONFIG_TIMER_STATS is not set
29701 +# CONFIG_SLUB_DEBUG_ON is not set
29702 +# CONFIG_DEBUG_RT_MUTEXES is not set
29703 +# CONFIG_RT_MUTEX_TESTER is not set
29704 +# CONFIG_DEBUG_SPINLOCK is not set
29705 +# CONFIG_DEBUG_MUTEXES is not set
29706 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
29707 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
29708 +# CONFIG_DEBUG_KOBJECT is not set
29709 +CONFIG_DEBUG_BUGVERBOSE=y
29710 +# CONFIG_DEBUG_INFO is not set
29711 +# CONFIG_DEBUG_VM is not set
29712 +# CONFIG_DEBUG_LIST is not set
29713 +# CONFIG_DEBUG_SG is not set
29714 +CONFIG_FORCED_INLINING=y
29715 +# CONFIG_BOOT_PRINTK_DELAY is not set
29716 +# CONFIG_RCU_TORTURE_TEST is not set
29717 +# CONFIG_FAULT_INJECTION is not set
29718 +# CONFIG_SAMPLES is not set
29719 +# CONFIG_DEBUG_STACKOVERFLOW is not set
29720 +# CONFIG_DEBUG_STACK_USAGE is not set
29721 +# CONFIG_DEBUG_PAGEALLOC is not set
29722 +# CONFIG_DEBUGGER is not set
29723 +# CONFIG_BDI_SWITCH is not set
29724 +# CONFIG_PPC_EARLY_DEBUG is not set
29725 +
29726 +#
29727 +# Security options
29728 +#
29729 +# CONFIG_KEYS is not set
29730 +# CONFIG_SECURITY is not set
29731 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
29732 +CONFIG_CRYPTO=y
29733 +CONFIG_CRYPTO_ALGAPI=y
29734 +CONFIG_CRYPTO_BLKCIPHER=y
29735 +CONFIG_CRYPTO_MANAGER=y
29736 +# CONFIG_CRYPTO_HMAC is not set
29737 +# CONFIG_CRYPTO_XCBC is not set
29738 +# CONFIG_CRYPTO_NULL is not set
29739 +# CONFIG_CRYPTO_MD4 is not set
29740 +CONFIG_CRYPTO_MD5=y
29741 +# CONFIG_CRYPTO_SHA1 is not set
29742 +# CONFIG_CRYPTO_SHA256 is not set
29743 +# CONFIG_CRYPTO_SHA512 is not set
29744 +# CONFIG_CRYPTO_WP512 is not set
29745 +# CONFIG_CRYPTO_TGR192 is not set
29746 +# CONFIG_CRYPTO_GF128MUL is not set
29747 +CONFIG_CRYPTO_ECB=y
29748 +CONFIG_CRYPTO_CBC=y
29749 +CONFIG_CRYPTO_PCBC=y
29750 +# CONFIG_CRYPTO_LRW is not set
29751 +# CONFIG_CRYPTO_XTS is not set
29752 +# CONFIG_CRYPTO_CRYPTD is not set
29753 +CONFIG_CRYPTO_DES=y
29754 +# CONFIG_CRYPTO_FCRYPT is not set
29755 +# CONFIG_CRYPTO_BLOWFISH is not set
29756 +# CONFIG_CRYPTO_TWOFISH is not set
29757 +# CONFIG_CRYPTO_SERPENT is not set
29758 +# CONFIG_CRYPTO_AES is not set
29759 +# CONFIG_CRYPTO_CAST5 is not set
29760 +# CONFIG_CRYPTO_CAST6 is not set
29761 +# CONFIG_CRYPTO_TEA is not set
29762 +# CONFIG_CRYPTO_ARC4 is not set
29763 +# CONFIG_CRYPTO_KHAZAD is not set
29764 +# CONFIG_CRYPTO_ANUBIS is not set
29765 +# CONFIG_CRYPTO_SEED is not set
29766 +# CONFIG_CRYPTO_DEFLATE is not set
29767 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
29768 +# CONFIG_CRYPTO_CRC32C is not set
29769 +# CONFIG_CRYPTO_CAMELLIA is not set
29770 +# CONFIG_CRYPTO_TEST is not set
29771 +# CONFIG_CRYPTO_AUTHENC is not set
29772 +CONFIG_CRYPTO_HW=y
29773 +# CONFIG_PPC_CLOCK is not set
29774 Index: linux-2.6.24.7/arch/powerpc/configs/mpc5200_defconfig
29775 ===================================================================
29776 --- /dev/null
29777 +++ linux-2.6.24.7/arch/powerpc/configs/mpc5200_defconfig
29778 @@ -0,0 +1,1286 @@
29779 +#
29780 +# Automatically generated make config: don't edit
29781 +# Linux kernel version: 2.6.24-rc6
29782 +# Fri Jan 18 14:19:54 2008
29783 +#
29784 +# CONFIG_PPC64 is not set
29785 +
29786 +#
29787 +# Processor support
29788 +#
29789 +CONFIG_6xx=y
29790 +# CONFIG_PPC_85xx is not set
29791 +# CONFIG_PPC_8xx is not set
29792 +# CONFIG_40x is not set
29793 +# CONFIG_44x is not set
29794 +# CONFIG_E200 is not set
29795 +CONFIG_PPC_FPU=y
29796 +# CONFIG_ALTIVEC is not set
29797 +CONFIG_PPC_STD_MMU=y
29798 +CONFIG_PPC_STD_MMU_32=y
29799 +# CONFIG_PPC_MM_SLICES is not set
29800 +# CONFIG_SMP is not set
29801 +CONFIG_PPC32=y
29802 +CONFIG_WORD_SIZE=32
29803 +CONFIG_PPC_MERGE=y
29804 +CONFIG_MMU=y
29805 +CONFIG_GENERIC_CMOS_UPDATE=y
29806 +CONFIG_GENERIC_TIME=y
29807 +CONFIG_GENERIC_TIME_VSYSCALL=y
29808 +CONFIG_GENERIC_CLOCKEVENTS=y
29809 +CONFIG_GENERIC_HARDIRQS=y
29810 +CONFIG_IRQ_PER_CPU=y
29811 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
29812 +CONFIG_ARCH_HAS_ILOG2_U32=y
29813 +CONFIG_GENERIC_HWEIGHT=y
29814 +CONFIG_GENERIC_CALIBRATE_DELAY=y
29815 +CONFIG_GENERIC_FIND_NEXT_BIT=y
29816 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
29817 +CONFIG_PPC=y
29818 +CONFIG_EARLY_PRINTK=y
29819 +CONFIG_GENERIC_NVRAM=y
29820 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
29821 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
29822 +CONFIG_PPC_OF=y
29823 +CONFIG_OF=y
29824 +# CONFIG_PPC_UDBG_16550 is not set
29825 +# CONFIG_GENERIC_TBSYNC is not set
29826 +CONFIG_AUDIT_ARCH=y
29827 +CONFIG_GENERIC_BUG=y
29828 +# CONFIG_DEFAULT_UIMAGE is not set
29829 +# CONFIG_PPC_DCR_NATIVE is not set
29830 +# CONFIG_PPC_DCR_MMIO is not set
29831 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29832 +
29833 +#
29834 +# General setup
29835 +#
29836 +CONFIG_EXPERIMENTAL=y
29837 +CONFIG_BROKEN_ON_SMP=y
29838 +CONFIG_INIT_ENV_ARG_LIMIT=32
29839 +CONFIG_LOCALVERSION=""
29840 +CONFIG_LOCALVERSION_AUTO=y
29841 +CONFIG_SWAP=y
29842 +CONFIG_SYSVIPC=y
29843 +CONFIG_SYSVIPC_SYSCTL=y
29844 +# CONFIG_POSIX_MQUEUE is not set
29845 +# CONFIG_BSD_PROCESS_ACCT is not set
29846 +# CONFIG_TASKSTATS is not set
29847 +# CONFIG_USER_NS is not set
29848 +# CONFIG_PID_NS is not set
29849 +# CONFIG_AUDIT is not set
29850 +# CONFIG_IKCONFIG is not set
29851 +CONFIG_LOG_BUF_SHIFT=14
29852 +# CONFIG_CGROUPS is not set
29853 +CONFIG_FAIR_GROUP_SCHED=y
29854 +CONFIG_FAIR_USER_SCHED=y
29855 +# CONFIG_FAIR_CGROUP_SCHED is not set
29856 +CONFIG_SYSFS_DEPRECATED=y
29857 +# CONFIG_RELAY is not set
29858 +CONFIG_BLK_DEV_INITRD=y
29859 +CONFIG_INITRAMFS_SOURCE=""
29860 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
29861 +CONFIG_SYSCTL=y
29862 +CONFIG_EMBEDDED=y
29863 +# CONFIG_SYSCTL_SYSCALL is not set
29864 +# CONFIG_KALLSYMS is not set
29865 +CONFIG_HOTPLUG=y
29866 +CONFIG_PRINTK=y
29867 +CONFIG_BUG=y
29868 +CONFIG_ELF_CORE=y
29869 +CONFIG_BASE_FULL=y
29870 +CONFIG_FUTEX=y
29871 +CONFIG_ANON_INODES=y
29872 +# CONFIG_EPOLL is not set
29873 +CONFIG_SIGNALFD=y
29874 +CONFIG_EVENTFD=y
29875 +CONFIG_SHMEM=y
29876 +CONFIG_VM_EVENT_COUNTERS=y
29877 +CONFIG_SLUB_DEBUG=y
29878 +# CONFIG_SLAB is not set
29879 +CONFIG_SLUB=y
29880 +# CONFIG_SLOB is not set
29881 +CONFIG_RT_MUTEXES=y
29882 +# CONFIG_TINY_SHMEM is not set
29883 +CONFIG_BASE_SMALL=0
29884 +CONFIG_MODULES=y
29885 +CONFIG_MODULE_UNLOAD=y
29886 +# CONFIG_MODULE_FORCE_UNLOAD is not set
29887 +# CONFIG_MODVERSIONS is not set
29888 +# CONFIG_MODULE_SRCVERSION_ALL is not set
29889 +# CONFIG_KMOD is not set
29890 +CONFIG_BLOCK=y
29891 +# CONFIG_LBD is not set
29892 +# CONFIG_BLK_DEV_IO_TRACE is not set
29893 +# CONFIG_LSF is not set
29894 +# CONFIG_BLK_DEV_BSG is not set
29895 +
29896 +#
29897 +# IO Schedulers
29898 +#
29899 +CONFIG_IOSCHED_NOOP=y
29900 +CONFIG_IOSCHED_AS=y
29901 +CONFIG_IOSCHED_DEADLINE=y
29902 +CONFIG_IOSCHED_CFQ=y
29903 +CONFIG_DEFAULT_AS=y
29904 +# CONFIG_DEFAULT_DEADLINE is not set
29905 +# CONFIG_DEFAULT_CFQ is not set
29906 +# CONFIG_DEFAULT_NOOP is not set
29907 +CONFIG_DEFAULT_IOSCHED="anticipatory"
29908 +
29909 +#
29910 +# Platform support
29911 +#
29912 +CONFIG_PPC_MULTIPLATFORM=y
29913 +# CONFIG_PPC_82xx is not set
29914 +# CONFIG_PPC_83xx is not set
29915 +# CONFIG_PPC_86xx is not set
29916 +CONFIG_CLASSIC32=y
29917 +# CONFIG_PPC_CHRP is not set
29918 +CONFIG_PPC_MPC52xx=y
29919 +CONFIG_PPC_MPC5200=y
29920 +CONFIG_PPC_MPC5200_BUGFIX=y
29921 +CONFIG_PPC_MPC5200_SIMPLE=y
29922 +CONFIG_PPC_EFIKA=y
29923 +CONFIG_PPC_LITE5200=y
29924 +# CONFIG_PPC_PMAC is not set
29925 +# CONFIG_PPC_CELL is not set
29926 +# CONFIG_PPC_CELL_NATIVE is not set
29927 +# CONFIG_PQ2ADS is not set
29928 +# CONFIG_EMBEDDED6xx is not set
29929 +CONFIG_PPC_NATIVE=y
29930 +# CONFIG_UDBG_RTAS_CONSOLE is not set
29931 +# CONFIG_MPIC is not set
29932 +# CONFIG_MPIC_WEIRD is not set
29933 +# CONFIG_PPC_I8259 is not set
29934 +CONFIG_PPC_RTAS=y
29935 +# CONFIG_RTAS_ERROR_LOGGING is not set
29936 +CONFIG_RTAS_PROC=y
29937 +# CONFIG_MMIO_NVRAM is not set
29938 +# CONFIG_PPC_MPC106 is not set
29939 +# CONFIG_PPC_970_NAP is not set
29940 +# CONFIG_PPC_INDIRECT_IO is not set
29941 +# CONFIG_GENERIC_IOMAP is not set
29942 +# CONFIG_CPU_FREQ is not set
29943 +# CONFIG_TAU is not set
29944 +# CONFIG_CPM2 is not set
29945 +# CONFIG_FSL_ULI1575 is not set
29946 +CONFIG_PPC_BESTCOMM=y
29947 +CONFIG_PPC_BESTCOMM_ATA=y
29948 +CONFIG_PPC_BESTCOMM_FEC=y
29949 +CONFIG_PPC_BESTCOMM_GEN_BD=y
29950 +
29951 +#
29952 +# Kernel options
29953 +#
29954 +# CONFIG_HIGHMEM is not set
29955 +CONFIG_TICK_ONESHOT=y
29956 +CONFIG_NO_HZ=y
29957 +CONFIG_HIGH_RES_TIMERS=y
29958 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
29959 +# CONFIG_HZ_100 is not set
29960 +CONFIG_HZ_250=y
29961 +# CONFIG_HZ_300 is not set
29962 +# CONFIG_HZ_1000 is not set
29963 +CONFIG_HZ=250
29964 +CONFIG_PREEMPT_NONE=y
29965 +# CONFIG_PREEMPT_VOLUNTARY is not set
29966 +# CONFIG_PREEMPT is not set
29967 +CONFIG_BINFMT_ELF=y
29968 +# CONFIG_BINFMT_MISC is not set
29969 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
29970 +# CONFIG_KEXEC is not set
29971 +CONFIG_ARCH_FLATMEM_ENABLE=y
29972 +CONFIG_ARCH_POPULATES_NODE_MAP=y
29973 +CONFIG_SELECT_MEMORY_MODEL=y
29974 +CONFIG_FLATMEM_MANUAL=y
29975 +# CONFIG_DISCONTIGMEM_MANUAL is not set
29976 +# CONFIG_SPARSEMEM_MANUAL is not set
29977 +CONFIG_FLATMEM=y
29978 +CONFIG_FLAT_NODE_MEM_MAP=y
29979 +# CONFIG_SPARSEMEM_STATIC is not set
29980 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
29981 +CONFIG_SPLIT_PTLOCK_CPUS=4
29982 +# CONFIG_RESOURCES_64BIT is not set
29983 +CONFIG_ZONE_DMA_FLAG=1
29984 +CONFIG_BOUNCE=y
29985 +CONFIG_VIRT_TO_BUS=y
29986 +CONFIG_PROC_DEVICETREE=y
29987 +# CONFIG_CMDLINE_BOOL is not set
29988 +CONFIG_PM=y
29989 +# CONFIG_PM_LEGACY is not set
29990 +# CONFIG_PM_DEBUG is not set
29991 +CONFIG_PM_SLEEP=y
29992 +CONFIG_SUSPEND_UP_POSSIBLE=y
29993 +CONFIG_SUSPEND=y
29994 +CONFIG_HIBERNATION_UP_POSSIBLE=y
29995 +# CONFIG_HIBERNATION is not set
29996 +CONFIG_SECCOMP=y
29997 +CONFIG_WANT_DEVICE_TREE=y
29998 +CONFIG_DEVICE_TREE=""
29999 +CONFIG_ISA_DMA_API=y
30000 +
30001 +#
30002 +# Bus options
30003 +#
30004 +CONFIG_ZONE_DMA=y
30005 +CONFIG_GENERIC_ISA_DMA=y
30006 +# CONFIG_PPC_INDIRECT_PCI is not set
30007 +CONFIG_FSL_SOC=y
30008 +CONFIG_PCI=y
30009 +CONFIG_PCI_DOMAINS=y
30010 +CONFIG_PCI_SYSCALL=y
30011 +# CONFIG_PCIEPORTBUS is not set
30012 +CONFIG_ARCH_SUPPORTS_MSI=y
30013 +# CONFIG_PCI_MSI is not set
30014 +CONFIG_PCI_LEGACY=y
30015 +# CONFIG_PCI_DEBUG is not set
30016 +# CONFIG_PCCARD is not set
30017 +# CONFIG_HOTPLUG_PCI is not set
30018 +
30019 +#
30020 +# Advanced setup
30021 +#
30022 +# CONFIG_ADVANCED_OPTIONS is not set
30023 +
30024 +#
30025 +# Default settings for advanced configuration options are used
30026 +#
30027 +CONFIG_HIGHMEM_START=0xfe000000
30028 +CONFIG_LOWMEM_SIZE=0x30000000
30029 +CONFIG_KERNEL_START=0xc0000000
30030 +CONFIG_TASK_SIZE=0xc0000000
30031 +CONFIG_BOOT_LOAD=0x00800000
30032 +
30033 +#
30034 +# Networking
30035 +#
30036 +CONFIG_NET=y
30037 +
30038 +#
30039 +# Networking options
30040 +#
30041 +CONFIG_PACKET=y
30042 +# CONFIG_PACKET_MMAP is not set
30043 +CONFIG_UNIX=y
30044 +CONFIG_XFRM=y
30045 +CONFIG_XFRM_USER=m
30046 +# CONFIG_XFRM_SUB_POLICY is not set
30047 +# CONFIG_XFRM_MIGRATE is not set
30048 +# CONFIG_NET_KEY is not set
30049 +CONFIG_INET=y
30050 +CONFIG_IP_MULTICAST=y
30051 +# CONFIG_IP_ADVANCED_ROUTER is not set
30052 +CONFIG_IP_FIB_HASH=y
30053 +CONFIG_IP_PNP=y
30054 +CONFIG_IP_PNP_DHCP=y
30055 +CONFIG_IP_PNP_BOOTP=y
30056 +# CONFIG_IP_PNP_RARP is not set
30057 +# CONFIG_NET_IPIP is not set
30058 +# CONFIG_NET_IPGRE is not set
30059 +# CONFIG_IP_MROUTE is not set
30060 +# CONFIG_ARPD is not set
30061 +CONFIG_SYN_COOKIES=y
30062 +# CONFIG_INET_AH is not set
30063 +# CONFIG_INET_ESP is not set
30064 +# CONFIG_INET_IPCOMP is not set
30065 +# CONFIG_INET_XFRM_TUNNEL is not set
30066 +# CONFIG_INET_TUNNEL is not set
30067 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
30068 +CONFIG_INET_XFRM_MODE_TUNNEL=y
30069 +CONFIG_INET_XFRM_MODE_BEET=y
30070 +# CONFIG_INET_LRO is not set
30071 +CONFIG_INET_DIAG=y
30072 +CONFIG_INET_TCP_DIAG=y
30073 +# CONFIG_TCP_CONG_ADVANCED is not set
30074 +CONFIG_TCP_CONG_CUBIC=y
30075 +CONFIG_DEFAULT_TCP_CONG="cubic"
30076 +# CONFIG_TCP_MD5SIG is not set
30077 +# CONFIG_IPV6 is not set
30078 +# CONFIG_INET6_XFRM_TUNNEL is not set
30079 +# CONFIG_INET6_TUNNEL is not set
30080 +# CONFIG_NETWORK_SECMARK is not set
30081 +# CONFIG_NETFILTER is not set
30082 +# CONFIG_IP_DCCP is not set
30083 +# CONFIG_IP_SCTP is not set
30084 +# CONFIG_TIPC is not set
30085 +# CONFIG_ATM is not set
30086 +# CONFIG_BRIDGE is not set
30087 +# CONFIG_VLAN_8021Q is not set
30088 +# CONFIG_DECNET is not set
30089 +# CONFIG_LLC2 is not set
30090 +# CONFIG_IPX is not set
30091 +# CONFIG_ATALK is not set
30092 +# CONFIG_X25 is not set
30093 +# CONFIG_LAPB is not set
30094 +# CONFIG_ECONET is not set
30095 +# CONFIG_WAN_ROUTER is not set
30096 +# CONFIG_NET_SCHED is not set
30097 +
30098 +#
30099 +# Network testing
30100 +#
30101 +# CONFIG_NET_PKTGEN is not set
30102 +# CONFIG_HAMRADIO is not set
30103 +# CONFIG_IRDA is not set
30104 +# CONFIG_BT is not set
30105 +# CONFIG_AF_RXRPC is not set
30106 +
30107 +#
30108 +# Wireless
30109 +#
30110 +# CONFIG_CFG80211 is not set
30111 +# CONFIG_WIRELESS_EXT is not set
30112 +# CONFIG_MAC80211 is not set
30113 +# CONFIG_IEEE80211 is not set
30114 +# CONFIG_RFKILL is not set
30115 +# CONFIG_NET_9P is not set
30116 +
30117 +#
30118 +# Device Drivers
30119 +#
30120 +
30121 +#
30122 +# Generic Driver Options
30123 +#
30124 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
30125 +CONFIG_STANDALONE=y
30126 +CONFIG_PREVENT_FIRMWARE_BUILD=y
30127 +# CONFIG_FW_LOADER is not set
30128 +# CONFIG_DEBUG_DRIVER is not set
30129 +# CONFIG_DEBUG_DEVRES is not set
30130 +# CONFIG_SYS_HYPERVISOR is not set
30131 +# CONFIG_CONNECTOR is not set
30132 +CONFIG_MTD=y
30133 +# CONFIG_MTD_DEBUG is not set
30134 +CONFIG_MTD_CONCAT=y
30135 +CONFIG_MTD_PARTITIONS=y
30136 +# CONFIG_MTD_REDBOOT_PARTS is not set
30137 +CONFIG_MTD_CMDLINE_PARTS=y
30138 +
30139 +#
30140 +# User Modules And Translation Layers
30141 +#
30142 +CONFIG_MTD_CHAR=y
30143 +CONFIG_MTD_BLKDEVS=y
30144 +CONFIG_MTD_BLOCK=y
30145 +# CONFIG_FTL is not set
30146 +# CONFIG_NFTL is not set
30147 +# CONFIG_INFTL is not set
30148 +# CONFIG_RFD_FTL is not set
30149 +# CONFIG_SSFDC is not set
30150 +# CONFIG_MTD_OOPS is not set
30151 +
30152 +#
30153 +# RAM/ROM/Flash chip drivers
30154 +#
30155 +CONFIG_MTD_CFI=y
30156 +# CONFIG_MTD_JEDECPROBE is not set
30157 +CONFIG_MTD_GEN_PROBE=y
30158 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
30159 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
30160 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
30161 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
30162 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
30163 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
30164 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
30165 +CONFIG_MTD_CFI_I1=y
30166 +CONFIG_MTD_CFI_I2=y
30167 +# CONFIG_MTD_CFI_I4 is not set
30168 +# CONFIG_MTD_CFI_I8 is not set
30169 +# CONFIG_MTD_CFI_INTELEXT is not set
30170 +CONFIG_MTD_CFI_AMDSTD=y
30171 +# CONFIG_MTD_CFI_STAA is not set
30172 +CONFIG_MTD_CFI_UTIL=y
30173 +CONFIG_MTD_RAM=y
30174 +CONFIG_MTD_ROM=y
30175 +# CONFIG_MTD_ABSENT is not set
30176 +
30177 +#
30178 +# Mapping drivers for chip access
30179 +#
30180 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
30181 +# CONFIG_MTD_PHYSMAP is not set
30182 +CONFIG_MTD_PHYSMAP_OF=y
30183 +# CONFIG_MTD_INTEL_VR_NOR is not set
30184 +# CONFIG_MTD_PLATRAM is not set
30185 +
30186 +#
30187 +# Self-contained MTD device drivers
30188 +#
30189 +# CONFIG_MTD_PMC551 is not set
30190 +# CONFIG_MTD_SLRAM is not set
30191 +# CONFIG_MTD_PHRAM is not set
30192 +# CONFIG_MTD_MTDRAM is not set
30193 +# CONFIG_MTD_BLOCK2MTD is not set
30194 +
30195 +#
30196 +# Disk-On-Chip Device Drivers
30197 +#
30198 +# CONFIG_MTD_DOC2000 is not set
30199 +# CONFIG_MTD_DOC2001 is not set
30200 +# CONFIG_MTD_DOC2001PLUS is not set
30201 +# CONFIG_MTD_NAND is not set
30202 +# CONFIG_MTD_ONENAND is not set
30203 +
30204 +#
30205 +# UBI - Unsorted block images
30206 +#
30207 +# CONFIG_MTD_UBI is not set
30208 +CONFIG_OF_DEVICE=y
30209 +# CONFIG_PARPORT is not set
30210 +CONFIG_BLK_DEV=y
30211 +# CONFIG_BLK_DEV_FD is not set
30212 +# CONFIG_BLK_CPQ_DA is not set
30213 +# CONFIG_BLK_CPQ_CISS_DA is not set
30214 +# CONFIG_BLK_DEV_DAC960 is not set
30215 +# CONFIG_BLK_DEV_UMEM is not set
30216 +# CONFIG_BLK_DEV_COW_COMMON is not set
30217 +CONFIG_BLK_DEV_LOOP=y
30218 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
30219 +# CONFIG_BLK_DEV_NBD is not set
30220 +# CONFIG_BLK_DEV_SX8 is not set
30221 +# CONFIG_BLK_DEV_UB is not set
30222 +CONFIG_BLK_DEV_RAM=y
30223 +CONFIG_BLK_DEV_RAM_COUNT=16
30224 +CONFIG_BLK_DEV_RAM_SIZE=32768
30225 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
30226 +# CONFIG_CDROM_PKTCDVD is not set
30227 +# CONFIG_ATA_OVER_ETH is not set
30228 +CONFIG_MISC_DEVICES=y
30229 +# CONFIG_PHANTOM is not set
30230 +# CONFIG_EEPROM_93CX6 is not set
30231 +# CONFIG_SGI_IOC4 is not set
30232 +# CONFIG_TIFM_CORE is not set
30233 +# CONFIG_IDE is not set
30234 +
30235 +#
30236 +# SCSI device support
30237 +#
30238 +# CONFIG_RAID_ATTRS is not set
30239 +CONFIG_SCSI=y
30240 +CONFIG_SCSI_DMA=y
30241 +CONFIG_SCSI_TGT=y
30242 +# CONFIG_SCSI_NETLINK is not set
30243 +CONFIG_SCSI_PROC_FS=y
30244 +
30245 +#
30246 +# SCSI support type (disk, tape, CD-ROM)
30247 +#
30248 +CONFIG_BLK_DEV_SD=y
30249 +# CONFIG_CHR_DEV_ST is not set
30250 +# CONFIG_CHR_DEV_OSST is not set
30251 +# CONFIG_BLK_DEV_SR is not set
30252 +CONFIG_CHR_DEV_SG=y
30253 +# CONFIG_CHR_DEV_SCH is not set
30254 +
30255 +#
30256 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
30257 +#
30258 +# CONFIG_SCSI_MULTI_LUN is not set
30259 +# CONFIG_SCSI_CONSTANTS is not set
30260 +# CONFIG_SCSI_LOGGING is not set
30261 +# CONFIG_SCSI_SCAN_ASYNC is not set
30262 +CONFIG_SCSI_WAIT_SCAN=m
30263 +
30264 +#
30265 +# SCSI Transports
30266 +#
30267 +# CONFIG_SCSI_SPI_ATTRS is not set
30268 +# CONFIG_SCSI_FC_ATTRS is not set
30269 +# CONFIG_SCSI_ISCSI_ATTRS is not set
30270 +# CONFIG_SCSI_SAS_LIBSAS is not set
30271 +# CONFIG_SCSI_SRP_ATTRS is not set
30272 +CONFIG_SCSI_LOWLEVEL=y
30273 +# CONFIG_ISCSI_TCP is not set
30274 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
30275 +# CONFIG_SCSI_3W_9XXX is not set
30276 +# CONFIG_SCSI_ACARD is not set
30277 +# CONFIG_SCSI_AACRAID is not set
30278 +# CONFIG_SCSI_AIC7XXX is not set
30279 +# CONFIG_SCSI_AIC7XXX_OLD is not set
30280 +# CONFIG_SCSI_AIC79XX is not set
30281 +# CONFIG_SCSI_AIC94XX is not set
30282 +# CONFIG_SCSI_DPT_I2O is not set
30283 +# CONFIG_SCSI_ADVANSYS is not set
30284 +# CONFIG_SCSI_ARCMSR is not set
30285 +# CONFIG_MEGARAID_NEWGEN is not set
30286 +# CONFIG_MEGARAID_LEGACY is not set
30287 +# CONFIG_MEGARAID_SAS is not set
30288 +# CONFIG_SCSI_HPTIOP is not set
30289 +# CONFIG_SCSI_BUSLOGIC is not set
30290 +# CONFIG_SCSI_DMX3191D is not set
30291 +# CONFIG_SCSI_EATA is not set
30292 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
30293 +# CONFIG_SCSI_GDTH is not set
30294 +# CONFIG_SCSI_IPS is not set
30295 +# CONFIG_SCSI_INITIO is not set
30296 +# CONFIG_SCSI_INIA100 is not set
30297 +# CONFIG_SCSI_STEX is not set
30298 +# CONFIG_SCSI_SYM53C8XX_2 is not set
30299 +# CONFIG_SCSI_IPR is not set
30300 +# CONFIG_SCSI_QLOGIC_1280 is not set
30301 +# CONFIG_SCSI_QLA_FC is not set
30302 +# CONFIG_SCSI_QLA_ISCSI is not set
30303 +# CONFIG_SCSI_LPFC is not set
30304 +# CONFIG_SCSI_DC395x is not set
30305 +# CONFIG_SCSI_DC390T is not set
30306 +# CONFIG_SCSI_NSP32 is not set
30307 +# CONFIG_SCSI_DEBUG is not set
30308 +# CONFIG_SCSI_SRP is not set
30309 +CONFIG_ATA=y
30310 +# CONFIG_ATA_NONSTANDARD is not set
30311 +# CONFIG_SATA_AHCI is not set
30312 +# CONFIG_SATA_SVW is not set
30313 +# CONFIG_ATA_PIIX is not set
30314 +# CONFIG_SATA_MV is not set
30315 +# CONFIG_SATA_NV is not set
30316 +# CONFIG_PDC_ADMA is not set
30317 +# CONFIG_SATA_QSTOR is not set
30318 +# CONFIG_SATA_PROMISE is not set
30319 +# CONFIG_SATA_SX4 is not set
30320 +# CONFIG_SATA_SIL is not set
30321 +# CONFIG_SATA_SIL24 is not set
30322 +# CONFIG_SATA_SIS is not set
30323 +# CONFIG_SATA_ULI is not set
30324 +# CONFIG_SATA_VIA is not set
30325 +# CONFIG_SATA_VITESSE is not set
30326 +# CONFIG_SATA_INIC162X is not set
30327 +# CONFIG_PATA_ALI is not set
30328 +# CONFIG_PATA_AMD is not set
30329 +# CONFIG_PATA_ARTOP is not set
30330 +# CONFIG_PATA_ATIIXP is not set
30331 +# CONFIG_PATA_CMD640_PCI is not set
30332 +# CONFIG_PATA_CMD64X is not set
30333 +# CONFIG_PATA_CS5520 is not set
30334 +# CONFIG_PATA_CS5530 is not set
30335 +# CONFIG_PATA_CYPRESS is not set
30336 +# CONFIG_PATA_EFAR is not set
30337 +# CONFIG_ATA_GENERIC is not set
30338 +# CONFIG_PATA_HPT366 is not set
30339 +# CONFIG_PATA_HPT37X is not set
30340 +# CONFIG_PATA_HPT3X2N is not set
30341 +# CONFIG_PATA_HPT3X3 is not set
30342 +# CONFIG_PATA_IT821X is not set
30343 +# CONFIG_PATA_IT8213 is not set
30344 +# CONFIG_PATA_JMICRON is not set
30345 +# CONFIG_PATA_TRIFLEX is not set
30346 +# CONFIG_PATA_MARVELL is not set
30347 +CONFIG_PATA_MPC52xx=y
30348 +# CONFIG_PATA_MPIIX is not set
30349 +# CONFIG_PATA_OLDPIIX is not set
30350 +# CONFIG_PATA_NETCELL is not set
30351 +# CONFIG_PATA_NS87410 is not set
30352 +# CONFIG_PATA_NS87415 is not set
30353 +# CONFIG_PATA_OPTI is not set
30354 +# CONFIG_PATA_OPTIDMA is not set
30355 +# CONFIG_PATA_PDC_OLD is not set
30356 +# CONFIG_PATA_RADISYS is not set
30357 +# CONFIG_PATA_RZ1000 is not set
30358 +# CONFIG_PATA_SC1200 is not set
30359 +# CONFIG_PATA_SERVERWORKS is not set
30360 +# CONFIG_PATA_PDC2027X is not set
30361 +# CONFIG_PATA_SIL680 is not set
30362 +# CONFIG_PATA_SIS is not set
30363 +# CONFIG_PATA_VIA is not set
30364 +# CONFIG_PATA_WINBOND is not set
30365 +CONFIG_PATA_PLATFORM=y
30366 +# CONFIG_PATA_OF_PLATFORM is not set
30367 +# CONFIG_MD is not set
30368 +# CONFIG_FUSION is not set
30369 +
30370 +#
30371 +# IEEE 1394 (FireWire) support
30372 +#
30373 +# CONFIG_FIREWIRE is not set
30374 +# CONFIG_IEEE1394 is not set
30375 +# CONFIG_I2O is not set
30376 +# CONFIG_MACINTOSH_DRIVERS is not set
30377 +CONFIG_NETDEVICES=y
30378 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
30379 +# CONFIG_DUMMY is not set
30380 +# CONFIG_BONDING is not set
30381 +# CONFIG_MACVLAN is not set
30382 +# CONFIG_EQUALIZER is not set
30383 +# CONFIG_TUN is not set
30384 +# CONFIG_VETH is not set
30385 +# CONFIG_IP1000 is not set
30386 +# CONFIG_ARCNET is not set
30387 +CONFIG_PHYLIB=y
30388 +
30389 +#
30390 +# MII PHY device drivers
30391 +#
30392 +# CONFIG_MARVELL_PHY is not set
30393 +# CONFIG_DAVICOM_PHY is not set
30394 +# CONFIG_QSEMI_PHY is not set
30395 +# CONFIG_LXT_PHY is not set
30396 +# CONFIG_CICADA_PHY is not set
30397 +# CONFIG_VITESSE_PHY is not set
30398 +# CONFIG_SMSC_PHY is not set
30399 +# CONFIG_BROADCOM_PHY is not set
30400 +# CONFIG_ICPLUS_PHY is not set
30401 +# CONFIG_FIXED_PHY is not set
30402 +# CONFIG_MDIO_BITBANG is not set
30403 +CONFIG_NET_ETHERNET=y
30404 +# CONFIG_MII is not set
30405 +# CONFIG_HAPPYMEAL is not set
30406 +# CONFIG_SUNGEM is not set
30407 +# CONFIG_CASSINI is not set
30408 +# CONFIG_NET_VENDOR_3COM is not set
30409 +# CONFIG_NET_TULIP is not set
30410 +# CONFIG_HP100 is not set
30411 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
30412 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
30413 +# CONFIG_IBM_NEW_EMAC_TAH is not set
30414 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
30415 +# CONFIG_NET_PCI is not set
30416 +# CONFIG_B44 is not set
30417 +CONFIG_FEC_MPC52xx=y
30418 +CONFIG_FEC_MPC52xx_MDIO=y
30419 +# CONFIG_NETDEV_1000 is not set
30420 +# CONFIG_NETDEV_10000 is not set
30421 +# CONFIG_TR is not set
30422 +
30423 +#
30424 +# Wireless LAN
30425 +#
30426 +# CONFIG_WLAN_PRE80211 is not set
30427 +# CONFIG_WLAN_80211 is not set
30428 +
30429 +#
30430 +# USB Network Adapters
30431 +#
30432 +# CONFIG_USB_CATC is not set
30433 +# CONFIG_USB_KAWETH is not set
30434 +# CONFIG_USB_PEGASUS is not set
30435 +# CONFIG_USB_RTL8150 is not set
30436 +# CONFIG_USB_USBNET is not set
30437 +# CONFIG_WAN is not set
30438 +# CONFIG_FDDI is not set
30439 +# CONFIG_HIPPI is not set
30440 +# CONFIG_PPP is not set
30441 +# CONFIG_SLIP is not set
30442 +# CONFIG_NET_FC is not set
30443 +# CONFIG_SHAPER is not set
30444 +# CONFIG_NETCONSOLE is not set
30445 +# CONFIG_NETPOLL is not set
30446 +# CONFIG_NET_POLL_CONTROLLER is not set
30447 +# CONFIG_ISDN is not set
30448 +# CONFIG_PHONE is not set
30449 +
30450 +#
30451 +# Input device support
30452 +#
30453 +# CONFIG_INPUT is not set
30454 +
30455 +#
30456 +# Hardware I/O ports
30457 +#
30458 +# CONFIG_SERIO is not set
30459 +# CONFIG_GAMEPORT is not set
30460 +
30461 +#
30462 +# Character devices
30463 +#
30464 +# CONFIG_VT is not set
30465 +# CONFIG_SERIAL_NONSTANDARD is not set
30466 +
30467 +#
30468 +# Serial drivers
30469 +#
30470 +# CONFIG_SERIAL_8250 is not set
30471 +
30472 +#
30473 +# Non-8250 serial port support
30474 +#
30475 +# CONFIG_SERIAL_UARTLITE is not set
30476 +CONFIG_SERIAL_CORE=y
30477 +CONFIG_SERIAL_CORE_CONSOLE=y
30478 +CONFIG_SERIAL_MPC52xx=y
30479 +CONFIG_SERIAL_MPC52xx_CONSOLE=y
30480 +CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
30481 +# CONFIG_SERIAL_JSM is not set
30482 +CONFIG_UNIX98_PTYS=y
30483 +CONFIG_LEGACY_PTYS=y
30484 +CONFIG_LEGACY_PTY_COUNT=256
30485 +# CONFIG_HVC_RTAS is not set
30486 +# CONFIG_IPMI_HANDLER is not set
30487 +# CONFIG_HW_RANDOM is not set
30488 +# CONFIG_NVRAM is not set
30489 +CONFIG_GEN_RTC=y
30490 +# CONFIG_GEN_RTC_X is not set
30491 +# CONFIG_R3964 is not set
30492 +# CONFIG_APPLICOM is not set
30493 +# CONFIG_RAW_DRIVER is not set
30494 +# CONFIG_TCG_TPM is not set
30495 +CONFIG_DEVPORT=y
30496 +CONFIG_I2C=y
30497 +CONFIG_I2C_BOARDINFO=y
30498 +CONFIG_I2C_CHARDEV=y
30499 +
30500 +#
30501 +# I2C Algorithms
30502 +#
30503 +# CONFIG_I2C_ALGOBIT is not set
30504 +# CONFIG_I2C_ALGOPCF is not set
30505 +# CONFIG_I2C_ALGOPCA is not set
30506 +
30507 +#
30508 +# I2C Hardware Bus support
30509 +#
30510 +# CONFIG_I2C_ALI1535 is not set
30511 +# CONFIG_I2C_ALI1563 is not set
30512 +# CONFIG_I2C_ALI15X3 is not set
30513 +# CONFIG_I2C_AMD756 is not set
30514 +# CONFIG_I2C_AMD8111 is not set
30515 +# CONFIG_I2C_I801 is not set
30516 +# CONFIG_I2C_I810 is not set
30517 +# CONFIG_I2C_PIIX4 is not set
30518 +CONFIG_I2C_MPC=y
30519 +# CONFIG_I2C_NFORCE2 is not set
30520 +# CONFIG_I2C_OCORES is not set
30521 +# CONFIG_I2C_PARPORT_LIGHT is not set
30522 +# CONFIG_I2C_PROSAVAGE is not set
30523 +# CONFIG_I2C_SAVAGE4 is not set
30524 +# CONFIG_I2C_SIMTEC is not set
30525 +# CONFIG_I2C_SIS5595 is not set
30526 +# CONFIG_I2C_SIS630 is not set
30527 +# CONFIG_I2C_SIS96X is not set
30528 +# CONFIG_I2C_TAOS_EVM is not set
30529 +# CONFIG_I2C_STUB is not set
30530 +# CONFIG_I2C_TINY_USB is not set
30531 +# CONFIG_I2C_VIA is not set
30532 +# CONFIG_I2C_VIAPRO is not set
30533 +# CONFIG_I2C_VOODOO3 is not set
30534 +
30535 +#
30536 +# Miscellaneous I2C Chip support
30537 +#
30538 +# CONFIG_SENSORS_DS1337 is not set
30539 +# CONFIG_SENSORS_DS1374 is not set
30540 +# CONFIG_DS1682 is not set
30541 +# CONFIG_SENSORS_EEPROM is not set
30542 +# CONFIG_SENSORS_PCF8574 is not set
30543 +# CONFIG_SENSORS_PCA9539 is not set
30544 +# CONFIG_SENSORS_PCF8591 is not set
30545 +# CONFIG_SENSORS_M41T00 is not set
30546 +# CONFIG_SENSORS_MAX6875 is not set
30547 +# CONFIG_SENSORS_TSL2550 is not set
30548 +# CONFIG_I2C_DEBUG_CORE is not set
30549 +# CONFIG_I2C_DEBUG_ALGO is not set
30550 +# CONFIG_I2C_DEBUG_BUS is not set
30551 +# CONFIG_I2C_DEBUG_CHIP is not set
30552 +
30553 +#
30554 +# SPI support
30555 +#
30556 +# CONFIG_SPI is not set
30557 +# CONFIG_SPI_MASTER is not set
30558 +# CONFIG_W1 is not set
30559 +# CONFIG_POWER_SUPPLY is not set
30560 +CONFIG_HWMON=y
30561 +# CONFIG_HWMON_VID is not set
30562 +# CONFIG_SENSORS_AD7418 is not set
30563 +# CONFIG_SENSORS_ADM1021 is not set
30564 +# CONFIG_SENSORS_ADM1025 is not set
30565 +# CONFIG_SENSORS_ADM1026 is not set
30566 +# CONFIG_SENSORS_ADM1029 is not set
30567 +# CONFIG_SENSORS_ADM1031 is not set
30568 +# CONFIG_SENSORS_ADM9240 is not set
30569 +# CONFIG_SENSORS_ADT7470 is not set
30570 +# CONFIG_SENSORS_ATXP1 is not set
30571 +# CONFIG_SENSORS_DS1621 is not set
30572 +# CONFIG_SENSORS_I5K_AMB is not set
30573 +# CONFIG_SENSORS_F71805F is not set
30574 +# CONFIG_SENSORS_F71882FG is not set
30575 +# CONFIG_SENSORS_F75375S is not set
30576 +# CONFIG_SENSORS_GL518SM is not set
30577 +# CONFIG_SENSORS_GL520SM is not set
30578 +# CONFIG_SENSORS_IT87 is not set
30579 +# CONFIG_SENSORS_LM63 is not set
30580 +# CONFIG_SENSORS_LM75 is not set
30581 +# CONFIG_SENSORS_LM77 is not set
30582 +# CONFIG_SENSORS_LM78 is not set
30583 +# CONFIG_SENSORS_LM80 is not set
30584 +# CONFIG_SENSORS_LM83 is not set
30585 +# CONFIG_SENSORS_LM85 is not set
30586 +# CONFIG_SENSORS_LM87 is not set
30587 +# CONFIG_SENSORS_LM90 is not set
30588 +# CONFIG_SENSORS_LM92 is not set
30589 +# CONFIG_SENSORS_LM93 is not set
30590 +# CONFIG_SENSORS_MAX1619 is not set
30591 +# CONFIG_SENSORS_MAX6650 is not set
30592 +# CONFIG_SENSORS_PC87360 is not set
30593 +# CONFIG_SENSORS_PC87427 is not set
30594 +# CONFIG_SENSORS_SIS5595 is not set
30595 +# CONFIG_SENSORS_DME1737 is not set
30596 +# CONFIG_SENSORS_SMSC47M1 is not set
30597 +# CONFIG_SENSORS_SMSC47M192 is not set
30598 +# CONFIG_SENSORS_SMSC47B397 is not set
30599 +# CONFIG_SENSORS_THMC50 is not set
30600 +# CONFIG_SENSORS_VIA686A is not set
30601 +# CONFIG_SENSORS_VT1211 is not set
30602 +# CONFIG_SENSORS_VT8231 is not set
30603 +# CONFIG_SENSORS_W83781D is not set
30604 +# CONFIG_SENSORS_W83791D is not set
30605 +# CONFIG_SENSORS_W83792D is not set
30606 +# CONFIG_SENSORS_W83793 is not set
30607 +# CONFIG_SENSORS_W83L785TS is not set
30608 +# CONFIG_SENSORS_W83627HF is not set
30609 +# CONFIG_SENSORS_W83627EHF is not set
30610 +# CONFIG_HWMON_DEBUG_CHIP is not set
30611 +CONFIG_WATCHDOG=y
30612 +# CONFIG_WATCHDOG_NOWAYOUT is not set
30613 +
30614 +#
30615 +# Watchdog Device Drivers
30616 +#
30617 +# CONFIG_SOFT_WATCHDOG is not set
30618 +# CONFIG_MPC5200_WDT is not set
30619 +# CONFIG_WATCHDOG_RTAS is not set
30620 +
30621 +#
30622 +# PCI-based Watchdog Cards
30623 +#
30624 +# CONFIG_PCIPCWATCHDOG is not set
30625 +# CONFIG_WDTPCI is not set
30626 +
30627 +#
30628 +# USB-based Watchdog Cards
30629 +#
30630 +# CONFIG_USBPCWATCHDOG is not set
30631 +
30632 +#
30633 +# Sonics Silicon Backplane
30634 +#
30635 +CONFIG_SSB_POSSIBLE=y
30636 +# CONFIG_SSB is not set
30637 +
30638 +#
30639 +# Multifunction device drivers
30640 +#
30641 +# CONFIG_MFD_SM501 is not set
30642 +
30643 +#
30644 +# Multimedia devices
30645 +#
30646 +# CONFIG_VIDEO_DEV is not set
30647 +# CONFIG_DVB_CORE is not set
30648 +CONFIG_DAB=y
30649 +# CONFIG_USB_DABUSB is not set
30650 +
30651 +#
30652 +# Graphics support
30653 +#
30654 +# CONFIG_AGP is not set
30655 +# CONFIG_DRM is not set
30656 +# CONFIG_VGASTATE is not set
30657 +CONFIG_VIDEO_OUTPUT_CONTROL=m
30658 +# CONFIG_FB is not set
30659 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
30660 +
30661 +#
30662 +# Display device support
30663 +#
30664 +# CONFIG_DISPLAY_SUPPORT is not set
30665 +
30666 +#
30667 +# Sound
30668 +#
30669 +# CONFIG_SOUND is not set
30670 +CONFIG_USB_SUPPORT=y
30671 +CONFIG_USB_ARCH_HAS_HCD=y
30672 +CONFIG_USB_ARCH_HAS_OHCI=y
30673 +CONFIG_USB_ARCH_HAS_EHCI=y
30674 +CONFIG_USB=y
30675 +# CONFIG_USB_DEBUG is not set
30676 +
30677 +#
30678 +# Miscellaneous USB options
30679 +#
30680 +CONFIG_USB_DEVICEFS=y
30681 +# CONFIG_USB_DEVICE_CLASS is not set
30682 +# CONFIG_USB_DYNAMIC_MINORS is not set
30683 +# CONFIG_USB_SUSPEND is not set
30684 +# CONFIG_USB_PERSIST is not set
30685 +# CONFIG_USB_OTG is not set
30686 +
30687 +#
30688 +# USB Host Controller Drivers
30689 +#
30690 +# CONFIG_USB_EHCI_HCD is not set
30691 +# CONFIG_USB_ISP116X_HCD is not set
30692 +CONFIG_USB_OHCI_HCD=y
30693 +CONFIG_USB_OHCI_HCD_PPC_SOC=y
30694 +CONFIG_USB_OHCI_HCD_PPC_OF=y
30695 +CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
30696 +# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
30697 +CONFIG_USB_OHCI_HCD_PCI=y
30698 +CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
30699 +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
30700 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
30701 +# CONFIG_USB_UHCI_HCD is not set
30702 +# CONFIG_USB_SL811_HCD is not set
30703 +# CONFIG_USB_R8A66597_HCD is not set
30704 +
30705 +#
30706 +# USB Device Class drivers
30707 +#
30708 +# CONFIG_USB_ACM is not set
30709 +# CONFIG_USB_PRINTER is not set
30710 +
30711 +#
30712 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
30713 +#
30714 +
30715 +#
30716 +# may also be needed; see USB_STORAGE Help for more information
30717 +#
30718 +CONFIG_USB_STORAGE=y
30719 +# CONFIG_USB_STORAGE_DEBUG is not set
30720 +# CONFIG_USB_STORAGE_DATAFAB is not set
30721 +# CONFIG_USB_STORAGE_FREECOM is not set
30722 +# CONFIG_USB_STORAGE_ISD200 is not set
30723 +# CONFIG_USB_STORAGE_DPCM is not set
30724 +# CONFIG_USB_STORAGE_USBAT is not set
30725 +# CONFIG_USB_STORAGE_SDDR09 is not set
30726 +# CONFIG_USB_STORAGE_SDDR55 is not set
30727 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
30728 +# CONFIG_USB_STORAGE_ALAUDA is not set
30729 +# CONFIG_USB_STORAGE_KARMA is not set
30730 +# CONFIG_USB_LIBUSUAL is not set
30731 +
30732 +#
30733 +# USB Imaging devices
30734 +#
30735 +# CONFIG_USB_MDC800 is not set
30736 +# CONFIG_USB_MICROTEK is not set
30737 +CONFIG_USB_MON=y
30738 +
30739 +#
30740 +# USB port drivers
30741 +#
30742 +
30743 +#
30744 +# USB Serial Converter support
30745 +#
30746 +# CONFIG_USB_SERIAL is not set
30747 +
30748 +#
30749 +# USB Miscellaneous drivers
30750 +#
30751 +# CONFIG_USB_EMI62 is not set
30752 +# CONFIG_USB_EMI26 is not set
30753 +# CONFIG_USB_ADUTUX is not set
30754 +# CONFIG_USB_AUERSWALD is not set
30755 +# CONFIG_USB_RIO500 is not set
30756 +# CONFIG_USB_LEGOTOWER is not set
30757 +# CONFIG_USB_LCD is not set
30758 +# CONFIG_USB_BERRY_CHARGE is not set
30759 +# CONFIG_USB_LED is not set
30760 +# CONFIG_USB_CYPRESS_CY7C63 is not set
30761 +# CONFIG_USB_CYTHERM is not set
30762 +# CONFIG_USB_PHIDGET is not set
30763 +# CONFIG_USB_IDMOUSE is not set
30764 +# CONFIG_USB_FTDI_ELAN is not set
30765 +# CONFIG_USB_APPLEDISPLAY is not set
30766 +# CONFIG_USB_LD is not set
30767 +# CONFIG_USB_TRANCEVIBRATOR is not set
30768 +# CONFIG_USB_IOWARRIOR is not set
30769 +# CONFIG_USB_TEST is not set
30770 +
30771 +#
30772 +# USB DSL modem support
30773 +#
30774 +
30775 +#
30776 +# USB Gadget Support
30777 +#
30778 +# CONFIG_USB_GADGET is not set
30779 +# CONFIG_MMC is not set
30780 +CONFIG_NEW_LEDS=y
30781 +CONFIG_LEDS_CLASS=y
30782 +
30783 +#
30784 +# LED drivers
30785 +#
30786 +
30787 +#
30788 +# LED Triggers
30789 +#
30790 +CONFIG_LEDS_TRIGGERS=y
30791 +CONFIG_LEDS_TRIGGER_TIMER=y
30792 +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
30793 +# CONFIG_INFINIBAND is not set
30794 +# CONFIG_EDAC is not set
30795 +# CONFIG_RTC_CLASS is not set
30796 +
30797 +#
30798 +# Userspace I/O
30799 +#
30800 +# CONFIG_UIO is not set
30801 +
30802 +#
30803 +# File systems
30804 +#
30805 +CONFIG_EXT2_FS=y
30806 +# CONFIG_EXT2_FS_XATTR is not set
30807 +# CONFIG_EXT2_FS_XIP is not set
30808 +CONFIG_EXT3_FS=y
30809 +CONFIG_EXT3_FS_XATTR=y
30810 +# CONFIG_EXT3_FS_POSIX_ACL is not set
30811 +# CONFIG_EXT3_FS_SECURITY is not set
30812 +# CONFIG_EXT4DEV_FS is not set
30813 +CONFIG_JBD=y
30814 +CONFIG_FS_MBCACHE=y
30815 +# CONFIG_REISERFS_FS is not set
30816 +# CONFIG_JFS_FS is not set
30817 +# CONFIG_FS_POSIX_ACL is not set
30818 +# CONFIG_XFS_FS is not set
30819 +# CONFIG_GFS2_FS is not set
30820 +# CONFIG_OCFS2_FS is not set
30821 +# CONFIG_MINIX_FS is not set
30822 +# CONFIG_ROMFS_FS is not set
30823 +CONFIG_INOTIFY=y
30824 +CONFIG_INOTIFY_USER=y
30825 +# CONFIG_QUOTA is not set
30826 +CONFIG_DNOTIFY=y
30827 +# CONFIG_AUTOFS_FS is not set
30828 +# CONFIG_AUTOFS4_FS is not set
30829 +# CONFIG_FUSE_FS is not set
30830 +
30831 +#
30832 +# CD-ROM/DVD Filesystems
30833 +#
30834 +# CONFIG_ISO9660_FS is not set
30835 +# CONFIG_UDF_FS is not set
30836 +
30837 +#
30838 +# DOS/FAT/NT Filesystems
30839 +#
30840 +CONFIG_FAT_FS=y
30841 +CONFIG_MSDOS_FS=y
30842 +CONFIG_VFAT_FS=y
30843 +CONFIG_FAT_DEFAULT_CODEPAGE=437
30844 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
30845 +# CONFIG_NTFS_FS is not set
30846 +
30847 +#
30848 +# Pseudo filesystems
30849 +#
30850 +CONFIG_PROC_FS=y
30851 +CONFIG_PROC_KCORE=y
30852 +CONFIG_PROC_SYSCTL=y
30853 +CONFIG_SYSFS=y
30854 +CONFIG_TMPFS=y
30855 +# CONFIG_TMPFS_POSIX_ACL is not set
30856 +# CONFIG_HUGETLB_PAGE is not set
30857 +# CONFIG_CONFIGFS_FS is not set
30858 +
30859 +#
30860 +# Miscellaneous filesystems
30861 +#
30862 +# CONFIG_ADFS_FS is not set
30863 +# CONFIG_AFFS_FS is not set
30864 +# CONFIG_HFS_FS is not set
30865 +# CONFIG_HFSPLUS_FS is not set
30866 +# CONFIG_BEFS_FS is not set
30867 +# CONFIG_BFS_FS is not set
30868 +# CONFIG_EFS_FS is not set
30869 +CONFIG_JFFS2_FS=y
30870 +CONFIG_JFFS2_FS_DEBUG=0
30871 +CONFIG_JFFS2_FS_WRITEBUFFER=y
30872 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
30873 +# CONFIG_JFFS2_SUMMARY is not set
30874 +# CONFIG_JFFS2_FS_XATTR is not set
30875 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
30876 +CONFIG_JFFS2_ZLIB=y
30877 +# CONFIG_JFFS2_LZO is not set
30878 +CONFIG_JFFS2_RTIME=y
30879 +# CONFIG_JFFS2_RUBIN is not set
30880 +CONFIG_CRAMFS=y
30881 +# CONFIG_VXFS_FS is not set
30882 +# CONFIG_HPFS_FS is not set
30883 +# CONFIG_QNX4FS_FS is not set
30884 +# CONFIG_SYSV_FS is not set
30885 +# CONFIG_UFS_FS is not set
30886 +CONFIG_NETWORK_FILESYSTEMS=y
30887 +CONFIG_NFS_FS=y
30888 +CONFIG_NFS_V3=y
30889 +# CONFIG_NFS_V3_ACL is not set
30890 +CONFIG_NFS_V4=y
30891 +# CONFIG_NFS_DIRECTIO is not set
30892 +# CONFIG_NFSD is not set
30893 +CONFIG_ROOT_NFS=y
30894 +CONFIG_LOCKD=y
30895 +CONFIG_LOCKD_V4=y
30896 +CONFIG_NFS_COMMON=y
30897 +CONFIG_SUNRPC=y
30898 +CONFIG_SUNRPC_GSS=y
30899 +# CONFIG_SUNRPC_BIND34 is not set
30900 +CONFIG_RPCSEC_GSS_KRB5=y
30901 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
30902 +# CONFIG_SMB_FS is not set
30903 +# CONFIG_CIFS is not set
30904 +# CONFIG_NCP_FS is not set
30905 +# CONFIG_CODA_FS is not set
30906 +# CONFIG_AFS_FS is not set
30907 +
30908 +#
30909 +# Partition Types
30910 +#
30911 +# CONFIG_PARTITION_ADVANCED is not set
30912 +CONFIG_MSDOS_PARTITION=y
30913 +CONFIG_NLS=y
30914 +CONFIG_NLS_DEFAULT="iso8859-1"
30915 +CONFIG_NLS_CODEPAGE_437=y
30916 +# CONFIG_NLS_CODEPAGE_737 is not set
30917 +# CONFIG_NLS_CODEPAGE_775 is not set
30918 +# CONFIG_NLS_CODEPAGE_850 is not set
30919 +# CONFIG_NLS_CODEPAGE_852 is not set
30920 +# CONFIG_NLS_CODEPAGE_855 is not set
30921 +# CONFIG_NLS_CODEPAGE_857 is not set
30922 +# CONFIG_NLS_CODEPAGE_860 is not set
30923 +# CONFIG_NLS_CODEPAGE_861 is not set
30924 +# CONFIG_NLS_CODEPAGE_862 is not set
30925 +# CONFIG_NLS_CODEPAGE_863 is not set
30926 +# CONFIG_NLS_CODEPAGE_864 is not set
30927 +# CONFIG_NLS_CODEPAGE_865 is not set
30928 +# CONFIG_NLS_CODEPAGE_866 is not set
30929 +# CONFIG_NLS_CODEPAGE_869 is not set
30930 +# CONFIG_NLS_CODEPAGE_936 is not set
30931 +# CONFIG_NLS_CODEPAGE_950 is not set
30932 +# CONFIG_NLS_CODEPAGE_932 is not set
30933 +# CONFIG_NLS_CODEPAGE_949 is not set
30934 +# CONFIG_NLS_CODEPAGE_874 is not set
30935 +# CONFIG_NLS_ISO8859_8 is not set
30936 +# CONFIG_NLS_CODEPAGE_1250 is not set
30937 +# CONFIG_NLS_CODEPAGE_1251 is not set
30938 +# CONFIG_NLS_ASCII is not set
30939 +CONFIG_NLS_ISO8859_1=y
30940 +# CONFIG_NLS_ISO8859_2 is not set
30941 +# CONFIG_NLS_ISO8859_3 is not set
30942 +# CONFIG_NLS_ISO8859_4 is not set
30943 +# CONFIG_NLS_ISO8859_5 is not set
30944 +# CONFIG_NLS_ISO8859_6 is not set
30945 +# CONFIG_NLS_ISO8859_7 is not set
30946 +# CONFIG_NLS_ISO8859_9 is not set
30947 +# CONFIG_NLS_ISO8859_13 is not set
30948 +# CONFIG_NLS_ISO8859_14 is not set
30949 +# CONFIG_NLS_ISO8859_15 is not set
30950 +# CONFIG_NLS_KOI8_R is not set
30951 +# CONFIG_NLS_KOI8_U is not set
30952 +# CONFIG_NLS_UTF8 is not set
30953 +# CONFIG_DLM is not set
30954 +# CONFIG_UCC_SLOW is not set
30955 +
30956 +#
30957 +# Library routines
30958 +#
30959 +CONFIG_BITREVERSE=y
30960 +# CONFIG_CRC_CCITT is not set
30961 +# CONFIG_CRC16 is not set
30962 +# CONFIG_CRC_ITU_T is not set
30963 +CONFIG_CRC32=y
30964 +# CONFIG_CRC7 is not set
30965 +# CONFIG_LIBCRC32C is not set
30966 +CONFIG_ZLIB_INFLATE=y
30967 +CONFIG_ZLIB_DEFLATE=y
30968 +CONFIG_PLIST=y
30969 +CONFIG_HAS_IOMEM=y
30970 +CONFIG_HAS_IOPORT=y
30971 +CONFIG_HAS_DMA=y
30972 +# CONFIG_INSTRUMENTATION is not set
30973 +
30974 +#
30975 +# Kernel hacking
30976 +#
30977 +CONFIG_PRINTK_TIME=y
30978 +CONFIG_ENABLE_WARN_DEPRECATED=y
30979 +CONFIG_ENABLE_MUST_CHECK=y
30980 +# CONFIG_MAGIC_SYSRQ is not set
30981 +# CONFIG_UNUSED_SYMBOLS is not set
30982 +# CONFIG_DEBUG_FS is not set
30983 +# CONFIG_HEADERS_CHECK is not set
30984 +CONFIG_DEBUG_KERNEL=y
30985 +# CONFIG_DEBUG_SHIRQ is not set
30986 +CONFIG_DETECT_SOFTLOCKUP=y
30987 +CONFIG_SCHED_DEBUG=y
30988 +# CONFIG_SCHEDSTATS is not set
30989 +# CONFIG_TIMER_STATS is not set
30990 +# CONFIG_SLUB_DEBUG_ON is not set
30991 +# CONFIG_DEBUG_RT_MUTEXES is not set
30992 +# CONFIG_RT_MUTEX_TESTER is not set
30993 +# CONFIG_DEBUG_SPINLOCK is not set
30994 +# CONFIG_DEBUG_MUTEXES is not set
30995 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
30996 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
30997 +# CONFIG_DEBUG_KOBJECT is not set
30998 +# CONFIG_DEBUG_BUGVERBOSE is not set
30999 +CONFIG_DEBUG_INFO=y
31000 +# CONFIG_DEBUG_VM is not set
31001 +# CONFIG_DEBUG_LIST is not set
31002 +# CONFIG_DEBUG_SG is not set
31003 +CONFIG_FORCED_INLINING=y
31004 +# CONFIG_BOOT_PRINTK_DELAY is not set
31005 +# CONFIG_RCU_TORTURE_TEST is not set
31006 +# CONFIG_FAULT_INJECTION is not set
31007 +# CONFIG_SAMPLES is not set
31008 +# CONFIG_DEBUG_STACKOVERFLOW is not set
31009 +# CONFIG_DEBUG_STACK_USAGE is not set
31010 +# CONFIG_DEBUG_PAGEALLOC is not set
31011 +# CONFIG_DEBUGGER is not set
31012 +# CONFIG_BDI_SWITCH is not set
31013 +# CONFIG_BOOTX_TEXT is not set
31014 +# CONFIG_PPC_EARLY_DEBUG is not set
31015 +
31016 +#
31017 +# Security options
31018 +#
31019 +# CONFIG_KEYS is not set
31020 +# CONFIG_SECURITY is not set
31021 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
31022 +CONFIG_CRYPTO=y
31023 +CONFIG_CRYPTO_ALGAPI=y
31024 +CONFIG_CRYPTO_BLKCIPHER=y
31025 +CONFIG_CRYPTO_MANAGER=y
31026 +# CONFIG_CRYPTO_HMAC is not set
31027 +# CONFIG_CRYPTO_XCBC is not set
31028 +# CONFIG_CRYPTO_NULL is not set
31029 +# CONFIG_CRYPTO_MD4 is not set
31030 +CONFIG_CRYPTO_MD5=y
31031 +# CONFIG_CRYPTO_SHA1 is not set
31032 +# CONFIG_CRYPTO_SHA256 is not set
31033 +# CONFIG_CRYPTO_SHA512 is not set
31034 +# CONFIG_CRYPTO_WP512 is not set
31035 +# CONFIG_CRYPTO_TGR192 is not set
31036 +# CONFIG_CRYPTO_GF128MUL is not set
31037 +# CONFIG_CRYPTO_ECB is not set
31038 +CONFIG_CRYPTO_CBC=y
31039 +# CONFIG_CRYPTO_PCBC is not set
31040 +# CONFIG_CRYPTO_LRW is not set
31041 +# CONFIG_CRYPTO_XTS is not set
31042 +# CONFIG_CRYPTO_CRYPTD is not set
31043 +CONFIG_CRYPTO_DES=y
31044 +# CONFIG_CRYPTO_FCRYPT is not set
31045 +# CONFIG_CRYPTO_BLOWFISH is not set
31046 +# CONFIG_CRYPTO_TWOFISH is not set
31047 +# CONFIG_CRYPTO_SERPENT is not set
31048 +# CONFIG_CRYPTO_AES is not set
31049 +# CONFIG_CRYPTO_CAST5 is not set
31050 +# CONFIG_CRYPTO_CAST6 is not set
31051 +# CONFIG_CRYPTO_TEA is not set
31052 +# CONFIG_CRYPTO_ARC4 is not set
31053 +# CONFIG_CRYPTO_KHAZAD is not set
31054 +# CONFIG_CRYPTO_ANUBIS is not set
31055 +# CONFIG_CRYPTO_SEED is not set
31056 +# CONFIG_CRYPTO_DEFLATE is not set
31057 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
31058 +# CONFIG_CRYPTO_CRC32C is not set
31059 +# CONFIG_CRYPTO_CAMELLIA is not set
31060 +# CONFIG_CRYPTO_TEST is not set
31061 +# CONFIG_CRYPTO_AUTHENC is not set
31062 +CONFIG_CRYPTO_HW=y
31063 +CONFIG_PPC_CLOCK=y
31064 +CONFIG_PPC_LIB_RHEAP=y
31065 Index: linux-2.6.24.7/arch/powerpc/configs/mpc8313_rdb_defconfig
31066 ===================================================================
31067 --- linux-2.6.24.7.orig/arch/powerpc/configs/mpc8313_rdb_defconfig
31068 +++ linux-2.6.24.7/arch/powerpc/configs/mpc8313_rdb_defconfig
31069 @@ -1,7 +1,7 @@
31070  #
31071  # Automatically generated make config: don't edit
31072 -# Linux kernel version: 2.6.24-rc4
31073 -# Thu Dec  6 16:48:31 2007
31074 +# Linux kernel version: 2.6.24-rc6
31075 +# Thu Jan 17 16:35:55 2008
31076  #
31077  # CONFIG_PPC64 is not set
31078  
31079 @@ -144,6 +144,7 @@ CONFIG_MPC8313_RDB=y
31080  # CONFIG_MPC834x_MDS is not set
31081  # CONFIG_MPC834x_ITX is not set
31082  # CONFIG_MPC836x_MDS is not set
31083 +# CONFIG_MPC837x_MDS is not set
31084  CONFIG_PPC_MPC831x=y
31085  # CONFIG_MPIC is not set
31086  # CONFIG_MPIC_WEIRD is not set
31087 @@ -336,15 +337,16 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
31088  CONFIG_MTD=y
31089  # CONFIG_MTD_DEBUG is not set
31090  # CONFIG_MTD_CONCAT is not set
31091 -# CONFIG_MTD_PARTITIONS is not set
31092 +CONFIG_MTD_PARTITIONS=y
31093 +# CONFIG_MTD_REDBOOT_PARTS is not set
31094 +# CONFIG_MTD_CMDLINE_PARTS is not set
31095  
31096  #
31097  # User Modules And Translation Layers
31098  #
31099  CONFIG_MTD_CHAR=y
31100 -# CONFIG_MTD_BLKDEVS is not set
31101 -# CONFIG_MTD_BLOCK is not set
31102 -# CONFIG_MTD_BLOCK_RO is not set
31103 +CONFIG_MTD_BLKDEVS=y
31104 +CONFIG_MTD_BLOCK=y
31105  # CONFIG_FTL is not set
31106  # CONFIG_NFTL is not set
31107  # CONFIG_INFTL is not set
31108 @@ -381,11 +383,8 @@ CONFIG_MTD_CFI_UTIL=y
31109  # Mapping drivers for chip access
31110  #
31111  # CONFIG_MTD_COMPLEX_MAPPINGS is not set
31112 -CONFIG_MTD_PHYSMAP=y
31113 -CONFIG_MTD_PHYSMAP_START=0xfe000000
31114 -CONFIG_MTD_PHYSMAP_LEN=0x1000000
31115 -CONFIG_MTD_PHYSMAP_BANKWIDTH=2
31116 -# CONFIG_MTD_PHYSMAP_OF is not set
31117 +# CONFIG_MTD_PHYSMAP is not set
31118 +CONFIG_MTD_PHYSMAP_OF=y
31119  # CONFIG_MTD_INTEL_VR_NOR is not set
31120  # CONFIG_MTD_PLATRAM is not set
31121  
31122 @@ -406,7 +405,16 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
31123  # CONFIG_MTD_DOC2000 is not set
31124  # CONFIG_MTD_DOC2001 is not set
31125  # CONFIG_MTD_DOC2001PLUS is not set
31126 -# CONFIG_MTD_NAND is not set
31127 +CONFIG_MTD_NAND=y
31128 +CONFIG_MTD_NAND_VERIFY_WRITE=y
31129 +# CONFIG_MTD_NAND_ECC_SMC is not set
31130 +# CONFIG_MTD_NAND_MUSEUM_IDS is not set
31131 +CONFIG_MTD_NAND_IDS=y
31132 +# CONFIG_MTD_NAND_DISKONCHIP is not set
31133 +# CONFIG_MTD_NAND_CAFE is not set
31134 +# CONFIG_MTD_NAND_NANDSIM is not set
31135 +# CONFIG_MTD_NAND_PLATFORM is not set
31136 +# CONFIG_MTD_ALAUDA is not set
31137  # CONFIG_MTD_ONENAND is not set
31138  
31139  #
31140 @@ -1178,7 +1186,17 @@ CONFIG_TMPFS=y
31141  # CONFIG_BEFS_FS is not set
31142  # CONFIG_BFS_FS is not set
31143  # CONFIG_EFS_FS is not set
31144 -# CONFIG_JFFS2_FS is not set
31145 +CONFIG_JFFS2_FS=y
31146 +CONFIG_JFFS2_FS_DEBUG=0
31147 +CONFIG_JFFS2_FS_WRITEBUFFER=y
31148 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
31149 +# CONFIG_JFFS2_SUMMARY is not set
31150 +# CONFIG_JFFS2_FS_XATTR is not set
31151 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
31152 +CONFIG_JFFS2_ZLIB=y
31153 +# CONFIG_JFFS2_LZO is not set
31154 +CONFIG_JFFS2_RTIME=y
31155 +# CONFIG_JFFS2_RUBIN is not set
31156  # CONFIG_CRAMFS is not set
31157  # CONFIG_VXFS_FS is not set
31158  # CONFIG_HPFS_FS is not set
31159 @@ -1242,6 +1260,8 @@ CONFIG_BITREVERSE=y
31160  CONFIG_CRC32=y
31161  # CONFIG_CRC7 is not set
31162  # CONFIG_LIBCRC32C is not set
31163 +CONFIG_ZLIB_INFLATE=y
31164 +CONFIG_ZLIB_DEFLATE=y
31165  CONFIG_PLIST=y
31166  CONFIG_HAS_IOMEM=y
31167  CONFIG_HAS_IOPORT=y
31168 Index: linux-2.6.24.7/arch/powerpc/configs/mpc834x_itx_defconfig
31169 ===================================================================
31170 --- linux-2.6.24.7.orig/arch/powerpc/configs/mpc834x_itx_defconfig
31171 +++ linux-2.6.24.7/arch/powerpc/configs/mpc834x_itx_defconfig
31172 @@ -570,7 +570,8 @@ CONFIG_SATA_SIL=y
31173  # CONFIG_PATA_SIS is not set
31174  # CONFIG_PATA_VIA is not set
31175  # CONFIG_PATA_WINBOND is not set
31176 -# CONFIG_PATA_PLATFORM is not set
31177 +CONFIG_PATA_PLATFORM=y
31178 +CONFIG_PATA_OF_PLATFORM=y
31179  CONFIG_MD=y
31180  CONFIG_BLK_DEV_MD=y
31181  CONFIG_MD_LINEAR=y
31182 Index: linux-2.6.24.7/arch/powerpc/configs/mpc837x_mds_defconfig
31183 ===================================================================
31184 --- /dev/null
31185 +++ linux-2.6.24.7/arch/powerpc/configs/mpc837x_mds_defconfig
31186 @@ -0,0 +1,878 @@
31187 +#
31188 +# Automatically generated make config: don't edit
31189 +# Linux kernel version: 2.6.23
31190 +# Wed Oct 10 16:31:39 2007
31191 +#
31192 +# CONFIG_PPC64 is not set
31193 +
31194 +#
31195 +# Processor support
31196 +#
31197 +CONFIG_6xx=y
31198 +# CONFIG_PPC_85xx is not set
31199 +# CONFIG_PPC_8xx is not set
31200 +# CONFIG_40x is not set
31201 +# CONFIG_44x is not set
31202 +# CONFIG_E200 is not set
31203 +CONFIG_83xx=y
31204 +CONFIG_PPC_FPU=y
31205 +CONFIG_PPC_STD_MMU=y
31206 +CONFIG_PPC_STD_MMU_32=y
31207 +# CONFIG_PPC_MM_SLICES is not set
31208 +# CONFIG_SMP is not set
31209 +CONFIG_PPC32=y
31210 +CONFIG_PPC_MERGE=y
31211 +CONFIG_MMU=y
31212 +CONFIG_GENERIC_HARDIRQS=y
31213 +CONFIG_IRQ_PER_CPU=y
31214 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
31215 +CONFIG_ARCH_HAS_ILOG2_U32=y
31216 +CONFIG_GENERIC_HWEIGHT=y
31217 +CONFIG_GENERIC_CALIBRATE_DELAY=y
31218 +CONFIG_GENERIC_FIND_NEXT_BIT=y
31219 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
31220 +CONFIG_PPC=y
31221 +CONFIG_EARLY_PRINTK=y
31222 +CONFIG_GENERIC_NVRAM=y
31223 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
31224 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
31225 +CONFIG_PPC_OF=y
31226 +CONFIG_OF=y
31227 +CONFIG_PPC_UDBG_16550=y
31228 +# CONFIG_GENERIC_TBSYNC is not set
31229 +CONFIG_AUDIT_ARCH=y
31230 +CONFIG_GENERIC_BUG=y
31231 +CONFIG_DEFAULT_UIMAGE=y
31232 +# CONFIG_PPC_DCR_NATIVE is not set
31233 +# CONFIG_PPC_DCR_MMIO is not set
31234 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
31235 +
31236 +#
31237 +# General setup
31238 +#
31239 +CONFIG_EXPERIMENTAL=y
31240 +CONFIG_BROKEN_ON_SMP=y
31241 +CONFIG_INIT_ENV_ARG_LIMIT=32
31242 +CONFIG_LOCALVERSION=""
31243 +CONFIG_LOCALVERSION_AUTO=y
31244 +CONFIG_SWAP=y
31245 +CONFIG_SYSVIPC=y
31246 +CONFIG_SYSVIPC_SYSCTL=y
31247 +# CONFIG_POSIX_MQUEUE is not set
31248 +# CONFIG_BSD_PROCESS_ACCT is not set
31249 +# CONFIG_TASKSTATS is not set
31250 +# CONFIG_USER_NS is not set
31251 +# CONFIG_AUDIT is not set
31252 +# CONFIG_IKCONFIG is not set
31253 +CONFIG_LOG_BUF_SHIFT=14
31254 +CONFIG_SYSFS_DEPRECATED=y
31255 +# CONFIG_RELAY is not set
31256 +CONFIG_BLK_DEV_INITRD=y
31257 +CONFIG_INITRAMFS_SOURCE=""
31258 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
31259 +CONFIG_SYSCTL=y
31260 +CONFIG_EMBEDDED=y
31261 +CONFIG_SYSCTL_SYSCALL=y
31262 +CONFIG_KALLSYMS=y
31263 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
31264 +CONFIG_HOTPLUG=y
31265 +CONFIG_PRINTK=y
31266 +CONFIG_BUG=y
31267 +CONFIG_ELF_CORE=y
31268 +CONFIG_BASE_FULL=y
31269 +CONFIG_FUTEX=y
31270 +CONFIG_ANON_INODES=y
31271 +# CONFIG_EPOLL is not set
31272 +CONFIG_SIGNALFD=y
31273 +CONFIG_EVENTFD=y
31274 +CONFIG_SHMEM=y
31275 +CONFIG_VM_EVENT_COUNTERS=y
31276 +CONFIG_SLAB=y
31277 +# CONFIG_SLUB is not set
31278 +# CONFIG_SLOB is not set
31279 +CONFIG_RT_MUTEXES=y
31280 +# CONFIG_TINY_SHMEM is not set
31281 +CONFIG_BASE_SMALL=0
31282 +CONFIG_MODULES=y
31283 +CONFIG_MODULE_UNLOAD=y
31284 +# CONFIG_MODULE_FORCE_UNLOAD is not set
31285 +# CONFIG_MODVERSIONS is not set
31286 +# CONFIG_MODULE_SRCVERSION_ALL is not set
31287 +# CONFIG_KMOD is not set
31288 +CONFIG_BLOCK=y
31289 +# CONFIG_LBD is not set
31290 +# CONFIG_BLK_DEV_IO_TRACE is not set
31291 +# CONFIG_LSF is not set
31292 +# CONFIG_BLK_DEV_BSG is not set
31293 +
31294 +#
31295 +# IO Schedulers
31296 +#
31297 +CONFIG_IOSCHED_NOOP=y
31298 +CONFIG_IOSCHED_AS=y
31299 +CONFIG_IOSCHED_DEADLINE=y
31300 +CONFIG_IOSCHED_CFQ=y
31301 +CONFIG_DEFAULT_AS=y
31302 +# CONFIG_DEFAULT_DEADLINE is not set
31303 +# CONFIG_DEFAULT_CFQ is not set
31304 +# CONFIG_DEFAULT_NOOP is not set
31305 +CONFIG_DEFAULT_IOSCHED="anticipatory"
31306 +
31307 +#
31308 +# Platform support
31309 +#
31310 +# CONFIG_PPC_MULTIPLATFORM is not set
31311 +# CONFIG_EMBEDDED6xx is not set
31312 +# CONFIG_PPC_82xx is not set
31313 +CONFIG_PPC_83xx=y
31314 +# CONFIG_PPC_86xx is not set
31315 +# CONFIG_PPC_MPC52xx is not set
31316 +# CONFIG_PPC_MPC5200 is not set
31317 +# CONFIG_PPC_CELL is not set
31318 +# CONFIG_PPC_CELL_NATIVE is not set
31319 +# CONFIG_PQ2ADS is not set
31320 +# CONFIG_MPC8313_RDB is not set
31321 +# CONFIG_MPC832x_MDS is not set
31322 +# CONFIG_MPC832x_RDB is not set
31323 +# CONFIG_MPC834x_MDS is not set
31324 +# CONFIG_MPC834x_ITX is not set
31325 +# CONFIG_MPC836x_MDS is not set
31326 +CONFIG_MPC837x_MDS=y
31327 +CONFIG_PPC_MPC837x=y
31328 +# CONFIG_MPIC is not set
31329 +# CONFIG_MPIC_WEIRD is not set
31330 +# CONFIG_PPC_I8259 is not set
31331 +# CONFIG_PPC_RTAS is not set
31332 +# CONFIG_MMIO_NVRAM is not set
31333 +# CONFIG_PPC_MPC106 is not set
31334 +# CONFIG_PPC_970_NAP is not set
31335 +# CONFIG_PPC_INDIRECT_IO is not set
31336 +# CONFIG_GENERIC_IOMAP is not set
31337 +# CONFIG_CPU_FREQ is not set
31338 +# CONFIG_CPM2 is not set
31339 +# CONFIG_FSL_ULI1575 is not set
31340 +CONFIG_FSL_SERDES=y
31341 +
31342 +#
31343 +# Kernel options
31344 +#
31345 +# CONFIG_HIGHMEM is not set
31346 +# CONFIG_HZ_100 is not set
31347 +CONFIG_HZ_250=y
31348 +# CONFIG_HZ_300 is not set
31349 +# CONFIG_HZ_1000 is not set
31350 +CONFIG_HZ=250
31351 +CONFIG_PREEMPT_NONE=y
31352 +# CONFIG_PREEMPT_VOLUNTARY is not set
31353 +# CONFIG_PREEMPT is not set
31354 +CONFIG_BINFMT_ELF=y
31355 +# CONFIG_BINFMT_MISC is not set
31356 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
31357 +CONFIG_ARCH_FLATMEM_ENABLE=y
31358 +CONFIG_ARCH_POPULATES_NODE_MAP=y
31359 +CONFIG_SELECT_MEMORY_MODEL=y
31360 +CONFIG_FLATMEM_MANUAL=y
31361 +# CONFIG_DISCONTIGMEM_MANUAL is not set
31362 +# CONFIG_SPARSEMEM_MANUAL is not set
31363 +CONFIG_FLATMEM=y
31364 +CONFIG_FLAT_NODE_MEM_MAP=y
31365 +# CONFIG_SPARSEMEM_STATIC is not set
31366 +CONFIG_SPLIT_PTLOCK_CPUS=4
31367 +# CONFIG_RESOURCES_64BIT is not set
31368 +CONFIG_ZONE_DMA_FLAG=1
31369 +CONFIG_BOUNCE=y
31370 +CONFIG_VIRT_TO_BUS=y
31371 +CONFIG_PROC_DEVICETREE=y
31372 +# CONFIG_CMDLINE_BOOL is not set
31373 +# CONFIG_PM is not set
31374 +CONFIG_SUSPEND_UP_POSSIBLE=y
31375 +CONFIG_HIBERNATION_UP_POSSIBLE=y
31376 +CONFIG_SECCOMP=y
31377 +CONFIG_WANT_DEVICE_TREE=y
31378 +CONFIG_DEVICE_TREE=""
31379 +CONFIG_ISA_DMA_API=y
31380 +
31381 +#
31382 +# Bus options
31383 +#
31384 +CONFIG_ZONE_DMA=y
31385 +CONFIG_GENERIC_ISA_DMA=y
31386 +CONFIG_PPC_INDIRECT_PCI=y
31387 +CONFIG_FSL_SOC=y
31388 +# CONFIG_PCI is not set
31389 +# CONFIG_PCI_DOMAINS is not set
31390 +# CONFIG_PCI_SYSCALL is not set
31391 +# CONFIG_ARCH_SUPPORTS_MSI is not set
31392 +
31393 +#
31394 +# PCCARD (PCMCIA/CardBus) support
31395 +#
31396 +# CONFIG_PCCARD is not set
31397 +
31398 +#
31399 +# Advanced setup
31400 +#
31401 +# CONFIG_ADVANCED_OPTIONS is not set
31402 +
31403 +#
31404 +# Default settings for advanced configuration options are used
31405 +#
31406 +CONFIG_HIGHMEM_START=0xfe000000
31407 +CONFIG_LOWMEM_SIZE=0x30000000
31408 +CONFIG_KERNEL_START=0xc0000000
31409 +CONFIG_TASK_SIZE=0x80000000
31410 +CONFIG_BOOT_LOAD=0x00800000
31411 +
31412 +#
31413 +# Networking
31414 +#
31415 +CONFIG_NET=y
31416 +
31417 +#
31418 +# Networking options
31419 +#
31420 +CONFIG_PACKET=y
31421 +# CONFIG_PACKET_MMAP is not set
31422 +CONFIG_UNIX=y
31423 +CONFIG_XFRM=y
31424 +CONFIG_XFRM_USER=m
31425 +# CONFIG_XFRM_SUB_POLICY is not set
31426 +# CONFIG_XFRM_MIGRATE is not set
31427 +# CONFIG_NET_KEY is not set
31428 +CONFIG_INET=y
31429 +CONFIG_IP_MULTICAST=y
31430 +# CONFIG_IP_ADVANCED_ROUTER is not set
31431 +CONFIG_IP_FIB_HASH=y
31432 +CONFIG_IP_PNP=y
31433 +CONFIG_IP_PNP_DHCP=y
31434 +CONFIG_IP_PNP_BOOTP=y
31435 +# CONFIG_IP_PNP_RARP is not set
31436 +# CONFIG_NET_IPIP is not set
31437 +# CONFIG_NET_IPGRE is not set
31438 +# CONFIG_IP_MROUTE is not set
31439 +# CONFIG_ARPD is not set
31440 +CONFIG_SYN_COOKIES=y
31441 +# CONFIG_INET_AH is not set
31442 +# CONFIG_INET_ESP is not set
31443 +# CONFIG_INET_IPCOMP is not set
31444 +# CONFIG_INET_XFRM_TUNNEL is not set
31445 +# CONFIG_INET_TUNNEL is not set
31446 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
31447 +CONFIG_INET_XFRM_MODE_TUNNEL=y
31448 +CONFIG_INET_XFRM_MODE_BEET=y
31449 +CONFIG_INET_DIAG=y
31450 +CONFIG_INET_TCP_DIAG=y
31451 +# CONFIG_TCP_CONG_ADVANCED is not set
31452 +CONFIG_TCP_CONG_CUBIC=y
31453 +CONFIG_DEFAULT_TCP_CONG="cubic"
31454 +# CONFIG_TCP_MD5SIG is not set
31455 +# CONFIG_IPV6 is not set
31456 +# CONFIG_INET6_XFRM_TUNNEL is not set
31457 +# CONFIG_INET6_TUNNEL is not set
31458 +# CONFIG_NETWORK_SECMARK is not set
31459 +# CONFIG_NETFILTER is not set
31460 +# CONFIG_IP_DCCP is not set
31461 +# CONFIG_IP_SCTP is not set
31462 +# CONFIG_TIPC is not set
31463 +# CONFIG_ATM is not set
31464 +# CONFIG_BRIDGE is not set
31465 +# CONFIG_VLAN_8021Q is not set
31466 +# CONFIG_DECNET is not set
31467 +# CONFIG_LLC2 is not set
31468 +# CONFIG_IPX is not set
31469 +# CONFIG_ATALK is not set
31470 +# CONFIG_X25 is not set
31471 +# CONFIG_LAPB is not set
31472 +# CONFIG_ECONET is not set
31473 +# CONFIG_WAN_ROUTER is not set
31474 +
31475 +#
31476 +# QoS and/or fair queueing
31477 +#
31478 +# CONFIG_NET_SCHED is not set
31479 +
31480 +#
31481 +# Network testing
31482 +#
31483 +# CONFIG_NET_PKTGEN is not set
31484 +# CONFIG_HAMRADIO is not set
31485 +# CONFIG_IRDA is not set
31486 +# CONFIG_BT is not set
31487 +# CONFIG_AF_RXRPC is not set
31488 +
31489 +#
31490 +# Wireless
31491 +#
31492 +# CONFIG_CFG80211 is not set
31493 +# CONFIG_WIRELESS_EXT is not set
31494 +# CONFIG_MAC80211 is not set
31495 +# CONFIG_IEEE80211 is not set
31496 +# CONFIG_RFKILL is not set
31497 +# CONFIG_NET_9P is not set
31498 +
31499 +#
31500 +# Device Drivers
31501 +#
31502 +
31503 +#
31504 +# Generic Driver Options
31505 +#
31506 +CONFIG_STANDALONE=y
31507 +CONFIG_PREVENT_FIRMWARE_BUILD=y
31508 +# CONFIG_FW_LOADER is not set
31509 +# CONFIG_SYS_HYPERVISOR is not set
31510 +# CONFIG_CONNECTOR is not set
31511 +# CONFIG_MTD is not set
31512 +CONFIG_OF_DEVICE=y
31513 +# CONFIG_PARPORT is not set
31514 +CONFIG_BLK_DEV=y
31515 +# CONFIG_BLK_DEV_FD is not set
31516 +# CONFIG_BLK_DEV_COW_COMMON is not set
31517 +CONFIG_BLK_DEV_LOOP=y
31518 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
31519 +# CONFIG_BLK_DEV_NBD is not set
31520 +CONFIG_BLK_DEV_RAM=y
31521 +CONFIG_BLK_DEV_RAM_COUNT=16
31522 +CONFIG_BLK_DEV_RAM_SIZE=32768
31523 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
31524 +# CONFIG_CDROM_PKTCDVD is not set
31525 +# CONFIG_ATA_OVER_ETH is not set
31526 +CONFIG_MISC_DEVICES=y
31527 +# CONFIG_EEPROM_93CX6 is not set
31528 +# CONFIG_IDE is not set
31529 +
31530 +#
31531 +# SCSI device support
31532 +#
31533 +# CONFIG_RAID_ATTRS is not set
31534 +CONFIG_SCSI=y
31535 +CONFIG_SCSI_DMA=y
31536 +# CONFIG_SCSI_TGT is not set
31537 +# CONFIG_SCSI_NETLINK is not set
31538 +CONFIG_SCSI_PROC_FS=y
31539 +
31540 +#
31541 +# SCSI support type (disk, tape, CD-ROM)
31542 +#
31543 +CONFIG_BLK_DEV_SD=y
31544 +# CONFIG_CHR_DEV_ST is not set
31545 +# CONFIG_CHR_DEV_OSST is not set
31546 +# CONFIG_BLK_DEV_SR is not set
31547 +CONFIG_CHR_DEV_SG=y
31548 +# CONFIG_CHR_DEV_SCH is not set
31549 +
31550 +#
31551 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
31552 +#
31553 +# CONFIG_SCSI_MULTI_LUN is not set
31554 +# CONFIG_SCSI_CONSTANTS is not set
31555 +# CONFIG_SCSI_LOGGING is not set
31556 +# CONFIG_SCSI_SCAN_ASYNC is not set
31557 +CONFIG_SCSI_WAIT_SCAN=m
31558 +
31559 +#
31560 +# SCSI Transports
31561 +#
31562 +# CONFIG_SCSI_SPI_ATTRS is not set
31563 +# CONFIG_SCSI_FC_ATTRS is not set
31564 +# CONFIG_SCSI_ISCSI_ATTRS is not set
31565 +# CONFIG_SCSI_SAS_LIBSAS is not set
31566 +CONFIG_SCSI_LOWLEVEL=y
31567 +# CONFIG_ISCSI_TCP is not set
31568 +# CONFIG_SCSI_DEBUG is not set
31569 +CONFIG_ATA=y
31570 +# CONFIG_ATA_NONSTANDARD is not set
31571 +CONFIG_SATA_FSL=y
31572 +# CONFIG_PATA_PLATFORM is not set
31573 +# CONFIG_MD is not set
31574 +# CONFIG_MACINTOSH_DRIVERS is not set
31575 +CONFIG_NETDEVICES=y
31576 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
31577 +# CONFIG_DUMMY is not set
31578 +# CONFIG_BONDING is not set
31579 +# CONFIG_MACVLAN is not set
31580 +# CONFIG_EQUALIZER is not set
31581 +# CONFIG_TUN is not set
31582 +CONFIG_PHYLIB=y
31583 +
31584 +#
31585 +# MII PHY device drivers
31586 +#
31587 +CONFIG_MARVELL_PHY=y
31588 +# CONFIG_DAVICOM_PHY is not set
31589 +# CONFIG_QSEMI_PHY is not set
31590 +# CONFIG_LXT_PHY is not set
31591 +# CONFIG_CICADA_PHY is not set
31592 +# CONFIG_VITESSE_PHY is not set
31593 +# CONFIG_SMSC_PHY is not set
31594 +# CONFIG_BROADCOM_PHY is not set
31595 +# CONFIG_ICPLUS_PHY is not set
31596 +# CONFIG_FIXED_PHY is not set
31597 +CONFIG_NET_ETHERNET=y
31598 +CONFIG_MII=y
31599 +CONFIG_NETDEV_1000=y
31600 +CONFIG_GIANFAR=y
31601 +# CONFIG_GFAR_NAPI is not set
31602 +CONFIG_NETDEV_10000=y
31603 +
31604 +#
31605 +# Wireless LAN
31606 +#
31607 +# CONFIG_WLAN_PRE80211 is not set
31608 +# CONFIG_WLAN_80211 is not set
31609 +# CONFIG_WAN is not set
31610 +# CONFIG_PPP is not set
31611 +# CONFIG_SLIP is not set
31612 +# CONFIG_SHAPER is not set
31613 +# CONFIG_NETCONSOLE is not set
31614 +# CONFIG_NETPOLL is not set
31615 +# CONFIG_NET_POLL_CONTROLLER is not set
31616 +# CONFIG_ISDN is not set
31617 +# CONFIG_PHONE is not set
31618 +
31619 +#
31620 +# Input device support
31621 +#
31622 +CONFIG_INPUT=y
31623 +# CONFIG_INPUT_FF_MEMLESS is not set
31624 +# CONFIG_INPUT_POLLDEV is not set
31625 +
31626 +#
31627 +# Userland interfaces
31628 +#
31629 +# CONFIG_INPUT_MOUSEDEV is not set
31630 +# CONFIG_INPUT_JOYDEV is not set
31631 +# CONFIG_INPUT_TSDEV is not set
31632 +# CONFIG_INPUT_EVDEV is not set
31633 +# CONFIG_INPUT_EVBUG is not set
31634 +
31635 +#
31636 +# Input Device Drivers
31637 +#
31638 +# CONFIG_INPUT_KEYBOARD is not set
31639 +# CONFIG_INPUT_MOUSE is not set
31640 +# CONFIG_INPUT_JOYSTICK is not set
31641 +# CONFIG_INPUT_TABLET is not set
31642 +# CONFIG_INPUT_TOUCHSCREEN is not set
31643 +# CONFIG_INPUT_MISC is not set
31644 +
31645 +#
31646 +# Hardware I/O ports
31647 +#
31648 +# CONFIG_SERIO is not set
31649 +# CONFIG_GAMEPORT is not set
31650 +
31651 +#
31652 +# Character devices
31653 +#
31654 +# CONFIG_VT is not set
31655 +# CONFIG_SERIAL_NONSTANDARD is not set
31656 +
31657 +#
31658 +# Serial drivers
31659 +#
31660 +CONFIG_SERIAL_8250=y
31661 +CONFIG_SERIAL_8250_CONSOLE=y
31662 +CONFIG_SERIAL_8250_NR_UARTS=4
31663 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
31664 +# CONFIG_SERIAL_8250_EXTENDED is not set
31665 +
31666 +#
31667 +# Non-8250 serial port support
31668 +#
31669 +# CONFIG_SERIAL_UARTLITE is not set
31670 +CONFIG_SERIAL_CORE=y
31671 +CONFIG_SERIAL_CORE_CONSOLE=y
31672 +# CONFIG_SERIAL_OF_PLATFORM is not set
31673 +CONFIG_UNIX98_PTYS=y
31674 +CONFIG_LEGACY_PTYS=y
31675 +CONFIG_LEGACY_PTY_COUNT=256
31676 +# CONFIG_IPMI_HANDLER is not set
31677 +CONFIG_WATCHDOG=y
31678 +# CONFIG_WATCHDOG_NOWAYOUT is not set
31679 +
31680 +#
31681 +# Watchdog Device Drivers
31682 +#
31683 +# CONFIG_SOFT_WATCHDOG is not set
31684 +CONFIG_83xx_WDT=y
31685 +# CONFIG_HW_RANDOM is not set
31686 +# CONFIG_NVRAM is not set
31687 +CONFIG_GEN_RTC=y
31688 +# CONFIG_GEN_RTC_X is not set
31689 +# CONFIG_R3964 is not set
31690 +# CONFIG_RAW_DRIVER is not set
31691 +# CONFIG_TCG_TPM is not set
31692 +CONFIG_I2C=y
31693 +CONFIG_I2C_BOARDINFO=y
31694 +CONFIG_I2C_CHARDEV=y
31695 +
31696 +#
31697 +# I2C Algorithms
31698 +#
31699 +# CONFIG_I2C_ALGOBIT is not set
31700 +# CONFIG_I2C_ALGOPCF is not set
31701 +# CONFIG_I2C_ALGOPCA is not set
31702 +
31703 +#
31704 +# I2C Hardware Bus support
31705 +#
31706 +CONFIG_I2C_MPC=y
31707 +# CONFIG_I2C_OCORES is not set
31708 +# CONFIG_I2C_PARPORT_LIGHT is not set
31709 +# CONFIG_I2C_SIMTEC is not set
31710 +# CONFIG_I2C_TAOS_EVM is not set
31711 +# CONFIG_I2C_STUB is not set
31712 +
31713 +#
31714 +# Miscellaneous I2C Chip support
31715 +#
31716 +# CONFIG_SENSORS_DS1337 is not set
31717 +# CONFIG_SENSORS_DS1374 is not set
31718 +# CONFIG_DS1682 is not set
31719 +# CONFIG_SENSORS_EEPROM is not set
31720 +# CONFIG_SENSORS_PCF8574 is not set
31721 +# CONFIG_SENSORS_PCA9539 is not set
31722 +# CONFIG_SENSORS_PCF8591 is not set
31723 +# CONFIG_SENSORS_M41T00 is not set
31724 +# CONFIG_SENSORS_MAX6875 is not set
31725 +# CONFIG_SENSORS_TSL2550 is not set
31726 +# CONFIG_I2C_DEBUG_CORE is not set
31727 +# CONFIG_I2C_DEBUG_ALGO is not set
31728 +# CONFIG_I2C_DEBUG_BUS is not set
31729 +# CONFIG_I2C_DEBUG_CHIP is not set
31730 +
31731 +#
31732 +# SPI support
31733 +#
31734 +# CONFIG_SPI is not set
31735 +# CONFIG_SPI_MASTER is not set
31736 +# CONFIG_W1 is not set
31737 +# CONFIG_POWER_SUPPLY is not set
31738 +CONFIG_HWMON=y
31739 +# CONFIG_HWMON_VID is not set
31740 +# CONFIG_SENSORS_ABITUGURU is not set
31741 +# CONFIG_SENSORS_ABITUGURU3 is not set
31742 +# CONFIG_SENSORS_AD7418 is not set
31743 +# CONFIG_SENSORS_ADM1021 is not set
31744 +# CONFIG_SENSORS_ADM1025 is not set
31745 +# CONFIG_SENSORS_ADM1026 is not set
31746 +# CONFIG_SENSORS_ADM1029 is not set
31747 +# CONFIG_SENSORS_ADM1031 is not set
31748 +# CONFIG_SENSORS_ADM9240 is not set
31749 +# CONFIG_SENSORS_ASB100 is not set
31750 +# CONFIG_SENSORS_ATXP1 is not set
31751 +# CONFIG_SENSORS_DS1621 is not set
31752 +# CONFIG_SENSORS_F71805F is not set
31753 +# CONFIG_SENSORS_FSCHER is not set
31754 +# CONFIG_SENSORS_FSCPOS is not set
31755 +# CONFIG_SENSORS_GL518SM is not set
31756 +# CONFIG_SENSORS_GL520SM is not set
31757 +# CONFIG_SENSORS_IT87 is not set
31758 +# CONFIG_SENSORS_LM63 is not set
31759 +# CONFIG_SENSORS_LM75 is not set
31760 +# CONFIG_SENSORS_LM77 is not set
31761 +# CONFIG_SENSORS_LM78 is not set
31762 +# CONFIG_SENSORS_LM80 is not set
31763 +# CONFIG_SENSORS_LM83 is not set
31764 +# CONFIG_SENSORS_LM85 is not set
31765 +# CONFIG_SENSORS_LM87 is not set
31766 +# CONFIG_SENSORS_LM90 is not set
31767 +# CONFIG_SENSORS_LM92 is not set
31768 +# CONFIG_SENSORS_LM93 is not set
31769 +# CONFIG_SENSORS_MAX1619 is not set
31770 +# CONFIG_SENSORS_MAX6650 is not set
31771 +# CONFIG_SENSORS_PC87360 is not set
31772 +# CONFIG_SENSORS_PC87427 is not set
31773 +# CONFIG_SENSORS_DME1737 is not set
31774 +# CONFIG_SENSORS_SMSC47M1 is not set
31775 +# CONFIG_SENSORS_SMSC47M192 is not set
31776 +# CONFIG_SENSORS_SMSC47B397 is not set
31777 +# CONFIG_SENSORS_THMC50 is not set
31778 +# CONFIG_SENSORS_VT1211 is not set
31779 +# CONFIG_SENSORS_W83781D is not set
31780 +# CONFIG_SENSORS_W83791D is not set
31781 +# CONFIG_SENSORS_W83792D is not set
31782 +# CONFIG_SENSORS_W83793 is not set
31783 +# CONFIG_SENSORS_W83L785TS is not set
31784 +# CONFIG_SENSORS_W83627HF is not set
31785 +# CONFIG_SENSORS_W83627EHF is not set
31786 +# CONFIG_HWMON_DEBUG_CHIP is not set
31787 +
31788 +#
31789 +# Multifunction device drivers
31790 +#
31791 +# CONFIG_MFD_SM501 is not set
31792 +
31793 +#
31794 +# Multimedia devices
31795 +#
31796 +# CONFIG_VIDEO_DEV is not set
31797 +# CONFIG_DVB_CORE is not set
31798 +CONFIG_DAB=y
31799 +
31800 +#
31801 +# Graphics support
31802 +#
31803 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
31804 +
31805 +#
31806 +# Display device support
31807 +#
31808 +# CONFIG_DISPLAY_SUPPORT is not set
31809 +# CONFIG_VGASTATE is not set
31810 +CONFIG_VIDEO_OUTPUT_CONTROL=m
31811 +# CONFIG_FB is not set
31812 +# CONFIG_FB_IBM_GXT4500 is not set
31813 +
31814 +#
31815 +# Sound
31816 +#
31817 +# CONFIG_SOUND is not set
31818 +CONFIG_HID_SUPPORT=y
31819 +CONFIG_HID=y
31820 +# CONFIG_HID_DEBUG is not set
31821 +CONFIG_USB_SUPPORT=y
31822 +CONFIG_USB_ARCH_HAS_HCD=y
31823 +# CONFIG_USB_ARCH_HAS_OHCI is not set
31824 +CONFIG_USB_ARCH_HAS_EHCI=y
31825 +# CONFIG_USB is not set
31826 +
31827 +#
31828 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
31829 +#
31830 +
31831 +#
31832 +# USB Gadget Support
31833 +#
31834 +# CONFIG_USB_GADGET is not set
31835 +# CONFIG_MMC is not set
31836 +# CONFIG_NEW_LEDS is not set
31837 +# CONFIG_EDAC is not set
31838 +# CONFIG_RTC_CLASS is not set
31839 +
31840 +#
31841 +# DMA Engine support
31842 +#
31843 +# CONFIG_DMA_ENGINE is not set
31844 +
31845 +#
31846 +# DMA Clients
31847 +#
31848 +
31849 +#
31850 +# DMA Devices
31851 +#
31852 +
31853 +#
31854 +# Userspace I/O
31855 +#
31856 +# CONFIG_UIO is not set
31857 +
31858 +#
31859 +# File systems
31860 +#
31861 +CONFIG_EXT2_FS=y
31862 +# CONFIG_EXT2_FS_XATTR is not set
31863 +# CONFIG_EXT2_FS_XIP is not set
31864 +CONFIG_EXT3_FS=y
31865 +CONFIG_EXT3_FS_XATTR=y
31866 +# CONFIG_EXT3_FS_POSIX_ACL is not set
31867 +# CONFIG_EXT3_FS_SECURITY is not set
31868 +# CONFIG_EXT4DEV_FS is not set
31869 +CONFIG_JBD=y
31870 +# CONFIG_JBD_DEBUG is not set
31871 +CONFIG_FS_MBCACHE=y
31872 +# CONFIG_REISERFS_FS is not set
31873 +# CONFIG_JFS_FS is not set
31874 +# CONFIG_FS_POSIX_ACL is not set
31875 +# CONFIG_XFS_FS is not set
31876 +# CONFIG_GFS2_FS is not set
31877 +# CONFIG_OCFS2_FS is not set
31878 +# CONFIG_MINIX_FS is not set
31879 +# CONFIG_ROMFS_FS is not set
31880 +CONFIG_INOTIFY=y
31881 +CONFIG_INOTIFY_USER=y
31882 +# CONFIG_QUOTA is not set
31883 +CONFIG_DNOTIFY=y
31884 +# CONFIG_AUTOFS_FS is not set
31885 +# CONFIG_AUTOFS4_FS is not set
31886 +# CONFIG_FUSE_FS is not set
31887 +
31888 +#
31889 +# CD-ROM/DVD Filesystems
31890 +#
31891 +# CONFIG_ISO9660_FS is not set
31892 +# CONFIG_UDF_FS is not set
31893 +
31894 +#
31895 +# DOS/FAT/NT Filesystems
31896 +#
31897 +# CONFIG_MSDOS_FS is not set
31898 +# CONFIG_VFAT_FS is not set
31899 +# CONFIG_NTFS_FS is not set
31900 +
31901 +#
31902 +# Pseudo filesystems
31903 +#
31904 +CONFIG_PROC_FS=y
31905 +CONFIG_PROC_KCORE=y
31906 +CONFIG_PROC_SYSCTL=y
31907 +CONFIG_SYSFS=y
31908 +CONFIG_TMPFS=y
31909 +# CONFIG_TMPFS_POSIX_ACL is not set
31910 +# CONFIG_HUGETLB_PAGE is not set
31911 +CONFIG_RAMFS=y
31912 +# CONFIG_CONFIGFS_FS is not set
31913 +
31914 +#
31915 +# Miscellaneous filesystems
31916 +#
31917 +# CONFIG_ADFS_FS is not set
31918 +# CONFIG_AFFS_FS is not set
31919 +# CONFIG_HFS_FS is not set
31920 +# CONFIG_HFSPLUS_FS is not set
31921 +# CONFIG_BEFS_FS is not set
31922 +# CONFIG_BFS_FS is not set
31923 +# CONFIG_EFS_FS is not set
31924 +# CONFIG_CRAMFS is not set
31925 +# CONFIG_VXFS_FS is not set
31926 +# CONFIG_HPFS_FS is not set
31927 +# CONFIG_QNX4FS_FS is not set
31928 +# CONFIG_SYSV_FS is not set
31929 +# CONFIG_UFS_FS is not set
31930 +
31931 +#
31932 +# Network File Systems
31933 +#
31934 +CONFIG_NFS_FS=y
31935 +CONFIG_NFS_V3=y
31936 +# CONFIG_NFS_V3_ACL is not set
31937 +CONFIG_NFS_V4=y
31938 +# CONFIG_NFS_DIRECTIO is not set
31939 +# CONFIG_NFSD is not set
31940 +CONFIG_ROOT_NFS=y
31941 +CONFIG_LOCKD=y
31942 +CONFIG_LOCKD_V4=y
31943 +CONFIG_NFS_COMMON=y
31944 +CONFIG_SUNRPC=y
31945 +CONFIG_SUNRPC_GSS=y
31946 +# CONFIG_SUNRPC_BIND34 is not set
31947 +CONFIG_RPCSEC_GSS_KRB5=y
31948 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
31949 +# CONFIG_SMB_FS is not set
31950 +# CONFIG_CIFS is not set
31951 +# CONFIG_NCP_FS is not set
31952 +# CONFIG_CODA_FS is not set
31953 +# CONFIG_AFS_FS is not set
31954 +
31955 +#
31956 +# Partition Types
31957 +#
31958 +CONFIG_PARTITION_ADVANCED=y
31959 +# CONFIG_ACORN_PARTITION is not set
31960 +# CONFIG_OSF_PARTITION is not set
31961 +# CONFIG_AMIGA_PARTITION is not set
31962 +# CONFIG_ATARI_PARTITION is not set
31963 +# CONFIG_MAC_PARTITION is not set
31964 +CONFIG_MSDOS_PARTITION=y
31965 +# CONFIG_BSD_DISKLABEL is not set
31966 +# CONFIG_MINIX_SUBPARTITION is not set
31967 +# CONFIG_SOLARIS_X86_PARTITION is not set
31968 +# CONFIG_UNIXWARE_DISKLABEL is not set
31969 +# CONFIG_LDM_PARTITION is not set
31970 +# CONFIG_SGI_PARTITION is not set
31971 +# CONFIG_ULTRIX_PARTITION is not set
31972 +# CONFIG_SUN_PARTITION is not set
31973 +# CONFIG_KARMA_PARTITION is not set
31974 +# CONFIG_EFI_PARTITION is not set
31975 +# CONFIG_SYSV68_PARTITION is not set
31976 +
31977 +#
31978 +# Native Language Support
31979 +#
31980 +# CONFIG_NLS is not set
31981 +
31982 +#
31983 +# Distributed Lock Manager
31984 +#
31985 +# CONFIG_DLM is not set
31986 +# CONFIG_UCC_SLOW is not set
31987 +
31988 +#
31989 +# Library routines
31990 +#
31991 +CONFIG_BITREVERSE=y
31992 +# CONFIG_CRC_CCITT is not set
31993 +# CONFIG_CRC16 is not set
31994 +# CONFIG_CRC_ITU_T is not set
31995 +CONFIG_CRC32=y
31996 +# CONFIG_CRC7 is not set
31997 +# CONFIG_LIBCRC32C is not set
31998 +CONFIG_PLIST=y
31999 +CONFIG_HAS_IOMEM=y
32000 +CONFIG_HAS_IOPORT=y
32001 +CONFIG_HAS_DMA=y
32002 +
32003 +#
32004 +# Instrumentation Support
32005 +#
32006 +# CONFIG_PROFILING is not set
32007 +# CONFIG_KPROBES is not set
32008 +
32009 +#
32010 +# Kernel hacking
32011 +#
32012 +# CONFIG_PRINTK_TIME is not set
32013 +CONFIG_ENABLE_MUST_CHECK=y
32014 +# CONFIG_MAGIC_SYSRQ is not set
32015 +# CONFIG_UNUSED_SYMBOLS is not set
32016 +# CONFIG_DEBUG_FS is not set
32017 +# CONFIG_HEADERS_CHECK is not set
32018 +# CONFIG_DEBUG_KERNEL is not set
32019 +# CONFIG_DEBUG_BUGVERBOSE is not set
32020 +# CONFIG_PPC_EARLY_DEBUG is not set
32021 +
32022 +#
32023 +# Security options
32024 +#
32025 +# CONFIG_KEYS is not set
32026 +# CONFIG_SECURITY is not set
32027 +CONFIG_CRYPTO=y
32028 +CONFIG_CRYPTO_ALGAPI=y
32029 +CONFIG_CRYPTO_BLKCIPHER=y
32030 +CONFIG_CRYPTO_MANAGER=y
32031 +# CONFIG_CRYPTO_HMAC is not set
32032 +# CONFIG_CRYPTO_XCBC is not set
32033 +# CONFIG_CRYPTO_NULL is not set
32034 +# CONFIG_CRYPTO_MD4 is not set
32035 +CONFIG_CRYPTO_MD5=y
32036 +# CONFIG_CRYPTO_SHA1 is not set
32037 +# CONFIG_CRYPTO_SHA256 is not set
32038 +# CONFIG_CRYPTO_SHA512 is not set
32039 +# CONFIG_CRYPTO_WP512 is not set
32040 +# CONFIG_CRYPTO_TGR192 is not set
32041 +# CONFIG_CRYPTO_GF128MUL is not set
32042 +CONFIG_CRYPTO_ECB=m
32043 +CONFIG_CRYPTO_CBC=y
32044 +CONFIG_CRYPTO_PCBC=m
32045 +# CONFIG_CRYPTO_LRW is not set
32046 +# CONFIG_CRYPTO_CRYPTD is not set
32047 +CONFIG_CRYPTO_DES=y
32048 +# CONFIG_CRYPTO_FCRYPT is not set
32049 +# CONFIG_CRYPTO_BLOWFISH is not set
32050 +# CONFIG_CRYPTO_TWOFISH is not set
32051 +# CONFIG_CRYPTO_SERPENT is not set
32052 +# CONFIG_CRYPTO_AES is not set
32053 +# CONFIG_CRYPTO_CAST5 is not set
32054 +# CONFIG_CRYPTO_CAST6 is not set
32055 +# CONFIG_CRYPTO_TEA is not set
32056 +# CONFIG_CRYPTO_ARC4 is not set
32057 +# CONFIG_CRYPTO_KHAZAD is not set
32058 +# CONFIG_CRYPTO_ANUBIS is not set
32059 +# CONFIG_CRYPTO_DEFLATE is not set
32060 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
32061 +# CONFIG_CRYPTO_CRC32C is not set
32062 +# CONFIG_CRYPTO_CAMELLIA is not set
32063 +# CONFIG_CRYPTO_TEST is not set
32064 +CONFIG_CRYPTO_HW=y
32065 Index: linux-2.6.24.7/arch/powerpc/configs/mpc8610_hpcd_defconfig
32066 ===================================================================
32067 --- linux-2.6.24.7.orig/arch/powerpc/configs/mpc8610_hpcd_defconfig
32068 +++ linux-2.6.24.7/arch/powerpc/configs/mpc8610_hpcd_defconfig
32069 @@ -696,7 +696,7 @@ CONFIG_SERIAL_8250_RSA=y
32070  CONFIG_SERIAL_CORE=y
32071  CONFIG_SERIAL_CORE_CONSOLE=y
32072  # CONFIG_SERIAL_JSM is not set
32073 -CONFIG_SERIAL_OF_PLATFORM=y
32074 +# CONFIG_SERIAL_OF_PLATFORM is not set
32075  CONFIG_UNIX98_PTYS=y
32076  # CONFIG_LEGACY_PTYS is not set
32077  # CONFIG_IPMI_HANDLER is not set
32078 @@ -708,7 +708,60 @@ CONFIG_UNIX98_PTYS=y
32079  # CONFIG_RAW_DRIVER is not set
32080  # CONFIG_TCG_TPM is not set
32081  CONFIG_DEVPORT=y
32082 -# CONFIG_I2C is not set
32083 +CONFIG_I2C=y
32084 +CONFIG_I2C_BOARDINFO=y
32085 +# CONFIG_I2C_CHARDEV is not set
32086 +
32087 +#
32088 +# I2C Algorithms
32089 +#
32090 +# CONFIG_I2C_ALGOBIT is not set
32091 +# CONFIG_I2C_ALGOPCF is not set
32092 +# CONFIG_I2C_ALGOPCA is not set
32093 +
32094 +#
32095 +# I2C Hardware Bus support
32096 +#
32097 +# CONFIG_I2C_ALI1535 is not set
32098 +# CONFIG_I2C_ALI1563 is not set
32099 +# CONFIG_I2C_ALI15X3 is not set
32100 +# CONFIG_I2C_AMD756 is not set
32101 +# CONFIG_I2C_AMD8111 is not set
32102 +# CONFIG_I2C_I801 is not set
32103 +# CONFIG_I2C_I810 is not set
32104 +# CONFIG_I2C_PIIX4 is not set
32105 +CONFIG_I2C_MPC=y
32106 +# CONFIG_I2C_NFORCE2 is not set
32107 +# CONFIG_I2C_OCORES is not set
32108 +# CONFIG_I2C_PARPORT_LIGHT is not set
32109 +# CONFIG_I2C_PROSAVAGE is not set
32110 +# CONFIG_I2C_SAVAGE4 is not set
32111 +# CONFIG_I2C_SIMTEC is not set
32112 +# CONFIG_I2C_SIS5595 is not set
32113 +# CONFIG_I2C_SIS630 is not set
32114 +# CONFIG_I2C_SIS96X is not set
32115 +# CONFIG_I2C_TAOS_EVM is not set
32116 +# CONFIG_I2C_VIA is not set
32117 +# CONFIG_I2C_VIAPRO is not set
32118 +# CONFIG_I2C_VOODOO3 is not set
32119 +
32120 +#
32121 +# Miscellaneous I2C Chip support
32122 +#
32123 +# CONFIG_SENSORS_DS1337 is not set
32124 +# CONFIG_SENSORS_DS1374 is not set
32125 +# CONFIG_DS1682 is not set
32126 +# CONFIG_SENSORS_EEPROM is not set
32127 +# CONFIG_SENSORS_PCF8574 is not set
32128 +# CONFIG_SENSORS_PCA9539 is not set
32129 +# CONFIG_SENSORS_PCF8591 is not set
32130 +# CONFIG_SENSORS_M41T00 is not set
32131 +# CONFIG_SENSORS_MAX6875 is not set
32132 +# CONFIG_SENSORS_TSL2550 is not set
32133 +# CONFIG_I2C_DEBUG_CORE is not set
32134 +# CONFIG_I2C_DEBUG_ALGO is not set
32135 +# CONFIG_I2C_DEBUG_BUS is not set
32136 +# CONFIG_I2C_DEBUG_CHIP is not set
32137  
32138  #
32139  # SPI support
32140 @@ -763,7 +816,119 @@ CONFIG_DUMMY_CONSOLE=y
32141  #
32142  # Sound
32143  #
32144 -# CONFIG_SOUND is not set
32145 +CONFIG_SOUND=y
32146 +
32147 +#
32148 +# Advanced Linux Sound Architecture
32149 +#
32150 +CONFIG_SND=y
32151 +CONFIG_SND_TIMER=y
32152 +CONFIG_SND_PCM=y
32153 +# CONFIG_SND_SEQUENCER is not set
32154 +CONFIG_SND_OSSEMUL=y
32155 +CONFIG_SND_MIXER_OSS=y
32156 +CONFIG_SND_PCM_OSS=y
32157 +# CONFIG_SND_PCM_OSS_PLUGINS is not set
32158 +# CONFIG_SND_DYNAMIC_MINORS is not set
32159 +# CONFIG_SND_SUPPORT_OLD_API is not set
32160 +CONFIG_SND_VERBOSE_PROCFS=y
32161 +# CONFIG_SND_VERBOSE_PRINTK is not set
32162 +# CONFIG_SND_DEBUG is not set
32163 +
32164 +#
32165 +# Generic devices
32166 +#
32167 +# CONFIG_SND_DUMMY is not set
32168 +# CONFIG_SND_MTPAV is not set
32169 +# CONFIG_SND_SERIAL_U16550 is not set
32170 +# CONFIG_SND_MPU401 is not set
32171 +
32172 +#
32173 +# PCI devices
32174 +#
32175 +# CONFIG_SND_AD1889 is not set
32176 +# CONFIG_SND_ALS300 is not set
32177 +# CONFIG_SND_ALS4000 is not set
32178 +# CONFIG_SND_ALI5451 is not set
32179 +# CONFIG_SND_ATIIXP is not set
32180 +# CONFIG_SND_ATIIXP_MODEM is not set
32181 +# CONFIG_SND_AU8810 is not set
32182 +# CONFIG_SND_AU8820 is not set
32183 +# CONFIG_SND_AU8830 is not set
32184 +# CONFIG_SND_AZT3328 is not set
32185 +# CONFIG_SND_BT87X is not set
32186 +# CONFIG_SND_CA0106 is not set
32187 +# CONFIG_SND_CMIPCI is not set
32188 +# CONFIG_SND_CS4281 is not set
32189 +# CONFIG_SND_CS46XX is not set
32190 +# CONFIG_SND_CS5530 is not set
32191 +# CONFIG_SND_DARLA20 is not set
32192 +# CONFIG_SND_GINA20 is not set
32193 +# CONFIG_SND_LAYLA20 is not set
32194 +# CONFIG_SND_DARLA24 is not set
32195 +# CONFIG_SND_GINA24 is not set
32196 +# CONFIG_SND_LAYLA24 is not set
32197 +# CONFIG_SND_MONA is not set
32198 +# CONFIG_SND_MIA is not set
32199 +# CONFIG_SND_ECHO3G is not set
32200 +# CONFIG_SND_INDIGO is not set
32201 +# CONFIG_SND_INDIGOIO is not set
32202 +# CONFIG_SND_INDIGODJ is not set
32203 +# CONFIG_SND_EMU10K1 is not set
32204 +# CONFIG_SND_EMU10K1X is not set
32205 +# CONFIG_SND_ENS1370 is not set
32206 +# CONFIG_SND_ENS1371 is not set
32207 +# CONFIG_SND_ES1938 is not set
32208 +# CONFIG_SND_ES1968 is not set
32209 +# CONFIG_SND_FM801 is not set
32210 +# CONFIG_SND_HDA_INTEL is not set
32211 +# CONFIG_SND_HDSP is not set
32212 +# CONFIG_SND_HDSPM is not set
32213 +# CONFIG_SND_ICE1712 is not set
32214 +# CONFIG_SND_ICE1724 is not set
32215 +# CONFIG_SND_INTEL8X0 is not set
32216 +# CONFIG_SND_INTEL8X0M is not set
32217 +# CONFIG_SND_KORG1212 is not set
32218 +# CONFIG_SND_MAESTRO3 is not set
32219 +# CONFIG_SND_MIXART is not set
32220 +# CONFIG_SND_NM256 is not set
32221 +# CONFIG_SND_PCXHR is not set
32222 +# CONFIG_SND_RIPTIDE is not set
32223 +# CONFIG_SND_RME32 is not set
32224 +# CONFIG_SND_RME96 is not set
32225 +# CONFIG_SND_RME9652 is not set
32226 +# CONFIG_SND_SONICVIBES is not set
32227 +# CONFIG_SND_TRIDENT is not set
32228 +# CONFIG_SND_VIA82XX is not set
32229 +# CONFIG_SND_VIA82XX_MODEM is not set
32230 +# CONFIG_SND_VX222 is not set
32231 +# CONFIG_SND_YMFPCI is not set
32232 +
32233 +#
32234 +# ALSA PowerMac devices
32235 +#
32236 +
32237 +#
32238 +# ALSA PowerPC devices
32239 +#
32240 +
32241 +#
32242 +# System on Chip audio support
32243 +#
32244 +CONFIG_SND_SOC=y
32245 +
32246 +#
32247 +# SoC Audio support for SuperH
32248 +#
32249 +
32250 +#
32251 +# ALSA SoC audio for Freescale SOCs
32252 +#
32253 +CONFIG_SND_SOC_MPC8610=y
32254 +CONFIG_SND_SOC_MPC8610_HPCD=y
32255 +CONFIG_SND_SOC_CS4270=y
32256 +CONFIG_SND_SOC_CS4270_VD33_ERRATA=y
32257 +
32258  CONFIG_HID_SUPPORT=y
32259  CONFIG_HID=y
32260  # CONFIG_HID_DEBUG is not set
32261 Index: linux-2.6.24.7/arch/powerpc/configs/pasemi_defconfig
32262 ===================================================================
32263 --- linux-2.6.24.7.orig/arch/powerpc/configs/pasemi_defconfig
32264 +++ linux-2.6.24.7/arch/powerpc/configs/pasemi_defconfig
32265 @@ -1,7 +1,7 @@
32266  #
32267  # Automatically generated make config: don't edit
32268 -# Linux kernel version: 2.6.24-rc4
32269 -# Thu Dec  6 16:49:03 2007
32270 +# Linux kernel version: 2.6.24-rc6
32271 +# Tue Jan 15 10:26:10 2008
32272  #
32273  CONFIG_PPC64=y
32274  
32275 @@ -152,7 +152,6 @@ CONFIG_PPC_PASEMI=y
32276  CONFIG_PPC_PASEMI_IOMMU=y
32277  # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
32278  CONFIG_PPC_PASEMI_MDIO=y
32279 -CONFIG_ELECTRA_IDE=y
32280  # CONFIG_PPC_CELLEB is not set
32281  # CONFIG_PPC_PS3 is not set
32282  # CONFIG_PPC_CELL is not set
32283 @@ -256,7 +255,7 @@ CONFIG_PCI_DOMAINS=y
32284  CONFIG_PCI_SYSCALL=y
32285  # CONFIG_PCIEPORTBUS is not set
32286  CONFIG_ARCH_SUPPORTS_MSI=y
32287 -# CONFIG_PCI_MSI is not set
32288 +CONFIG_PCI_MSI=y
32289  CONFIG_PCI_LEGACY=y
32290  # CONFIG_PCI_DEBUG is not set
32291  CONFIG_PCCARD=y
32292 @@ -663,7 +662,26 @@ CONFIG_PATA_PCMCIA=y
32293  # CONFIG_PATA_VIA is not set
32294  # CONFIG_PATA_WINBOND is not set
32295  CONFIG_PATA_PLATFORM=y
32296 -# CONFIG_MD is not set
32297 +CONFIG_PATA_OF_PLATFORM=y
32298 +CONFIG_MD=y
32299 +CONFIG_BLK_DEV_MD=y
32300 +CONFIG_MD_LINEAR=y
32301 +CONFIG_MD_RAID0=y
32302 +CONFIG_MD_RAID1=y
32303 +CONFIG_MD_RAID10=y
32304 +CONFIG_MD_RAID456=y
32305 +CONFIG_MD_RAID5_RESHAPE=y
32306 +# CONFIG_MD_MULTIPATH is not set
32307 +# CONFIG_MD_FAULTY is not set
32308 +CONFIG_BLK_DEV_DM=y
32309 +# CONFIG_DM_DEBUG is not set
32310 +CONFIG_DM_CRYPT=y
32311 +# CONFIG_DM_SNAPSHOT is not set
32312 +# CONFIG_DM_MIRROR is not set
32313 +# CONFIG_DM_ZERO is not set
32314 +# CONFIG_DM_MULTIPATH is not set
32315 +# CONFIG_DM_DELAY is not set
32316 +# CONFIG_DM_UEVENT is not set
32317  # CONFIG_FUSION is not set
32318  
32319  #
32320 @@ -1686,6 +1704,10 @@ CONFIG_XMON_DISASSEMBLY=y
32321  # CONFIG_KEYS is not set
32322  # CONFIG_SECURITY is not set
32323  # CONFIG_SECURITY_FILE_CAPABILITIES is not set
32324 +CONFIG_XOR_BLOCKS=y
32325 +CONFIG_ASYNC_CORE=y
32326 +CONFIG_ASYNC_MEMCPY=y
32327 +CONFIG_ASYNC_XOR=y
32328  CONFIG_CRYPTO=y
32329  CONFIG_CRYPTO_ALGAPI=y
32330  CONFIG_CRYPTO_BLKCIPHER=y
32331 Index: linux-2.6.24.7/arch/powerpc/configs/ppc64_defconfig
32332 ===================================================================
32333 --- linux-2.6.24.7.orig/arch/powerpc/configs/ppc64_defconfig
32334 +++ linux-2.6.24.7/arch/powerpc/configs/ppc64_defconfig
32335 @@ -1,7 +1,7 @@
32336  #
32337  # Automatically generated make config: don't edit
32338  # Linux kernel version: 2.6.24-rc4
32339 -# Thu Dec  6 16:49:07 2007
32340 +# Fri Dec 21 14:47:29 2007
32341  #
32342  CONFIG_PPC64=y
32343  
32344 @@ -211,7 +211,7 @@ CONFIG_MMIO_NVRAM=y
32345  CONFIG_MPIC_U3_HT_IRQS=y
32346  CONFIG_MPIC_BROKEN_REGREAD=y
32347  CONFIG_IBMVIO=y
32348 -# CONFIG_IBMEBUS is not set
32349 +CONFIG_IBMEBUS=y
32350  # CONFIG_PPC_MPC106 is not set
32351  CONFIG_PPC_970_NAP=y
32352  CONFIG_PPC_INDIRECT_IO=y
32353 @@ -375,7 +375,7 @@ CONFIG_INET_TUNNEL=y
32354  CONFIG_INET_XFRM_MODE_TRANSPORT=y
32355  CONFIG_INET_XFRM_MODE_TUNNEL=y
32356  CONFIG_INET_XFRM_MODE_BEET=y
32357 -# CONFIG_INET_LRO is not set
32358 +CONFIG_INET_LRO=m
32359  CONFIG_INET_DIAG=y
32360  CONFIG_INET_TCP_DIAG=y
32361  # CONFIG_TCP_CONG_ADVANCED is not set
32362 @@ -929,6 +929,7 @@ CONFIG_SPIDER_NET=m
32363  CONFIG_NETDEV_10000=y
32364  # CONFIG_CHELSIO_T1 is not set
32365  # CONFIG_CHELSIO_T3 is not set
32366 +CONFIG_EHEA=m
32367  # CONFIG_IXGBE is not set
32368  CONFIG_IXGB=m
32369  # CONFIG_IXGB_NAPI is not set
32370 @@ -1558,6 +1559,7 @@ CONFIG_INFINIBAND_ADDR_TRANS=y
32371  CONFIG_INFINIBAND_MTHCA=m
32372  CONFIG_INFINIBAND_MTHCA_DEBUG=y
32373  # CONFIG_INFINIBAND_IPATH is not set
32374 +CONFIG_INFINIBAND_EHCA=m
32375  # CONFIG_INFINIBAND_AMSO1100 is not set
32376  # CONFIG_MLX4_INFINIBAND is not set
32377  CONFIG_INFINIBAND_IPOIB=m
32378 Index: linux-2.6.24.7/arch/powerpc/configs/ps3_defconfig
32379 ===================================================================
32380 --- linux-2.6.24.7.orig/arch/powerpc/configs/ps3_defconfig
32381 +++ linux-2.6.24.7/arch/powerpc/configs/ps3_defconfig
32382 @@ -1,7 +1,7 @@
32383  #
32384  # Automatically generated make config: don't edit
32385 -# Linux kernel version: 2.6.24-rc4
32386 -# Tue Dec  4 22:49:57 2007
32387 +# Linux kernel version: 2.6.24-rc8
32388 +# Wed Jan 16 14:31:21 2008
32389  #
32390  CONFIG_PPC64=y
32391  
32392 @@ -103,6 +103,7 @@ CONFIG_VM_EVENT_COUNTERS=y
32393  CONFIG_SLAB=y
32394  # CONFIG_SLUB is not set
32395  # CONFIG_SLOB is not set
32396 +CONFIG_SLABINFO=y
32397  CONFIG_RT_MUTEXES=y
32398  # CONFIG_TINY_SHMEM is not set
32399  CONFIG_BASE_SMALL=0
32400 @@ -154,7 +155,6 @@ CONFIG_PPC_PS3=y
32401  # CONFIG_PS3_ADVANCED is not set
32402  CONFIG_PS3_HTAB_SIZE=20
32403  # CONFIG_PS3_DYNAMIC_DMA is not set
32404 -CONFIG_PS3_USE_LPAR_ADDR=y
32405  CONFIG_PS3_VUART=y
32406  CONFIG_PS3_PS3AV=y
32407  CONFIG_PS3_SYS_MANAGER=y
32408 @@ -162,6 +162,7 @@ CONFIG_PS3_STORAGE=y
32409  CONFIG_PS3_DISK=y
32410  CONFIG_PS3_ROM=y
32411  CONFIG_PS3_FLASH=y
32412 +CONFIG_PS3_LPM=m
32413  CONFIG_PPC_CELL=y
32414  # CONFIG_PPC_CELL_NATIVE is not set
32415  # CONFIG_PPC_IBM_CELL_BLADE is not set
32416 @@ -225,7 +226,7 @@ CONFIG_HAVE_MEMORY_PRESENT=y
32417  # CONFIG_SPARSEMEM_STATIC is not set
32418  CONFIG_SPARSEMEM_EXTREME=y
32419  CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
32420 -CONFIG_SPARSEMEM_VMEMMAP=y
32421 +# CONFIG_SPARSEMEM_VMEMMAP is not set
32422  CONFIG_MEMORY_HOTPLUG=y
32423  CONFIG_MEMORY_HOTPLUG_SPARSE=y
32424  CONFIG_SPLIT_PTLOCK_CPUS=4
32425 @@ -338,7 +339,26 @@ CONFIG_IPV6_SIT=y
32426  # CONFIG_NET_PKTGEN is not set
32427  # CONFIG_HAMRADIO is not set
32428  # CONFIG_IRDA is not set
32429 -# CONFIG_BT is not set
32430 +CONFIG_BT=m
32431 +CONFIG_BT_L2CAP=m
32432 +CONFIG_BT_SCO=m
32433 +CONFIG_BT_RFCOMM=m
32434 +CONFIG_BT_RFCOMM_TTY=y
32435 +CONFIG_BT_BNEP=m
32436 +CONFIG_BT_BNEP_MC_FILTER=y
32437 +CONFIG_BT_BNEP_PROTO_FILTER=y
32438 +CONFIG_BT_HIDP=m
32439 +
32440 +#
32441 +# Bluetooth device drivers
32442 +#
32443 +CONFIG_BT_HCIUSB=m
32444 +CONFIG_BT_HCIUSB_SCO=y
32445 +# CONFIG_BT_HCIUART is not set
32446 +# CONFIG_BT_HCIBCM203X is not set
32447 +# CONFIG_BT_HCIBPA10X is not set
32448 +# CONFIG_BT_HCIBFUSB is not set
32449 +# CONFIG_BT_HCIVHCI is not set
32450  # CONFIG_AF_RXRPC is not set
32451  
32452  #
32453 @@ -666,14 +686,14 @@ CONFIG_LOGO_LINUX_CLUT224=y
32454  #
32455  # Sound
32456  #
32457 -CONFIG_SOUND=y
32458 +CONFIG_SOUND=m
32459  
32460  #
32461  # Advanced Linux Sound Architecture
32462  #
32463 -CONFIG_SND=y
32464 -CONFIG_SND_TIMER=y
32465 -CONFIG_SND_PCM=y
32466 +CONFIG_SND=m
32467 +CONFIG_SND_TIMER=m
32468 +CONFIG_SND_PCM=m
32469  # CONFIG_SND_SEQUENCER is not set
32470  # CONFIG_SND_MIXER_OSS is not set
32471  # CONFIG_SND_PCM_OSS is not set
32472 @@ -702,7 +722,7 @@ CONFIG_SND_VERBOSE_PROCFS=y
32473  #
32474  # ALSA PowerPC devices
32475  #
32476 -CONFIG_SND_PS3=y
32477 +CONFIG_SND_PS3=m
32478  CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
32479  
32480  #
32481 @@ -747,7 +767,7 @@ CONFIG_USB_SUPPORT=y
32482  CONFIG_USB_ARCH_HAS_HCD=y
32483  CONFIG_USB_ARCH_HAS_OHCI=y
32484  CONFIG_USB_ARCH_HAS_EHCI=y
32485 -CONFIG_USB=y
32486 +CONFIG_USB=m
32487  # CONFIG_USB_DEBUG is not set
32488  
32489  #
32490 @@ -761,13 +781,13 @@ CONFIG_USB_DEVICEFS=y
32491  #
32492  # USB Host Controller Drivers
32493  #
32494 -CONFIG_USB_EHCI_HCD=y
32495 +CONFIG_USB_EHCI_HCD=m
32496  # CONFIG_USB_EHCI_SPLIT_ISO is not set
32497  # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
32498  # CONFIG_USB_EHCI_TT_NEWSCHED is not set
32499  CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
32500  # CONFIG_USB_ISP116X_HCD is not set
32501 -CONFIG_USB_OHCI_HCD=y
32502 +CONFIG_USB_OHCI_HCD=m
32503  # CONFIG_USB_OHCI_HCD_PPC_OF is not set
32504  # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
32505  CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
32506 @@ -1033,7 +1053,8 @@ CONFIG_HAS_IOMEM=y
32507  CONFIG_HAS_IOPORT=y
32508  CONFIG_HAS_DMA=y
32509  CONFIG_INSTRUMENTATION=y
32510 -# CONFIG_PROFILING is not set
32511 +CONFIG_PROFILING=y
32512 +CONFIG_OPROFILE=m
32513  # CONFIG_KPROBES is not set
32514  # CONFIG_MARKERS is not set
32515  
32516 Index: linux-2.6.24.7/arch/powerpc/configs/rainier_defconfig
32517 ===================================================================
32518 --- /dev/null
32519 +++ linux-2.6.24.7/arch/powerpc/configs/rainier_defconfig
32520 @@ -0,0 +1,873 @@
32521 +#
32522 +# Automatically generated make config: don't edit
32523 +# Linux kernel version: 2.6.24-rc6
32524 +# Mon Dec 24 11:22:40 2007
32525 +#
32526 +# CONFIG_PPC64 is not set
32527 +
32528 +#
32529 +# Processor support
32530 +#
32531 +# CONFIG_6xx is not set
32532 +# CONFIG_PPC_85xx is not set
32533 +# CONFIG_PPC_8xx is not set
32534 +# CONFIG_40x is not set
32535 +CONFIG_44x=y
32536 +# CONFIG_E200 is not set
32537 +CONFIG_4xx=y
32538 +CONFIG_BOOKE=y
32539 +CONFIG_PTE_64BIT=y
32540 +CONFIG_PHYS_64BIT=y
32541 +# CONFIG_PPC_MM_SLICES is not set
32542 +CONFIG_NOT_COHERENT_CACHE=y
32543 +CONFIG_PPC32=y
32544 +CONFIG_WORD_SIZE=32
32545 +CONFIG_PPC_MERGE=y
32546 +CONFIG_MMU=y
32547 +CONFIG_GENERIC_CMOS_UPDATE=y
32548 +CONFIG_GENERIC_TIME=y
32549 +CONFIG_GENERIC_TIME_VSYSCALL=y
32550 +CONFIG_GENERIC_CLOCKEVENTS=y
32551 +CONFIG_GENERIC_HARDIRQS=y
32552 +CONFIG_IRQ_PER_CPU=y
32553 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
32554 +CONFIG_ARCH_HAS_ILOG2_U32=y
32555 +CONFIG_GENERIC_HWEIGHT=y
32556 +CONFIG_GENERIC_CALIBRATE_DELAY=y
32557 +CONFIG_GENERIC_FIND_NEXT_BIT=y
32558 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
32559 +CONFIG_PPC=y
32560 +CONFIG_EARLY_PRINTK=y
32561 +CONFIG_GENERIC_NVRAM=y
32562 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
32563 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
32564 +CONFIG_PPC_OF=y
32565 +CONFIG_OF=y
32566 +CONFIG_PPC_UDBG_16550=y
32567 +# CONFIG_GENERIC_TBSYNC is not set
32568 +CONFIG_AUDIT_ARCH=y
32569 +CONFIG_GENERIC_BUG=y
32570 +# CONFIG_DEFAULT_UIMAGE is not set
32571 +CONFIG_PPC_DCR_NATIVE=y
32572 +# CONFIG_PPC_DCR_MMIO is not set
32573 +CONFIG_PPC_DCR=y
32574 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
32575 +
32576 +#
32577 +# General setup
32578 +#
32579 +CONFIG_EXPERIMENTAL=y
32580 +CONFIG_BROKEN_ON_SMP=y
32581 +CONFIG_INIT_ENV_ARG_LIMIT=32
32582 +CONFIG_LOCALVERSION=""
32583 +CONFIG_LOCALVERSION_AUTO=y
32584 +CONFIG_SWAP=y
32585 +CONFIG_SYSVIPC=y
32586 +CONFIG_SYSVIPC_SYSCTL=y
32587 +CONFIG_POSIX_MQUEUE=y
32588 +# CONFIG_BSD_PROCESS_ACCT is not set
32589 +# CONFIG_TASKSTATS is not set
32590 +# CONFIG_USER_NS is not set
32591 +# CONFIG_PID_NS is not set
32592 +# CONFIG_AUDIT is not set
32593 +# CONFIG_IKCONFIG is not set
32594 +CONFIG_LOG_BUF_SHIFT=14
32595 +# CONFIG_CGROUPS is not set
32596 +CONFIG_FAIR_GROUP_SCHED=y
32597 +CONFIG_FAIR_USER_SCHED=y
32598 +# CONFIG_FAIR_CGROUP_SCHED is not set
32599 +CONFIG_SYSFS_DEPRECATED=y
32600 +# CONFIG_RELAY is not set
32601 +CONFIG_BLK_DEV_INITRD=y
32602 +CONFIG_INITRAMFS_SOURCE=""
32603 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
32604 +CONFIG_SYSCTL=y
32605 +CONFIG_EMBEDDED=y
32606 +CONFIG_SYSCTL_SYSCALL=y
32607 +CONFIG_KALLSYMS=y
32608 +# CONFIG_KALLSYMS_ALL is not set
32609 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
32610 +CONFIG_HOTPLUG=y
32611 +CONFIG_PRINTK=y
32612 +CONFIG_BUG=y
32613 +CONFIG_ELF_CORE=y
32614 +CONFIG_BASE_FULL=y
32615 +CONFIG_FUTEX=y
32616 +CONFIG_ANON_INODES=y
32617 +CONFIG_EPOLL=y
32618 +CONFIG_SIGNALFD=y
32619 +CONFIG_EVENTFD=y
32620 +CONFIG_SHMEM=y
32621 +CONFIG_VM_EVENT_COUNTERS=y
32622 +CONFIG_SLUB_DEBUG=y
32623 +# CONFIG_SLAB is not set
32624 +CONFIG_SLUB=y
32625 +# CONFIG_SLOB is not set
32626 +CONFIG_RT_MUTEXES=y
32627 +# CONFIG_TINY_SHMEM is not set
32628 +CONFIG_BASE_SMALL=0
32629 +CONFIG_MODULES=y
32630 +CONFIG_MODULE_UNLOAD=y
32631 +# CONFIG_MODULE_FORCE_UNLOAD is not set
32632 +# CONFIG_MODVERSIONS is not set
32633 +# CONFIG_MODULE_SRCVERSION_ALL is not set
32634 +CONFIG_KMOD=y
32635 +CONFIG_BLOCK=y
32636 +CONFIG_LBD=y
32637 +# CONFIG_BLK_DEV_IO_TRACE is not set
32638 +# CONFIG_LSF is not set
32639 +# CONFIG_BLK_DEV_BSG is not set
32640 +
32641 +#
32642 +# IO Schedulers
32643 +#
32644 +CONFIG_IOSCHED_NOOP=y
32645 +CONFIG_IOSCHED_AS=y
32646 +CONFIG_IOSCHED_DEADLINE=y
32647 +CONFIG_IOSCHED_CFQ=y
32648 +CONFIG_DEFAULT_AS=y
32649 +# CONFIG_DEFAULT_DEADLINE is not set
32650 +# CONFIG_DEFAULT_CFQ is not set
32651 +# CONFIG_DEFAULT_NOOP is not set
32652 +CONFIG_DEFAULT_IOSCHED="anticipatory"
32653 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
32654 +
32655 +#
32656 +# Platform support
32657 +#
32658 +# CONFIG_PPC_MPC52xx is not set
32659 +# CONFIG_PPC_MPC5200 is not set
32660 +# CONFIG_PPC_CELL is not set
32661 +# CONFIG_PPC_CELL_NATIVE is not set
32662 +# CONFIG_PQ2ADS is not set
32663 +# CONFIG_BAMBOO is not set
32664 +# CONFIG_EBONY is not set
32665 +# CONFIG_SEQUOIA is not set
32666 +# CONFIG_TAISHAN is not set
32667 +# CONFIG_KATMAI is not set
32668 +CONFIG_RAINIER=y
32669 +CONFIG_440GRX=y
32670 +# CONFIG_MPIC is not set
32671 +# CONFIG_MPIC_WEIRD is not set
32672 +# CONFIG_PPC_I8259 is not set
32673 +# CONFIG_PPC_RTAS is not set
32674 +# CONFIG_MMIO_NVRAM is not set
32675 +# CONFIG_PPC_MPC106 is not set
32676 +# CONFIG_PPC_970_NAP is not set
32677 +# CONFIG_PPC_INDIRECT_IO is not set
32678 +# CONFIG_GENERIC_IOMAP is not set
32679 +# CONFIG_CPU_FREQ is not set
32680 +# CONFIG_CPM2 is not set
32681 +# CONFIG_FSL_ULI1575 is not set
32682 +
32683 +#
32684 +# Kernel options
32685 +#
32686 +# CONFIG_HIGHMEM is not set
32687 +# CONFIG_TICK_ONESHOT is not set
32688 +# CONFIG_NO_HZ is not set
32689 +# CONFIG_HIGH_RES_TIMERS is not set
32690 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
32691 +# CONFIG_HZ_100 is not set
32692 +CONFIG_HZ_250=y
32693 +# CONFIG_HZ_300 is not set
32694 +# CONFIG_HZ_1000 is not set
32695 +CONFIG_HZ=250
32696 +CONFIG_PREEMPT_NONE=y
32697 +# CONFIG_PREEMPT_VOLUNTARY is not set
32698 +# CONFIG_PREEMPT is not set
32699 +CONFIG_BINFMT_ELF=y
32700 +# CONFIG_BINFMT_MISC is not set
32701 +CONFIG_MATH_EMULATION=y
32702 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
32703 +CONFIG_ARCH_FLATMEM_ENABLE=y
32704 +CONFIG_ARCH_POPULATES_NODE_MAP=y
32705 +CONFIG_SELECT_MEMORY_MODEL=y
32706 +CONFIG_FLATMEM_MANUAL=y
32707 +# CONFIG_DISCONTIGMEM_MANUAL is not set
32708 +# CONFIG_SPARSEMEM_MANUAL is not set
32709 +CONFIG_FLATMEM=y
32710 +CONFIG_FLAT_NODE_MEM_MAP=y
32711 +# CONFIG_SPARSEMEM_STATIC is not set
32712 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
32713 +CONFIG_SPLIT_PTLOCK_CPUS=4
32714 +CONFIG_RESOURCES_64BIT=y
32715 +CONFIG_ZONE_DMA_FLAG=1
32716 +CONFIG_BOUNCE=y
32717 +CONFIG_VIRT_TO_BUS=y
32718 +CONFIG_PROC_DEVICETREE=y
32719 +CONFIG_CMDLINE_BOOL=y
32720 +CONFIG_CMDLINE=""
32721 +CONFIG_SECCOMP=y
32722 +CONFIG_WANT_DEVICE_TREE=y
32723 +CONFIG_DEVICE_TREE="rainier.dts"
32724 +CONFIG_ISA_DMA_API=y
32725 +
32726 +#
32727 +# Bus options
32728 +#
32729 +CONFIG_ZONE_DMA=y
32730 +CONFIG_PPC_INDIRECT_PCI=y
32731 +CONFIG_PCI=y
32732 +CONFIG_PCI_DOMAINS=y
32733 +CONFIG_PCI_SYSCALL=y
32734 +# CONFIG_PCIEPORTBUS is not set
32735 +CONFIG_ARCH_SUPPORTS_MSI=y
32736 +# CONFIG_PCI_MSI is not set
32737 +CONFIG_PCI_LEGACY=y
32738 +# CONFIG_PCI_DEBUG is not set
32739 +# CONFIG_PCCARD is not set
32740 +# CONFIG_HOTPLUG_PCI is not set
32741 +
32742 +#
32743 +# Advanced setup
32744 +#
32745 +# CONFIG_ADVANCED_OPTIONS is not set
32746 +
32747 +#
32748 +# Default settings for advanced configuration options are used
32749 +#
32750 +CONFIG_HIGHMEM_START=0xfe000000
32751 +CONFIG_LOWMEM_SIZE=0x30000000
32752 +CONFIG_KERNEL_START=0xc0000000
32753 +CONFIG_TASK_SIZE=0xc0000000
32754 +CONFIG_CONSISTENT_START=0xff100000
32755 +CONFIG_CONSISTENT_SIZE=0x00200000
32756 +CONFIG_BOOT_LOAD=0x01000000
32757 +
32758 +#
32759 +# Networking
32760 +#
32761 +CONFIG_NET=y
32762 +
32763 +#
32764 +# Networking options
32765 +#
32766 +CONFIG_PACKET=y
32767 +# CONFIG_PACKET_MMAP is not set
32768 +CONFIG_UNIX=y
32769 +# CONFIG_NET_KEY is not set
32770 +CONFIG_INET=y
32771 +# CONFIG_IP_MULTICAST is not set
32772 +# CONFIG_IP_ADVANCED_ROUTER is not set
32773 +CONFIG_IP_FIB_HASH=y
32774 +CONFIG_IP_PNP=y
32775 +CONFIG_IP_PNP_DHCP=y
32776 +CONFIG_IP_PNP_BOOTP=y
32777 +# CONFIG_IP_PNP_RARP is not set
32778 +# CONFIG_NET_IPIP is not set
32779 +# CONFIG_NET_IPGRE is not set
32780 +# CONFIG_ARPD is not set
32781 +# CONFIG_SYN_COOKIES is not set
32782 +# CONFIG_INET_AH is not set
32783 +# CONFIG_INET_ESP is not set
32784 +# CONFIG_INET_IPCOMP is not set
32785 +# CONFIG_INET_XFRM_TUNNEL is not set
32786 +# CONFIG_INET_TUNNEL is not set
32787 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
32788 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
32789 +# CONFIG_INET_XFRM_MODE_BEET is not set
32790 +# CONFIG_INET_LRO is not set
32791 +CONFIG_INET_DIAG=y
32792 +CONFIG_INET_TCP_DIAG=y
32793 +# CONFIG_TCP_CONG_ADVANCED is not set
32794 +CONFIG_TCP_CONG_CUBIC=y
32795 +CONFIG_DEFAULT_TCP_CONG="cubic"
32796 +# CONFIG_TCP_MD5SIG is not set
32797 +# CONFIG_IPV6 is not set
32798 +# CONFIG_INET6_XFRM_TUNNEL is not set
32799 +# CONFIG_INET6_TUNNEL is not set
32800 +# CONFIG_NETWORK_SECMARK is not set
32801 +# CONFIG_NETFILTER is not set
32802 +# CONFIG_IP_DCCP is not set
32803 +# CONFIG_IP_SCTP is not set
32804 +# CONFIG_TIPC is not set
32805 +# CONFIG_ATM is not set
32806 +# CONFIG_BRIDGE is not set
32807 +# CONFIG_VLAN_8021Q is not set
32808 +# CONFIG_DECNET is not set
32809 +# CONFIG_LLC2 is not set
32810 +# CONFIG_IPX is not set
32811 +# CONFIG_ATALK is not set
32812 +# CONFIG_X25 is not set
32813 +# CONFIG_LAPB is not set
32814 +# CONFIG_ECONET is not set
32815 +# CONFIG_WAN_ROUTER is not set
32816 +# CONFIG_NET_SCHED is not set
32817 +
32818 +#
32819 +# Network testing
32820 +#
32821 +# CONFIG_NET_PKTGEN is not set
32822 +# CONFIG_HAMRADIO is not set
32823 +# CONFIG_IRDA is not set
32824 +# CONFIG_BT is not set
32825 +# CONFIG_AF_RXRPC is not set
32826 +
32827 +#
32828 +# Wireless
32829 +#
32830 +# CONFIG_CFG80211 is not set
32831 +# CONFIG_WIRELESS_EXT is not set
32832 +# CONFIG_MAC80211 is not set
32833 +# CONFIG_IEEE80211 is not set
32834 +# CONFIG_RFKILL is not set
32835 +# CONFIG_NET_9P is not set
32836 +
32837 +#
32838 +# Device Drivers
32839 +#
32840 +
32841 +#
32842 +# Generic Driver Options
32843 +#
32844 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
32845 +CONFIG_STANDALONE=y
32846 +CONFIG_PREVENT_FIRMWARE_BUILD=y
32847 +CONFIG_FW_LOADER=y
32848 +# CONFIG_DEBUG_DRIVER is not set
32849 +# CONFIG_DEBUG_DEVRES is not set
32850 +# CONFIG_SYS_HYPERVISOR is not set
32851 +CONFIG_CONNECTOR=y
32852 +CONFIG_PROC_EVENTS=y
32853 +CONFIG_MTD=y
32854 +# CONFIG_MTD_DEBUG is not set
32855 +# CONFIG_MTD_CONCAT is not set
32856 +CONFIG_MTD_PARTITIONS=y
32857 +# CONFIG_MTD_REDBOOT_PARTS is not set
32858 +CONFIG_MTD_CMDLINE_PARTS=y
32859 +
32860 +#
32861 +# User Modules And Translation Layers
32862 +#
32863 +CONFIG_MTD_CHAR=y
32864 +# CONFIG_MTD_BLKDEVS is not set
32865 +# CONFIG_MTD_BLOCK is not set
32866 +# CONFIG_MTD_BLOCK_RO is not set
32867 +# CONFIG_FTL is not set
32868 +# CONFIG_NFTL is not set
32869 +# CONFIG_INFTL is not set
32870 +# CONFIG_RFD_FTL is not set
32871 +# CONFIG_SSFDC is not set
32872 +# CONFIG_MTD_OOPS is not set
32873 +
32874 +#
32875 +# RAM/ROM/Flash chip drivers
32876 +#
32877 +CONFIG_MTD_CFI=y
32878 +CONFIG_MTD_JEDECPROBE=y
32879 +CONFIG_MTD_GEN_PROBE=y
32880 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
32881 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
32882 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
32883 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
32884 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
32885 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
32886 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
32887 +CONFIG_MTD_CFI_I1=y
32888 +CONFIG_MTD_CFI_I2=y
32889 +# CONFIG_MTD_CFI_I4 is not set
32890 +# CONFIG_MTD_CFI_I8 is not set
32891 +CONFIG_MTD_CFI_INTELEXT=y
32892 +CONFIG_MTD_CFI_AMDSTD=y
32893 +# CONFIG_MTD_CFI_STAA is not set
32894 +CONFIG_MTD_CFI_UTIL=y
32895 +# CONFIG_MTD_RAM is not set
32896 +# CONFIG_MTD_ROM is not set
32897 +# CONFIG_MTD_ABSENT is not set
32898 +
32899 +#
32900 +# Mapping drivers for chip access
32901 +#
32902 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
32903 +# CONFIG_MTD_PHYSMAP is not set
32904 +CONFIG_MTD_PHYSMAP_OF=y
32905 +# CONFIG_MTD_INTEL_VR_NOR is not set
32906 +# CONFIG_MTD_PLATRAM is not set
32907 +
32908 +#
32909 +# Self-contained MTD device drivers
32910 +#
32911 +# CONFIG_MTD_PMC551 is not set
32912 +# CONFIG_MTD_SLRAM is not set
32913 +# CONFIG_MTD_PHRAM is not set
32914 +# CONFIG_MTD_MTDRAM is not set
32915 +# CONFIG_MTD_BLOCK2MTD is not set
32916 +
32917 +#
32918 +# Disk-On-Chip Device Drivers
32919 +#
32920 +# CONFIG_MTD_DOC2000 is not set
32921 +# CONFIG_MTD_DOC2001 is not set
32922 +# CONFIG_MTD_DOC2001PLUS is not set
32923 +# CONFIG_MTD_NAND is not set
32924 +# CONFIG_MTD_ONENAND is not set
32925 +
32926 +#
32927 +# UBI - Unsorted block images
32928 +#
32929 +# CONFIG_MTD_UBI is not set
32930 +CONFIG_OF_DEVICE=y
32931 +# CONFIG_PARPORT is not set
32932 +CONFIG_BLK_DEV=y
32933 +# CONFIG_BLK_DEV_FD is not set
32934 +# CONFIG_BLK_CPQ_DA is not set
32935 +# CONFIG_BLK_CPQ_CISS_DA is not set
32936 +# CONFIG_BLK_DEV_DAC960 is not set
32937 +# CONFIG_BLK_DEV_UMEM is not set
32938 +# CONFIG_BLK_DEV_COW_COMMON is not set
32939 +# CONFIG_BLK_DEV_LOOP is not set
32940 +# CONFIG_BLK_DEV_NBD is not set
32941 +# CONFIG_BLK_DEV_SX8 is not set
32942 +CONFIG_BLK_DEV_RAM=y
32943 +CONFIG_BLK_DEV_RAM_COUNT=16
32944 +CONFIG_BLK_DEV_RAM_SIZE=35000
32945 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
32946 +# CONFIG_CDROM_PKTCDVD is not set
32947 +# CONFIG_ATA_OVER_ETH is not set
32948 +# CONFIG_XILINX_SYSACE is not set
32949 +CONFIG_MISC_DEVICES=y
32950 +# CONFIG_PHANTOM is not set
32951 +# CONFIG_EEPROM_93CX6 is not set
32952 +# CONFIG_SGI_IOC4 is not set
32953 +# CONFIG_TIFM_CORE is not set
32954 +# CONFIG_IDE is not set
32955 +
32956 +#
32957 +# SCSI device support
32958 +#
32959 +# CONFIG_RAID_ATTRS is not set
32960 +# CONFIG_SCSI is not set
32961 +# CONFIG_SCSI_DMA is not set
32962 +# CONFIG_SCSI_NETLINK is not set
32963 +# CONFIG_ATA is not set
32964 +# CONFIG_MD is not set
32965 +# CONFIG_FUSION is not set
32966 +
32967 +#
32968 +# IEEE 1394 (FireWire) support
32969 +#
32970 +# CONFIG_FIREWIRE is not set
32971 +# CONFIG_IEEE1394 is not set
32972 +# CONFIG_I2O is not set
32973 +CONFIG_MACINTOSH_DRIVERS=y
32974 +# CONFIG_MAC_EMUMOUSEBTN is not set
32975 +# CONFIG_WINDFARM is not set
32976 +CONFIG_NETDEVICES=y
32977 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
32978 +# CONFIG_DUMMY is not set
32979 +# CONFIG_BONDING is not set
32980 +# CONFIG_MACVLAN is not set
32981 +# CONFIG_EQUALIZER is not set
32982 +# CONFIG_TUN is not set
32983 +# CONFIG_VETH is not set
32984 +# CONFIG_IP1000 is not set
32985 +# CONFIG_ARCNET is not set
32986 +# CONFIG_NET_ETHERNET is not set
32987 +CONFIG_IBM_NEW_EMAC_ZMII=y
32988 +CONFIG_IBM_NEW_EMAC_RGMII=y
32989 +CONFIG_IBM_NEW_EMAC_EMAC4=y
32990 +CONFIG_NETDEV_1000=y
32991 +# CONFIG_ACENIC is not set
32992 +# CONFIG_DL2K is not set
32993 +# CONFIG_E1000 is not set
32994 +# CONFIG_E1000E is not set
32995 +# CONFIG_NS83820 is not set
32996 +# CONFIG_HAMACHI is not set
32997 +# CONFIG_YELLOWFIN is not set
32998 +# CONFIG_R8169 is not set
32999 +# CONFIG_SIS190 is not set
33000 +# CONFIG_SKGE is not set
33001 +# CONFIG_SKY2 is not set
33002 +# CONFIG_SK98LIN is not set
33003 +# CONFIG_VIA_VELOCITY is not set
33004 +# CONFIG_TIGON3 is not set
33005 +# CONFIG_BNX2 is not set
33006 +# CONFIG_QLA3XXX is not set
33007 +# CONFIG_ATL1 is not set
33008 +CONFIG_NETDEV_10000=y
33009 +# CONFIG_CHELSIO_T1 is not set
33010 +# CONFIG_CHELSIO_T3 is not set
33011 +# CONFIG_IXGBE is not set
33012 +# CONFIG_IXGB is not set
33013 +# CONFIG_S2IO is not set
33014 +# CONFIG_MYRI10GE is not set
33015 +# CONFIG_NETXEN_NIC is not set
33016 +# CONFIG_NIU is not set
33017 +# CONFIG_MLX4_CORE is not set
33018 +# CONFIG_TEHUTI is not set
33019 +# CONFIG_TR is not set
33020 +
33021 +#
33022 +# Wireless LAN
33023 +#
33024 +# CONFIG_WLAN_PRE80211 is not set
33025 +# CONFIG_WLAN_80211 is not set
33026 +# CONFIG_WAN is not set
33027 +# CONFIG_FDDI is not set
33028 +# CONFIG_HIPPI is not set
33029 +# CONFIG_PPP is not set
33030 +# CONFIG_SLIP is not set
33031 +# CONFIG_SHAPER is not set
33032 +# CONFIG_NETCONSOLE is not set
33033 +# CONFIG_NETPOLL is not set
33034 +# CONFIG_NET_POLL_CONTROLLER is not set
33035 +# CONFIG_ISDN is not set
33036 +# CONFIG_PHONE is not set
33037 +
33038 +#
33039 +# Input device support
33040 +#
33041 +# CONFIG_INPUT is not set
33042 +
33043 +#
33044 +# Hardware I/O ports
33045 +#
33046 +# CONFIG_SERIO is not set
33047 +# CONFIG_GAMEPORT is not set
33048 +
33049 +#
33050 +# Character devices
33051 +#
33052 +# CONFIG_VT is not set
33053 +# CONFIG_SERIAL_NONSTANDARD is not set
33054 +
33055 +#
33056 +# Serial drivers
33057 +#
33058 +CONFIG_SERIAL_8250=y
33059 +CONFIG_SERIAL_8250_CONSOLE=y
33060 +# CONFIG_SERIAL_8250_PCI is not set
33061 +CONFIG_SERIAL_8250_NR_UARTS=4
33062 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
33063 +CONFIG_SERIAL_8250_EXTENDED=y
33064 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
33065 +CONFIG_SERIAL_8250_SHARE_IRQ=y
33066 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
33067 +# CONFIG_SERIAL_8250_RSA is not set
33068 +
33069 +#
33070 +# Non-8250 serial port support
33071 +#
33072 +# CONFIG_SERIAL_UARTLITE is not set
33073 +CONFIG_SERIAL_CORE=y
33074 +CONFIG_SERIAL_CORE_CONSOLE=y
33075 +# CONFIG_SERIAL_JSM is not set
33076 +CONFIG_SERIAL_OF_PLATFORM=y
33077 +CONFIG_UNIX98_PTYS=y
33078 +CONFIG_LEGACY_PTYS=y
33079 +CONFIG_LEGACY_PTY_COUNT=256
33080 +# CONFIG_IPMI_HANDLER is not set
33081 +# CONFIG_HW_RANDOM is not set
33082 +# CONFIG_NVRAM is not set
33083 +# CONFIG_GEN_RTC is not set
33084 +# CONFIG_R3964 is not set
33085 +# CONFIG_APPLICOM is not set
33086 +# CONFIG_RAW_DRIVER is not set
33087 +# CONFIG_TCG_TPM is not set
33088 +CONFIG_DEVPORT=y
33089 +# CONFIG_I2C is not set
33090 +
33091 +#
33092 +# SPI support
33093 +#
33094 +# CONFIG_SPI is not set
33095 +# CONFIG_SPI_MASTER is not set
33096 +# CONFIG_W1 is not set
33097 +# CONFIG_POWER_SUPPLY is not set
33098 +# CONFIG_HWMON is not set
33099 +# CONFIG_WATCHDOG is not set
33100 +
33101 +#
33102 +# Sonics Silicon Backplane
33103 +#
33104 +CONFIG_SSB_POSSIBLE=y
33105 +# CONFIG_SSB is not set
33106 +
33107 +#
33108 +# Multifunction device drivers
33109 +#
33110 +# CONFIG_MFD_SM501 is not set
33111 +
33112 +#
33113 +# Multimedia devices
33114 +#
33115 +# CONFIG_VIDEO_DEV is not set
33116 +# CONFIG_DVB_CORE is not set
33117 +CONFIG_DAB=y
33118 +
33119 +#
33120 +# Graphics support
33121 +#
33122 +# CONFIG_AGP is not set
33123 +# CONFIG_DRM is not set
33124 +# CONFIG_VGASTATE is not set
33125 +CONFIG_VIDEO_OUTPUT_CONTROL=m
33126 +# CONFIG_FB is not set
33127 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
33128 +
33129 +#
33130 +# Display device support
33131 +#
33132 +# CONFIG_DISPLAY_SUPPORT is not set
33133 +
33134 +#
33135 +# Sound
33136 +#
33137 +# CONFIG_SOUND is not set
33138 +CONFIG_USB_SUPPORT=y
33139 +CONFIG_USB_ARCH_HAS_HCD=y
33140 +CONFIG_USB_ARCH_HAS_OHCI=y
33141 +CONFIG_USB_ARCH_HAS_EHCI=y
33142 +# CONFIG_USB is not set
33143 +
33144 +#
33145 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
33146 +#
33147 +
33148 +#
33149 +# USB Gadget Support
33150 +#
33151 +# CONFIG_USB_GADGET is not set
33152 +# CONFIG_MMC is not set
33153 +# CONFIG_NEW_LEDS is not set
33154 +# CONFIG_INFINIBAND is not set
33155 +# CONFIG_EDAC is not set
33156 +# CONFIG_RTC_CLASS is not set
33157 +
33158 +#
33159 +# Userspace I/O
33160 +#
33161 +# CONFIG_UIO is not set
33162 +
33163 +#
33164 +# File systems
33165 +#
33166 +CONFIG_EXT2_FS=y
33167 +# CONFIG_EXT2_FS_XATTR is not set
33168 +# CONFIG_EXT2_FS_XIP is not set
33169 +# CONFIG_EXT3_FS is not set
33170 +# CONFIG_EXT4DEV_FS is not set
33171 +# CONFIG_REISERFS_FS is not set
33172 +# CONFIG_JFS_FS is not set
33173 +# CONFIG_FS_POSIX_ACL is not set
33174 +# CONFIG_XFS_FS is not set
33175 +# CONFIG_GFS2_FS is not set
33176 +# CONFIG_OCFS2_FS is not set
33177 +# CONFIG_MINIX_FS is not set
33178 +# CONFIG_ROMFS_FS is not set
33179 +CONFIG_INOTIFY=y
33180 +CONFIG_INOTIFY_USER=y
33181 +# CONFIG_QUOTA is not set
33182 +CONFIG_DNOTIFY=y
33183 +# CONFIG_AUTOFS_FS is not set
33184 +# CONFIG_AUTOFS4_FS is not set
33185 +# CONFIG_FUSE_FS is not set
33186 +
33187 +#
33188 +# CD-ROM/DVD Filesystems
33189 +#
33190 +# CONFIG_ISO9660_FS is not set
33191 +# CONFIG_UDF_FS is not set
33192 +
33193 +#
33194 +# DOS/FAT/NT Filesystems
33195 +#
33196 +# CONFIG_MSDOS_FS is not set
33197 +# CONFIG_VFAT_FS is not set
33198 +# CONFIG_NTFS_FS is not set
33199 +
33200 +#
33201 +# Pseudo filesystems
33202 +#
33203 +CONFIG_PROC_FS=y
33204 +CONFIG_PROC_KCORE=y
33205 +CONFIG_PROC_SYSCTL=y
33206 +CONFIG_SYSFS=y
33207 +CONFIG_TMPFS=y
33208 +# CONFIG_TMPFS_POSIX_ACL is not set
33209 +# CONFIG_HUGETLB_PAGE is not set
33210 +# CONFIG_CONFIGFS_FS is not set
33211 +
33212 +#
33213 +# Miscellaneous filesystems
33214 +#
33215 +# CONFIG_ADFS_FS is not set
33216 +# CONFIG_AFFS_FS is not set
33217 +# CONFIG_HFS_FS is not set
33218 +# CONFIG_HFSPLUS_FS is not set
33219 +# CONFIG_BEFS_FS is not set
33220 +# CONFIG_BFS_FS is not set
33221 +# CONFIG_EFS_FS is not set
33222 +CONFIG_JFFS2_FS=y
33223 +CONFIG_JFFS2_FS_DEBUG=0
33224 +CONFIG_JFFS2_FS_WRITEBUFFER=y
33225 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
33226 +# CONFIG_JFFS2_SUMMARY is not set
33227 +# CONFIG_JFFS2_FS_XATTR is not set
33228 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
33229 +CONFIG_JFFS2_ZLIB=y
33230 +# CONFIG_JFFS2_LZO is not set
33231 +CONFIG_JFFS2_RTIME=y
33232 +# CONFIG_JFFS2_RUBIN is not set
33233 +CONFIG_CRAMFS=y
33234 +# CONFIG_VXFS_FS is not set
33235 +# CONFIG_HPFS_FS is not set
33236 +# CONFIG_QNX4FS_FS is not set
33237 +# CONFIG_SYSV_FS is not set
33238 +# CONFIG_UFS_FS is not set
33239 +CONFIG_NETWORK_FILESYSTEMS=y
33240 +CONFIG_NFS_FS=y
33241 +CONFIG_NFS_V3=y
33242 +# CONFIG_NFS_V3_ACL is not set
33243 +# CONFIG_NFS_V4 is not set
33244 +# CONFIG_NFS_DIRECTIO is not set
33245 +# CONFIG_NFSD is not set
33246 +CONFIG_ROOT_NFS=y
33247 +CONFIG_LOCKD=y
33248 +CONFIG_LOCKD_V4=y
33249 +CONFIG_NFS_COMMON=y
33250 +CONFIG_SUNRPC=y
33251 +# CONFIG_SUNRPC_BIND34 is not set
33252 +# CONFIG_RPCSEC_GSS_KRB5 is not set
33253 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
33254 +# CONFIG_SMB_FS is not set
33255 +# CONFIG_CIFS is not set
33256 +# CONFIG_NCP_FS is not set
33257 +# CONFIG_CODA_FS is not set
33258 +# CONFIG_AFS_FS is not set
33259 +
33260 +#
33261 +# Partition Types
33262 +#
33263 +# CONFIG_PARTITION_ADVANCED is not set
33264 +CONFIG_MSDOS_PARTITION=y
33265 +# CONFIG_NLS is not set
33266 +# CONFIG_DLM is not set
33267 +# CONFIG_UCC_SLOW is not set
33268 +
33269 +#
33270 +# Library routines
33271 +#
33272 +CONFIG_BITREVERSE=y
33273 +# CONFIG_CRC_CCITT is not set
33274 +# CONFIG_CRC16 is not set
33275 +# CONFIG_CRC_ITU_T is not set
33276 +CONFIG_CRC32=y
33277 +# CONFIG_CRC7 is not set
33278 +# CONFIG_LIBCRC32C is not set
33279 +CONFIG_ZLIB_INFLATE=y
33280 +CONFIG_ZLIB_DEFLATE=y
33281 +CONFIG_PLIST=y
33282 +CONFIG_HAS_IOMEM=y
33283 +CONFIG_HAS_IOPORT=y
33284 +CONFIG_HAS_DMA=y
33285 +CONFIG_INSTRUMENTATION=y
33286 +# CONFIG_PROFILING is not set
33287 +# CONFIG_KPROBES is not set
33288 +# CONFIG_MARKERS is not set
33289 +
33290 +#
33291 +# Kernel hacking
33292 +#
33293 +# CONFIG_PRINTK_TIME is not set
33294 +CONFIG_ENABLE_WARN_DEPRECATED=y
33295 +CONFIG_ENABLE_MUST_CHECK=y
33296 +CONFIG_MAGIC_SYSRQ=y
33297 +# CONFIG_UNUSED_SYMBOLS is not set
33298 +# CONFIG_DEBUG_FS is not set
33299 +# CONFIG_HEADERS_CHECK is not set
33300 +CONFIG_DEBUG_KERNEL=y
33301 +# CONFIG_DEBUG_SHIRQ is not set
33302 +CONFIG_DETECT_SOFTLOCKUP=y
33303 +CONFIG_SCHED_DEBUG=y
33304 +# CONFIG_SCHEDSTATS is not set
33305 +# CONFIG_TIMER_STATS is not set
33306 +# CONFIG_SLUB_DEBUG_ON is not set
33307 +# CONFIG_DEBUG_RT_MUTEXES is not set
33308 +# CONFIG_RT_MUTEX_TESTER is not set
33309 +# CONFIG_DEBUG_SPINLOCK is not set
33310 +# CONFIG_DEBUG_MUTEXES is not set
33311 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
33312 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
33313 +# CONFIG_DEBUG_KOBJECT is not set
33314 +# CONFIG_DEBUG_BUGVERBOSE is not set
33315 +# CONFIG_DEBUG_INFO is not set
33316 +# CONFIG_DEBUG_VM is not set
33317 +# CONFIG_DEBUG_LIST is not set
33318 +# CONFIG_DEBUG_SG is not set
33319 +CONFIG_FORCED_INLINING=y
33320 +# CONFIG_BOOT_PRINTK_DELAY is not set
33321 +# CONFIG_RCU_TORTURE_TEST is not set
33322 +# CONFIG_FAULT_INJECTION is not set
33323 +# CONFIG_SAMPLES is not set
33324 +# CONFIG_DEBUG_STACKOVERFLOW is not set
33325 +# CONFIG_DEBUG_STACK_USAGE is not set
33326 +# CONFIG_DEBUG_PAGEALLOC is not set
33327 +CONFIG_DEBUGGER=y
33328 +# CONFIG_KGDB is not set
33329 +# CONFIG_XMON is not set
33330 +# CONFIG_BDI_SWITCH is not set
33331 +CONFIG_PPC_EARLY_DEBUG=y
33332 +# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
33333 +# CONFIG_PPC_EARLY_DEBUG_G5 is not set
33334 +# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
33335 +# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
33336 +# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
33337 +# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
33338 +# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
33339 +# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
33340 +CONFIG_PPC_EARLY_DEBUG_44x=y
33341 +# CONFIG_PPC_EARLY_DEBUG_40x is not set
33342 +# CONFIG_PPC_EARLY_DEBUG_CPM is not set
33343 +CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
33344 +CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x1
33345 +
33346 +#
33347 +# Security options
33348 +#
33349 +# CONFIG_KEYS is not set
33350 +# CONFIG_SECURITY is not set
33351 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
33352 +CONFIG_CRYPTO=y
33353 +CONFIG_CRYPTO_ALGAPI=y
33354 +CONFIG_CRYPTO_BLKCIPHER=y
33355 +CONFIG_CRYPTO_MANAGER=y
33356 +# CONFIG_CRYPTO_HMAC is not set
33357 +# CONFIG_CRYPTO_XCBC is not set
33358 +# CONFIG_CRYPTO_NULL is not set
33359 +# CONFIG_CRYPTO_MD4 is not set
33360 +CONFIG_CRYPTO_MD5=y
33361 +# CONFIG_CRYPTO_SHA1 is not set
33362 +# CONFIG_CRYPTO_SHA256 is not set
33363 +# CONFIG_CRYPTO_SHA512 is not set
33364 +# CONFIG_CRYPTO_WP512 is not set
33365 +# CONFIG_CRYPTO_TGR192 is not set
33366 +# CONFIG_CRYPTO_GF128MUL is not set
33367 +CONFIG_CRYPTO_ECB=y
33368 +CONFIG_CRYPTO_CBC=y
33369 +CONFIG_CRYPTO_PCBC=y
33370 +# CONFIG_CRYPTO_LRW is not set
33371 +# CONFIG_CRYPTO_XTS is not set
33372 +# CONFIG_CRYPTO_CRYPTD is not set
33373 +CONFIG_CRYPTO_DES=y
33374 +# CONFIG_CRYPTO_FCRYPT is not set
33375 +# CONFIG_CRYPTO_BLOWFISH is not set
33376 +# CONFIG_CRYPTO_TWOFISH is not set
33377 +# CONFIG_CRYPTO_SERPENT is not set
33378 +# CONFIG_CRYPTO_AES is not set
33379 +# CONFIG_CRYPTO_CAST5 is not set
33380 +# CONFIG_CRYPTO_CAST6 is not set
33381 +# CONFIG_CRYPTO_TEA is not set
33382 +# CONFIG_CRYPTO_ARC4 is not set
33383 +# CONFIG_CRYPTO_KHAZAD is not set
33384 +# CONFIG_CRYPTO_ANUBIS is not set
33385 +# CONFIG_CRYPTO_SEED is not set
33386 +# CONFIG_CRYPTO_DEFLATE is not set
33387 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
33388 +# CONFIG_CRYPTO_CRC32C is not set
33389 +# CONFIG_CRYPTO_CAMELLIA is not set
33390 +# CONFIG_CRYPTO_TEST is not set
33391 +# CONFIG_CRYPTO_AUTHENC is not set
33392 +CONFIG_CRYPTO_HW=y
33393 +# CONFIG_PPC_CLOCK is not set
33394 Index: linux-2.6.24.7/arch/powerpc/configs/sequoia_defconfig
33395 ===================================================================
33396 --- linux-2.6.24.7.orig/arch/powerpc/configs/sequoia_defconfig
33397 +++ linux-2.6.24.7/arch/powerpc/configs/sequoia_defconfig
33398 @@ -1,7 +1,7 @@
33399  #
33400  # Automatically generated make config: don't edit
33401 -# Linux kernel version: 2.6.24-rc4
33402 -# Thu Dec  6 16:49:17 2007
33403 +# Linux kernel version: 2.6.24-rc6
33404 +# Mon Dec 24 11:23:22 2007
33405  #
33406  # CONFIG_PPC64 is not set
33407  
33408 @@ -129,6 +129,7 @@ CONFIG_DEFAULT_AS=y
33409  # CONFIG_DEFAULT_CFQ is not set
33410  # CONFIG_DEFAULT_NOOP is not set
33411  CONFIG_DEFAULT_IOSCHED="anticipatory"
33412 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
33413  
33414  #
33415  # Platform support
33416 @@ -141,8 +142,10 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
33417  # CONFIG_BAMBOO is not set
33418  # CONFIG_EBONY is not set
33419  CONFIG_SEQUOIA=y
33420 +# CONFIG_TAISHAN is not set
33421 +# CONFIG_KATMAI is not set
33422 +# CONFIG_RAINIER is not set
33423  CONFIG_440EPX=y
33424 -CONFIG_440A=y
33425  # CONFIG_MPIC is not set
33426  # CONFIG_MPIC_WEIRD is not set
33427  # CONFIG_PPC_I8259 is not set
33428 @@ -446,9 +449,7 @@ CONFIG_MISC_DEVICES=y
33429  # CONFIG_FIREWIRE is not set
33430  # CONFIG_IEEE1394 is not set
33431  # CONFIG_I2O is not set
33432 -CONFIG_MACINTOSH_DRIVERS=y
33433 -# CONFIG_MAC_EMUMOUSEBTN is not set
33434 -# CONFIG_WINDFARM is not set
33435 +# CONFIG_MACINTOSH_DRIVERS is not set
33436  CONFIG_NETDEVICES=y
33437  # CONFIG_NETDEVICES_MULTIQUEUE is not set
33438  # CONFIG_DUMMY is not set
33439 @@ -459,10 +460,28 @@ CONFIG_NETDEVICES=y
33440  # CONFIG_VETH is not set
33441  # CONFIG_IP1000 is not set
33442  # CONFIG_ARCNET is not set
33443 -# CONFIG_NET_ETHERNET is not set
33444 +# CONFIG_PHYLIB is not set
33445 +CONFIG_NET_ETHERNET=y
33446 +# CONFIG_MII is not set
33447 +# CONFIG_HAPPYMEAL is not set
33448 +# CONFIG_SUNGEM is not set
33449 +# CONFIG_CASSINI is not set
33450 +# CONFIG_NET_VENDOR_3COM is not set
33451 +# CONFIG_NET_TULIP is not set
33452 +# CONFIG_HP100 is not set
33453 +CONFIG_IBM_NEW_EMAC=y
33454 +CONFIG_IBM_NEW_EMAC_RXB=128
33455 +CONFIG_IBM_NEW_EMAC_TXB=64
33456 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
33457 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
33458 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
33459 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
33460  CONFIG_IBM_NEW_EMAC_ZMII=y
33461  CONFIG_IBM_NEW_EMAC_RGMII=y
33462 +# CONFIG_IBM_NEW_EMAC_TAH is not set
33463  CONFIG_IBM_NEW_EMAC_EMAC4=y
33464 +# CONFIG_NET_PCI is not set
33465 +# CONFIG_B44 is not set
33466  CONFIG_NETDEV_1000=y
33467  # CONFIG_ACENIC is not set
33468  # CONFIG_DL2K is not set
33469 @@ -811,6 +830,7 @@ CONFIG_PPC_EARLY_DEBUG=y
33470  # CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
33471  # CONFIG_PPC_EARLY_DEBUG_BEAT is not set
33472  CONFIG_PPC_EARLY_DEBUG_44x=y
33473 +# CONFIG_PPC_EARLY_DEBUG_40x is not set
33474  # CONFIG_PPC_EARLY_DEBUG_CPM is not set
33475  CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
33476  CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x1
33477 Index: linux-2.6.24.7/arch/powerpc/configs/storcenter_defconfig
33478 ===================================================================
33479 --- /dev/null
33480 +++ linux-2.6.24.7/arch/powerpc/configs/storcenter_defconfig
33481 @@ -0,0 +1,1174 @@
33482 +#
33483 +# Automatically generated make config: don't edit
33484 +# Linux kernel version: 2.6.24-rc6
33485 +# Tue Jan  8 09:33:54 2008
33486 +#
33487 +# CONFIG_PPC64 is not set
33488 +
33489 +#
33490 +# Processor support
33491 +#
33492 +CONFIG_6xx=y
33493 +# CONFIG_PPC_85xx is not set
33494 +# CONFIG_PPC_8xx is not set
33495 +# CONFIG_40x is not set
33496 +# CONFIG_44x is not set
33497 +# CONFIG_E200 is not set
33498 +CONFIG_PPC_FPU=y
33499 +# CONFIG_ALTIVEC is not set
33500 +CONFIG_PPC_STD_MMU=y
33501 +CONFIG_PPC_STD_MMU_32=y
33502 +# CONFIG_PPC_MM_SLICES is not set
33503 +# CONFIG_SMP is not set
33504 +CONFIG_PPC32=y
33505 +CONFIG_WORD_SIZE=32
33506 +CONFIG_PPC_MERGE=y
33507 +CONFIG_MMU=y
33508 +CONFIG_GENERIC_CMOS_UPDATE=y
33509 +CONFIG_GENERIC_TIME=y
33510 +CONFIG_GENERIC_TIME_VSYSCALL=y
33511 +CONFIG_GENERIC_CLOCKEVENTS=y
33512 +CONFIG_GENERIC_HARDIRQS=y
33513 +CONFIG_IRQ_PER_CPU=y
33514 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
33515 +CONFIG_ARCH_HAS_ILOG2_U32=y
33516 +CONFIG_GENERIC_HWEIGHT=y
33517 +CONFIG_GENERIC_CALIBRATE_DELAY=y
33518 +CONFIG_GENERIC_FIND_NEXT_BIT=y
33519 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
33520 +CONFIG_PPC=y
33521 +CONFIG_EARLY_PRINTK=y
33522 +CONFIG_GENERIC_NVRAM=y
33523 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
33524 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
33525 +CONFIG_PPC_OF=y
33526 +CONFIG_OF=y
33527 +CONFIG_PPC_UDBG_16550=y
33528 +# CONFIG_GENERIC_TBSYNC is not set
33529 +CONFIG_AUDIT_ARCH=y
33530 +CONFIG_GENERIC_BUG=y
33531 +# CONFIG_DEFAULT_UIMAGE is not set
33532 +# CONFIG_PPC_DCR_NATIVE is not set
33533 +# CONFIG_PPC_DCR_MMIO is not set
33534 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
33535 +
33536 +#
33537 +# General setup
33538 +#
33539 +CONFIG_EXPERIMENTAL=y
33540 +CONFIG_BROKEN_ON_SMP=y
33541 +CONFIG_INIT_ENV_ARG_LIMIT=32
33542 +CONFIG_LOCALVERSION=""
33543 +CONFIG_LOCALVERSION_AUTO=y
33544 +CONFIG_SWAP=y
33545 +CONFIG_SYSVIPC=y
33546 +CONFIG_SYSVIPC_SYSCTL=y
33547 +# CONFIG_POSIX_MQUEUE is not set
33548 +# CONFIG_BSD_PROCESS_ACCT is not set
33549 +# CONFIG_TASKSTATS is not set
33550 +# CONFIG_USER_NS is not set
33551 +# CONFIG_PID_NS is not set
33552 +# CONFIG_AUDIT is not set
33553 +# CONFIG_IKCONFIG is not set
33554 +CONFIG_LOG_BUF_SHIFT=14
33555 +# CONFIG_CGROUPS is not set
33556 +CONFIG_FAIR_GROUP_SCHED=y
33557 +CONFIG_FAIR_USER_SCHED=y
33558 +# CONFIG_FAIR_CGROUP_SCHED is not set
33559 +CONFIG_SYSFS_DEPRECATED=y
33560 +# CONFIG_RELAY is not set
33561 +# CONFIG_BLK_DEV_INITRD is not set
33562 +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
33563 +CONFIG_SYSCTL=y
33564 +CONFIG_EMBEDDED=y
33565 +CONFIG_SYSCTL_SYSCALL=y
33566 +# CONFIG_KALLSYMS is not set
33567 +CONFIG_HOTPLUG=y
33568 +CONFIG_PRINTK=y
33569 +CONFIG_BUG=y
33570 +CONFIG_ELF_CORE=y
33571 +CONFIG_BASE_FULL=y
33572 +CONFIG_FUTEX=y
33573 +CONFIG_ANON_INODES=y
33574 +CONFIG_EPOLL=y
33575 +CONFIG_SIGNALFD=y
33576 +CONFIG_EVENTFD=y
33577 +CONFIG_SHMEM=y
33578 +CONFIG_VM_EVENT_COUNTERS=y
33579 +CONFIG_SLUB_DEBUG=y
33580 +# CONFIG_SLAB is not set
33581 +CONFIG_SLUB=y
33582 +# CONFIG_SLOB is not set
33583 +CONFIG_RT_MUTEXES=y
33584 +# CONFIG_TINY_SHMEM is not set
33585 +CONFIG_BASE_SMALL=0
33586 +CONFIG_MODULES=y
33587 +CONFIG_MODULE_UNLOAD=y
33588 +# CONFIG_MODULE_FORCE_UNLOAD is not set
33589 +# CONFIG_MODVERSIONS is not set
33590 +# CONFIG_MODULE_SRCVERSION_ALL is not set
33591 +CONFIG_KMOD=y
33592 +CONFIG_BLOCK=y
33593 +CONFIG_LBD=y
33594 +# CONFIG_BLK_DEV_IO_TRACE is not set
33595 +# CONFIG_LSF is not set
33596 +# CONFIG_BLK_DEV_BSG is not set
33597 +
33598 +#
33599 +# IO Schedulers
33600 +#
33601 +CONFIG_IOSCHED_NOOP=y
33602 +CONFIG_IOSCHED_AS=y
33603 +CONFIG_IOSCHED_DEADLINE=y
33604 +CONFIG_IOSCHED_CFQ=y
33605 +# CONFIG_DEFAULT_AS is not set
33606 +# CONFIG_DEFAULT_DEADLINE is not set
33607 +CONFIG_DEFAULT_CFQ=y
33608 +# CONFIG_DEFAULT_NOOP is not set
33609 +CONFIG_DEFAULT_IOSCHED="cfq"
33610 +
33611 +#
33612 +# Platform support
33613 +#
33614 +CONFIG_PPC_MULTIPLATFORM=y
33615 +# CONFIG_PPC_82xx is not set
33616 +# CONFIG_PPC_83xx is not set
33617 +# CONFIG_PPC_86xx is not set
33618 +CONFIG_CLASSIC32=y
33619 +# CONFIG_PPC_CHRP is not set
33620 +# CONFIG_PPC_MPC52xx is not set
33621 +# CONFIG_PPC_MPC5200 is not set
33622 +# CONFIG_PPC_EFIKA is not set
33623 +# CONFIG_PPC_LITE5200 is not set
33624 +# CONFIG_PPC_PMAC is not set
33625 +# CONFIG_PPC_CELL is not set
33626 +# CONFIG_PPC_CELL_NATIVE is not set
33627 +# CONFIG_PQ2ADS is not set
33628 +CONFIG_EMBEDDED6xx=y
33629 +# CONFIG_LINKSTATION is not set
33630 +CONFIG_STORCENTER=y
33631 +# CONFIG_MPC7448HPC2 is not set
33632 +# CONFIG_PPC_HOLLY is not set
33633 +# CONFIG_PPC_PRPMC2800 is not set
33634 +CONFIG_MPC10X_BRIDGE=y
33635 +CONFIG_MPC10X_OPENPIC=y
33636 +# CONFIG_MPC10X_STORE_GATHERING is not set
33637 +CONFIG_MPIC=y
33638 +# CONFIG_MPIC_WEIRD is not set
33639 +# CONFIG_PPC_I8259 is not set
33640 +# CONFIG_PPC_RTAS is not set
33641 +# CONFIG_MMIO_NVRAM is not set
33642 +# CONFIG_PPC_MPC106 is not set
33643 +# CONFIG_PPC_970_NAP is not set
33644 +# CONFIG_PPC_INDIRECT_IO is not set
33645 +# CONFIG_GENERIC_IOMAP is not set
33646 +# CONFIG_CPU_FREQ is not set
33647 +# CONFIG_TAU is not set
33648 +# CONFIG_CPM2 is not set
33649 +# CONFIG_FSL_ULI1575 is not set
33650 +
33651 +#
33652 +# Kernel options
33653 +#
33654 +# CONFIG_HIGHMEM is not set
33655 +# CONFIG_TICK_ONESHOT is not set
33656 +# CONFIG_NO_HZ is not set
33657 +# CONFIG_HIGH_RES_TIMERS is not set
33658 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
33659 +CONFIG_HZ_100=y
33660 +# CONFIG_HZ_250 is not set
33661 +# CONFIG_HZ_300 is not set
33662 +# CONFIG_HZ_1000 is not set
33663 +CONFIG_HZ=100
33664 +CONFIG_PREEMPT_NONE=y
33665 +# CONFIG_PREEMPT_VOLUNTARY is not set
33666 +# CONFIG_PREEMPT is not set
33667 +CONFIG_BINFMT_ELF=y
33668 +CONFIG_BINFMT_MISC=y
33669 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
33670 +# CONFIG_KEXEC is not set
33671 +CONFIG_ARCH_FLATMEM_ENABLE=y
33672 +CONFIG_ARCH_POPULATES_NODE_MAP=y
33673 +CONFIG_SELECT_MEMORY_MODEL=y
33674 +CONFIG_FLATMEM_MANUAL=y
33675 +# CONFIG_DISCONTIGMEM_MANUAL is not set
33676 +# CONFIG_SPARSEMEM_MANUAL is not set
33677 +CONFIG_FLATMEM=y
33678 +CONFIG_FLAT_NODE_MEM_MAP=y
33679 +# CONFIG_SPARSEMEM_STATIC is not set
33680 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
33681 +CONFIG_SPLIT_PTLOCK_CPUS=4
33682 +# CONFIG_RESOURCES_64BIT is not set
33683 +CONFIG_ZONE_DMA_FLAG=1
33684 +CONFIG_BOUNCE=y
33685 +CONFIG_VIRT_TO_BUS=y
33686 +CONFIG_PROC_DEVICETREE=y
33687 +CONFIG_CMDLINE_BOOL=y
33688 +CONFIG_CMDLINE="console=ttyS0,115200"
33689 +# CONFIG_PM is not set
33690 +CONFIG_SUSPEND_UP_POSSIBLE=y
33691 +CONFIG_HIBERNATION_UP_POSSIBLE=y
33692 +# CONFIG_SECCOMP is not set
33693 +CONFIG_WANT_DEVICE_TREE=y
33694 +CONFIG_DEVICE_TREE="storcenter.dts"
33695 +CONFIG_ISA_DMA_API=y
33696 +
33697 +#
33698 +# Bus options
33699 +#
33700 +CONFIG_ZONE_DMA=y
33701 +CONFIG_GENERIC_ISA_DMA=y
33702 +CONFIG_PPC_INDIRECT_PCI=y
33703 +CONFIG_FSL_SOC=y
33704 +CONFIG_PCI=y
33705 +CONFIG_PCI_DOMAINS=y
33706 +CONFIG_PCI_SYSCALL=y
33707 +# CONFIG_PCIEPORTBUS is not set
33708 +CONFIG_ARCH_SUPPORTS_MSI=y
33709 +# CONFIG_PCI_MSI is not set
33710 +CONFIG_PCI_LEGACY=y
33711 +# CONFIG_PCCARD is not set
33712 +# CONFIG_HOTPLUG_PCI is not set
33713 +
33714 +#
33715 +# Advanced setup
33716 +#
33717 +# CONFIG_ADVANCED_OPTIONS is not set
33718 +
33719 +#
33720 +# Default settings for advanced configuration options are used
33721 +#
33722 +CONFIG_HIGHMEM_START=0xfe000000
33723 +CONFIG_LOWMEM_SIZE=0x30000000
33724 +CONFIG_KERNEL_START=0xc0000000
33725 +CONFIG_TASK_SIZE=0xc0000000
33726 +CONFIG_BOOT_LOAD=0x00800000
33727 +
33728 +#
33729 +# Networking
33730 +#
33731 +CONFIG_NET=y
33732 +
33733 +#
33734 +# Networking options
33735 +#
33736 +CONFIG_PACKET=m
33737 +# CONFIG_PACKET_MMAP is not set
33738 +CONFIG_UNIX=y
33739 +# CONFIG_NET_KEY is not set
33740 +CONFIG_INET=y
33741 +CONFIG_IP_MULTICAST=y
33742 +# CONFIG_IP_ADVANCED_ROUTER is not set
33743 +CONFIG_IP_FIB_HASH=y
33744 +CONFIG_IP_PNP=y
33745 +CONFIG_IP_PNP_DHCP=y
33746 +# CONFIG_IP_PNP_BOOTP is not set
33747 +# CONFIG_IP_PNP_RARP is not set
33748 +# CONFIG_NET_IPIP is not set
33749 +# CONFIG_NET_IPGRE is not set
33750 +# CONFIG_IP_MROUTE is not set
33751 +# CONFIG_ARPD is not set
33752 +# CONFIG_SYN_COOKIES is not set
33753 +# CONFIG_INET_AH is not set
33754 +# CONFIG_INET_ESP is not set
33755 +# CONFIG_INET_IPCOMP is not set
33756 +# CONFIG_INET_XFRM_TUNNEL is not set
33757 +# CONFIG_INET_TUNNEL is not set
33758 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
33759 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
33760 +# CONFIG_INET_XFRM_MODE_BEET is not set
33761 +# CONFIG_INET_LRO is not set
33762 +CONFIG_INET_DIAG=y
33763 +CONFIG_INET_TCP_DIAG=y
33764 +# CONFIG_TCP_CONG_ADVANCED is not set
33765 +CONFIG_TCP_CONG_CUBIC=y
33766 +CONFIG_DEFAULT_TCP_CONG="cubic"
33767 +# CONFIG_TCP_MD5SIG is not set
33768 +# CONFIG_IPV6 is not set
33769 +# CONFIG_INET6_XFRM_TUNNEL is not set
33770 +# CONFIG_INET6_TUNNEL is not set
33771 +# CONFIG_NETWORK_SECMARK is not set
33772 +# CONFIG_NETFILTER is not set
33773 +# CONFIG_IP_DCCP is not set
33774 +# CONFIG_IP_SCTP is not set
33775 +# CONFIG_TIPC is not set
33776 +# CONFIG_ATM is not set
33777 +# CONFIG_BRIDGE is not set
33778 +# CONFIG_VLAN_8021Q is not set
33779 +# CONFIG_DECNET is not set
33780 +# CONFIG_LLC2 is not set
33781 +# CONFIG_IPX is not set
33782 +# CONFIG_ATALK is not set
33783 +# CONFIG_X25 is not set
33784 +# CONFIG_LAPB is not set
33785 +# CONFIG_ECONET is not set
33786 +# CONFIG_WAN_ROUTER is not set
33787 +# CONFIG_NET_SCHED is not set
33788 +
33789 +#
33790 +# Network testing
33791 +#
33792 +# CONFIG_NET_PKTGEN is not set
33793 +# CONFIG_HAMRADIO is not set
33794 +# CONFIG_IRDA is not set
33795 +# CONFIG_BT is not set
33796 +# CONFIG_AF_RXRPC is not set
33797 +
33798 +#
33799 +# Wireless
33800 +#
33801 +# CONFIG_CFG80211 is not set
33802 +# CONFIG_WIRELESS_EXT is not set
33803 +# CONFIG_MAC80211 is not set
33804 +# CONFIG_IEEE80211 is not set
33805 +# CONFIG_RFKILL is not set
33806 +# CONFIG_NET_9P is not set
33807 +
33808 +#
33809 +# Device Drivers
33810 +#
33811 +
33812 +#
33813 +# Generic Driver Options
33814 +#
33815 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
33816 +CONFIG_STANDALONE=y
33817 +CONFIG_PREVENT_FIRMWARE_BUILD=y
33818 +# CONFIG_FW_LOADER is not set
33819 +# CONFIG_SYS_HYPERVISOR is not set
33820 +# CONFIG_CONNECTOR is not set
33821 +CONFIG_MTD=y
33822 +# CONFIG_MTD_DEBUG is not set
33823 +# CONFIG_MTD_CONCAT is not set
33824 +CONFIG_MTD_PARTITIONS=y
33825 +# CONFIG_MTD_REDBOOT_PARTS is not set
33826 +# CONFIG_MTD_CMDLINE_PARTS is not set
33827 +
33828 +#
33829 +# User Modules And Translation Layers
33830 +#
33831 +CONFIG_MTD_CHAR=y
33832 +CONFIG_MTD_BLKDEVS=y
33833 +CONFIG_MTD_BLOCK=y
33834 +CONFIG_FTL=y
33835 +CONFIG_NFTL=y
33836 +CONFIG_NFTL_RW=y
33837 +# CONFIG_INFTL is not set
33838 +# CONFIG_RFD_FTL is not set
33839 +# CONFIG_SSFDC is not set
33840 +# CONFIG_MTD_OOPS is not set
33841 +
33842 +#
33843 +# RAM/ROM/Flash chip drivers
33844 +#
33845 +CONFIG_MTD_CFI=y
33846 +# CONFIG_MTD_JEDECPROBE is not set
33847 +CONFIG_MTD_GEN_PROBE=y
33848 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
33849 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
33850 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
33851 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
33852 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
33853 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
33854 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
33855 +CONFIG_MTD_CFI_I1=y
33856 +CONFIG_MTD_CFI_I2=y
33857 +# CONFIG_MTD_CFI_I4 is not set
33858 +# CONFIG_MTD_CFI_I8 is not set
33859 +# CONFIG_MTD_CFI_INTELEXT is not set
33860 +CONFIG_MTD_CFI_AMDSTD=y
33861 +# CONFIG_MTD_CFI_STAA is not set
33862 +CONFIG_MTD_CFI_UTIL=y
33863 +# CONFIG_MTD_RAM is not set
33864 +# CONFIG_MTD_ROM is not set
33865 +# CONFIG_MTD_ABSENT is not set
33866 +
33867 +#
33868 +# Mapping drivers for chip access
33869 +#
33870 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
33871 +CONFIG_MTD_PHYSMAP=y
33872 +CONFIG_MTD_PHYSMAP_START=0xFF800000
33873 +CONFIG_MTD_PHYSMAP_LEN=0x00800000
33874 +CONFIG_MTD_PHYSMAP_BANKWIDTH=1
33875 +# CONFIG_MTD_PHYSMAP_OF is not set
33876 +# CONFIG_MTD_INTEL_VR_NOR is not set
33877 +# CONFIG_MTD_PLATRAM is not set
33878 +
33879 +#
33880 +# Self-contained MTD device drivers
33881 +#
33882 +# CONFIG_MTD_PMC551 is not set
33883 +# CONFIG_MTD_SLRAM is not set
33884 +# CONFIG_MTD_PHRAM is not set
33885 +# CONFIG_MTD_MTDRAM is not set
33886 +# CONFIG_MTD_BLOCK2MTD is not set
33887 +
33888 +#
33889 +# Disk-On-Chip Device Drivers
33890 +#
33891 +# CONFIG_MTD_DOC2000 is not set
33892 +# CONFIG_MTD_DOC2001 is not set
33893 +# CONFIG_MTD_DOC2001PLUS is not set
33894 +# CONFIG_MTD_NAND is not set
33895 +# CONFIG_MTD_ONENAND is not set
33896 +
33897 +#
33898 +# UBI - Unsorted block images
33899 +#
33900 +# CONFIG_MTD_UBI is not set
33901 +CONFIG_OF_DEVICE=y
33902 +# CONFIG_PARPORT is not set
33903 +CONFIG_BLK_DEV=y
33904 +# CONFIG_BLK_DEV_FD is not set
33905 +# CONFIG_BLK_CPQ_DA is not set
33906 +# CONFIG_BLK_CPQ_CISS_DA is not set
33907 +# CONFIG_BLK_DEV_DAC960 is not set
33908 +# CONFIG_BLK_DEV_UMEM is not set
33909 +# CONFIG_BLK_DEV_COW_COMMON is not set
33910 +# CONFIG_BLK_DEV_LOOP is not set
33911 +# CONFIG_BLK_DEV_NBD is not set
33912 +# CONFIG_BLK_DEV_SX8 is not set
33913 +# CONFIG_BLK_DEV_UB is not set
33914 +# CONFIG_BLK_DEV_RAM is not set
33915 +# CONFIG_CDROM_PKTCDVD is not set
33916 +# CONFIG_ATA_OVER_ETH is not set
33917 +CONFIG_MISC_DEVICES=y
33918 +# CONFIG_PHANTOM is not set
33919 +# CONFIG_EEPROM_93CX6 is not set
33920 +# CONFIG_SGI_IOC4 is not set
33921 +# CONFIG_TIFM_CORE is not set
33922 +CONFIG_IDE=y
33923 +CONFIG_IDE_MAX_HWIFS=4
33924 +CONFIG_BLK_DEV_IDE=y
33925 +
33926 +#
33927 +# Please see Documentation/ide.txt for help/info on IDE drives
33928 +#
33929 +# CONFIG_BLK_DEV_IDE_SATA is not set
33930 +CONFIG_BLK_DEV_IDEDISK=y
33931 +CONFIG_IDEDISK_MULTI_MODE=y
33932 +# CONFIG_BLK_DEV_IDECD is not set
33933 +# CONFIG_BLK_DEV_IDETAPE is not set
33934 +# CONFIG_BLK_DEV_IDEFLOPPY is not set
33935 +# CONFIG_BLK_DEV_IDESCSI is not set
33936 +# CONFIG_IDE_TASK_IOCTL is not set
33937 +CONFIG_IDE_PROC_FS=y
33938 +
33939 +#
33940 +# IDE chipset support/bugfixes
33941 +#
33942 +CONFIG_IDE_GENERIC=y
33943 +# CONFIG_BLK_DEV_PLATFORM is not set
33944 +
33945 +#
33946 +# PCI IDE chipsets support
33947 +#
33948 +CONFIG_BLK_DEV_IDEPCI=y
33949 +# CONFIG_IDEPCI_SHARE_IRQ is not set
33950 +CONFIG_IDEPCI_PCIBUS_ORDER=y
33951 +# CONFIG_BLK_DEV_GENERIC is not set
33952 +# CONFIG_BLK_DEV_OPTI621 is not set
33953 +CONFIG_BLK_DEV_IDEDMA_PCI=y
33954 +# CONFIG_BLK_DEV_AEC62XX is not set
33955 +# CONFIG_BLK_DEV_ALI15X3 is not set
33956 +# CONFIG_BLK_DEV_AMD74XX is not set
33957 +# CONFIG_BLK_DEV_CMD64X is not set
33958 +# CONFIG_BLK_DEV_TRIFLEX is not set
33959 +# CONFIG_BLK_DEV_CY82C693 is not set
33960 +# CONFIG_BLK_DEV_CS5520 is not set
33961 +# CONFIG_BLK_DEV_CS5530 is not set
33962 +# CONFIG_BLK_DEV_HPT34X is not set
33963 +# CONFIG_BLK_DEV_HPT366 is not set
33964 +# CONFIG_BLK_DEV_JMICRON is not set
33965 +# CONFIG_BLK_DEV_SC1200 is not set
33966 +# CONFIG_BLK_DEV_PIIX is not set
33967 +# CONFIG_BLK_DEV_IT8213 is not set
33968 +# CONFIG_BLK_DEV_IT821X is not set
33969 +# CONFIG_BLK_DEV_NS87415 is not set
33970 +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
33971 +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
33972 +# CONFIG_BLK_DEV_SVWKS is not set
33973 +# CONFIG_BLK_DEV_SIIMAGE is not set
33974 +# CONFIG_BLK_DEV_SL82C105 is not set
33975 +# CONFIG_BLK_DEV_SLC90E66 is not set
33976 +# CONFIG_BLK_DEV_TRM290 is not set
33977 +CONFIG_BLK_DEV_VIA82CXXX=y
33978 +# CONFIG_BLK_DEV_TC86C001 is not set
33979 +# CONFIG_IDE_ARM is not set
33980 +CONFIG_BLK_DEV_IDEDMA=y
33981 +CONFIG_IDE_ARCH_OBSOLETE_INIT=y
33982 +# CONFIG_BLK_DEV_HD is not set
33983 +
33984 +#
33985 +# SCSI device support
33986 +#
33987 +# CONFIG_RAID_ATTRS is not set
33988 +CONFIG_SCSI=y
33989 +CONFIG_SCSI_DMA=y
33990 +# CONFIG_SCSI_TGT is not set
33991 +# CONFIG_SCSI_NETLINK is not set
33992 +CONFIG_SCSI_PROC_FS=y
33993 +
33994 +#
33995 +# SCSI support type (disk, tape, CD-ROM)
33996 +#
33997 +CONFIG_BLK_DEV_SD=y
33998 +# CONFIG_CHR_DEV_ST is not set
33999 +# CONFIG_CHR_DEV_OSST is not set
34000 +CONFIG_BLK_DEV_SR=y
34001 +# CONFIG_BLK_DEV_SR_VENDOR is not set
34002 +# CONFIG_CHR_DEV_SG is not set
34003 +# CONFIG_CHR_DEV_SCH is not set
34004 +
34005 +#
34006 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
34007 +#
34008 +# CONFIG_SCSI_MULTI_LUN is not set
34009 +# CONFIG_SCSI_CONSTANTS is not set
34010 +# CONFIG_SCSI_LOGGING is not set
34011 +# CONFIG_SCSI_SCAN_ASYNC is not set
34012 +CONFIG_SCSI_WAIT_SCAN=m
34013 +
34014 +#
34015 +# SCSI Transports
34016 +#
34017 +CONFIG_SCSI_SPI_ATTRS=y
34018 +# CONFIG_SCSI_FC_ATTRS is not set
34019 +# CONFIG_SCSI_ISCSI_ATTRS is not set
34020 +# CONFIG_SCSI_SAS_LIBSAS is not set
34021 +# CONFIG_SCSI_SRP_ATTRS is not set
34022 +CONFIG_SCSI_LOWLEVEL=y
34023 +# CONFIG_ISCSI_TCP is not set
34024 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
34025 +# CONFIG_SCSI_3W_9XXX is not set
34026 +# CONFIG_SCSI_ACARD is not set
34027 +# CONFIG_SCSI_AACRAID is not set
34028 +# CONFIG_SCSI_AIC7XXX is not set
34029 +# CONFIG_SCSI_AIC7XXX_OLD is not set
34030 +# CONFIG_SCSI_AIC79XX is not set
34031 +# CONFIG_SCSI_AIC94XX is not set
34032 +# CONFIG_SCSI_DPT_I2O is not set
34033 +# CONFIG_SCSI_ADVANSYS is not set
34034 +# CONFIG_SCSI_ARCMSR is not set
34035 +# CONFIG_MEGARAID_NEWGEN is not set
34036 +# CONFIG_MEGARAID_LEGACY is not set
34037 +# CONFIG_MEGARAID_SAS is not set
34038 +# CONFIG_SCSI_HPTIOP is not set
34039 +# CONFIG_SCSI_BUSLOGIC is not set
34040 +# CONFIG_SCSI_DMX3191D is not set
34041 +# CONFIG_SCSI_EATA is not set
34042 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
34043 +# CONFIG_SCSI_GDTH is not set
34044 +# CONFIG_SCSI_IPS is not set
34045 +# CONFIG_SCSI_INITIO is not set
34046 +# CONFIG_SCSI_INIA100 is not set
34047 +# CONFIG_SCSI_STEX is not set
34048 +# CONFIG_SCSI_SYM53C8XX_2 is not set
34049 +# CONFIG_SCSI_QLOGIC_1280 is not set
34050 +# CONFIG_SCSI_QLA_FC is not set
34051 +# CONFIG_SCSI_QLA_ISCSI is not set
34052 +# CONFIG_SCSI_LPFC is not set
34053 +# CONFIG_SCSI_DC395x is not set
34054 +# CONFIG_SCSI_DC390T is not set
34055 +# CONFIG_SCSI_NSP32 is not set
34056 +# CONFIG_SCSI_DEBUG is not set
34057 +# CONFIG_SCSI_SRP is not set
34058 +# CONFIG_ATA is not set
34059 +CONFIG_MD=y
34060 +CONFIG_BLK_DEV_MD=y
34061 +CONFIG_MD_LINEAR=y
34062 +CONFIG_MD_RAID0=y
34063 +CONFIG_MD_RAID1=y
34064 +# CONFIG_MD_RAID10 is not set
34065 +CONFIG_MD_RAID456=y
34066 +CONFIG_MD_RAID5_RESHAPE=y
34067 +# CONFIG_MD_MULTIPATH is not set
34068 +# CONFIG_MD_FAULTY is not set
34069 +# CONFIG_BLK_DEV_DM is not set
34070 +# CONFIG_FUSION is not set
34071 +
34072 +#
34073 +# IEEE 1394 (FireWire) support
34074 +#
34075 +# CONFIG_FIREWIRE is not set
34076 +# CONFIG_IEEE1394 is not set
34077 +# CONFIG_I2O is not set
34078 +# CONFIG_MACINTOSH_DRIVERS is not set
34079 +CONFIG_NETDEVICES=y
34080 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
34081 +CONFIG_DUMMY=m
34082 +# CONFIG_BONDING is not set
34083 +# CONFIG_MACVLAN is not set
34084 +# CONFIG_EQUALIZER is not set
34085 +# CONFIG_TUN is not set
34086 +# CONFIG_VETH is not set
34087 +# CONFIG_IP1000 is not set
34088 +# CONFIG_ARCNET is not set
34089 +# CONFIG_NET_ETHERNET is not set
34090 +CONFIG_NETDEV_1000=y
34091 +# CONFIG_ACENIC is not set
34092 +# CONFIG_DL2K is not set
34093 +# CONFIG_E1000 is not set
34094 +# CONFIG_E1000E is not set
34095 +# CONFIG_NS83820 is not set
34096 +# CONFIG_HAMACHI is not set
34097 +# CONFIG_YELLOWFIN is not set
34098 +CONFIG_R8169=y
34099 +# CONFIG_R8169_NAPI is not set
34100 +# CONFIG_SIS190 is not set
34101 +# CONFIG_SKGE is not set
34102 +# CONFIG_SKY2 is not set
34103 +# CONFIG_SK98LIN is not set
34104 +# CONFIG_VIA_VELOCITY is not set
34105 +# CONFIG_TIGON3 is not set
34106 +# CONFIG_BNX2 is not set
34107 +# CONFIG_MV643XX_ETH is not set
34108 +# CONFIG_QLA3XXX is not set
34109 +# CONFIG_ATL1 is not set
34110 +# CONFIG_NETDEV_10000 is not set
34111 +# CONFIG_TR is not set
34112 +
34113 +#
34114 +# Wireless LAN
34115 +#
34116 +# CONFIG_WLAN_PRE80211 is not set
34117 +# CONFIG_WLAN_80211 is not set
34118 +
34119 +#
34120 +# USB Network Adapters
34121 +#
34122 +# CONFIG_USB_CATC is not set
34123 +# CONFIG_USB_KAWETH is not set
34124 +# CONFIG_USB_PEGASUS is not set
34125 +# CONFIG_USB_RTL8150 is not set
34126 +# CONFIG_USB_USBNET is not set
34127 +# CONFIG_WAN is not set
34128 +# CONFIG_FDDI is not set
34129 +# CONFIG_HIPPI is not set
34130 +# CONFIG_PPP is not set
34131 +# CONFIG_SLIP is not set
34132 +# CONFIG_NET_FC is not set
34133 +# CONFIG_SHAPER is not set
34134 +# CONFIG_NETCONSOLE is not set
34135 +# CONFIG_NETPOLL is not set
34136 +# CONFIG_NET_POLL_CONTROLLER is not set
34137 +# CONFIG_ISDN is not set
34138 +# CONFIG_PHONE is not set
34139 +
34140 +#
34141 +# Input device support
34142 +#
34143 +# CONFIG_INPUT is not set
34144 +
34145 +#
34146 +# Hardware I/O ports
34147 +#
34148 +# CONFIG_SERIO is not set
34149 +# CONFIG_GAMEPORT is not set
34150 +
34151 +#
34152 +# Character devices
34153 +#
34154 +# CONFIG_VT is not set
34155 +# CONFIG_SERIAL_NONSTANDARD is not set
34156 +
34157 +#
34158 +# Serial drivers
34159 +#
34160 +CONFIG_SERIAL_8250=y
34161 +CONFIG_SERIAL_8250_CONSOLE=y
34162 +# CONFIG_SERIAL_8250_PCI is not set
34163 +CONFIG_SERIAL_8250_NR_UARTS=2
34164 +CONFIG_SERIAL_8250_RUNTIME_UARTS=2
34165 +# CONFIG_SERIAL_8250_EXTENDED is not set
34166 +
34167 +#
34168 +# Non-8250 serial port support
34169 +#
34170 +# CONFIG_SERIAL_UARTLITE is not set
34171 +CONFIG_SERIAL_CORE=y
34172 +CONFIG_SERIAL_CORE_CONSOLE=y
34173 +# CONFIG_SERIAL_JSM is not set
34174 +# CONFIG_SERIAL_OF_PLATFORM is not set
34175 +CONFIG_UNIX98_PTYS=y
34176 +CONFIG_LEGACY_PTYS=y
34177 +CONFIG_LEGACY_PTY_COUNT=256
34178 +# CONFIG_IPMI_HANDLER is not set
34179 +CONFIG_HW_RANDOM=m
34180 +CONFIG_NVRAM=y
34181 +CONFIG_GEN_RTC=y
34182 +# CONFIG_GEN_RTC_X is not set
34183 +# CONFIG_R3964 is not set
34184 +# CONFIG_APPLICOM is not set
34185 +# CONFIG_RAW_DRIVER is not set
34186 +# CONFIG_TCG_TPM is not set
34187 +CONFIG_DEVPORT=y
34188 +CONFIG_I2C=y
34189 +CONFIG_I2C_BOARDINFO=y
34190 +CONFIG_I2C_CHARDEV=y
34191 +
34192 +#
34193 +# I2C Algorithms
34194 +#
34195 +# CONFIG_I2C_ALGOBIT is not set
34196 +# CONFIG_I2C_ALGOPCF is not set
34197 +# CONFIG_I2C_ALGOPCA is not set
34198 +
34199 +#
34200 +# I2C Hardware Bus support
34201 +#
34202 +# CONFIG_I2C_ALI1535 is not set
34203 +# CONFIG_I2C_ALI1563 is not set
34204 +# CONFIG_I2C_ALI15X3 is not set
34205 +# CONFIG_I2C_AMD756 is not set
34206 +# CONFIG_I2C_AMD8111 is not set
34207 +# CONFIG_I2C_I801 is not set
34208 +# CONFIG_I2C_I810 is not set
34209 +# CONFIG_I2C_PIIX4 is not set
34210 +CONFIG_I2C_MPC=y
34211 +# CONFIG_I2C_NFORCE2 is not set
34212 +# CONFIG_I2C_OCORES is not set
34213 +# CONFIG_I2C_PARPORT_LIGHT is not set
34214 +# CONFIG_I2C_PROSAVAGE is not set
34215 +# CONFIG_I2C_SAVAGE4 is not set
34216 +# CONFIG_I2C_SIMTEC is not set
34217 +# CONFIG_I2C_SIS5595 is not set
34218 +# CONFIG_I2C_SIS630 is not set
34219 +# CONFIG_I2C_SIS96X is not set
34220 +# CONFIG_I2C_TAOS_EVM is not set
34221 +# CONFIG_I2C_STUB is not set
34222 +# CONFIG_I2C_TINY_USB is not set
34223 +# CONFIG_I2C_VIA is not set
34224 +# CONFIG_I2C_VIAPRO is not set
34225 +# CONFIG_I2C_VOODOO3 is not set
34226 +
34227 +#
34228 +# Miscellaneous I2C Chip support
34229 +#
34230 +# CONFIG_SENSORS_DS1337 is not set
34231 +# CONFIG_SENSORS_DS1374 is not set
34232 +# CONFIG_DS1682 is not set
34233 +# CONFIG_SENSORS_EEPROM is not set
34234 +# CONFIG_SENSORS_PCF8574 is not set
34235 +# CONFIG_SENSORS_PCA9539 is not set
34236 +# CONFIG_SENSORS_PCF8591 is not set
34237 +# CONFIG_SENSORS_M41T00 is not set
34238 +# CONFIG_SENSORS_MAX6875 is not set
34239 +# CONFIG_SENSORS_TSL2550 is not set
34240 +# CONFIG_I2C_DEBUG_CORE is not set
34241 +# CONFIG_I2C_DEBUG_ALGO is not set
34242 +# CONFIG_I2C_DEBUG_BUS is not set
34243 +# CONFIG_I2C_DEBUG_CHIP is not set
34244 +
34245 +#
34246 +# SPI support
34247 +#
34248 +# CONFIG_SPI is not set
34249 +# CONFIG_SPI_MASTER is not set
34250 +# CONFIG_W1 is not set
34251 +# CONFIG_POWER_SUPPLY is not set
34252 +# CONFIG_HWMON is not set
34253 +# CONFIG_WATCHDOG is not set
34254 +
34255 +#
34256 +# Sonics Silicon Backplane
34257 +#
34258 +CONFIG_SSB_POSSIBLE=y
34259 +# CONFIG_SSB is not set
34260 +
34261 +#
34262 +# Multifunction device drivers
34263 +#
34264 +# CONFIG_MFD_SM501 is not set
34265 +
34266 +#
34267 +# Multimedia devices
34268 +#
34269 +# CONFIG_VIDEO_DEV is not set
34270 +# CONFIG_DVB_CORE is not set
34271 +# CONFIG_DAB is not set
34272 +
34273 +#
34274 +# Graphics support
34275 +#
34276 +# CONFIG_AGP is not set
34277 +# CONFIG_DRM is not set
34278 +# CONFIG_VGASTATE is not set
34279 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
34280 +# CONFIG_FB is not set
34281 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
34282 +
34283 +#
34284 +# Display device support
34285 +#
34286 +# CONFIG_DISPLAY_SUPPORT is not set
34287 +
34288 +#
34289 +# Sound
34290 +#
34291 +# CONFIG_SOUND is not set
34292 +CONFIG_USB_SUPPORT=y
34293 +CONFIG_USB_ARCH_HAS_HCD=y
34294 +CONFIG_USB_ARCH_HAS_OHCI=y
34295 +CONFIG_USB_ARCH_HAS_EHCI=y
34296 +CONFIG_USB=y
34297 +# CONFIG_USB_DEBUG is not set
34298 +
34299 +#
34300 +# Miscellaneous USB options
34301 +#
34302 +CONFIG_USB_DEVICEFS=y
34303 +CONFIG_USB_DEVICE_CLASS=y
34304 +# CONFIG_USB_DYNAMIC_MINORS is not set
34305 +# CONFIG_USB_OTG is not set
34306 +
34307 +#
34308 +# USB Host Controller Drivers
34309 +#
34310 +CONFIG_USB_EHCI_HCD=y
34311 +# CONFIG_USB_EHCI_SPLIT_ISO is not set
34312 +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
34313 +# CONFIG_USB_EHCI_TT_NEWSCHED is not set
34314 +# CONFIG_USB_ISP116X_HCD is not set
34315 +CONFIG_USB_OHCI_HCD=y
34316 +# CONFIG_USB_OHCI_HCD_PPC_OF is not set
34317 +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
34318 +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
34319 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
34320 +# CONFIG_USB_UHCI_HCD is not set
34321 +# CONFIG_USB_SL811_HCD is not set
34322 +# CONFIG_USB_R8A66597_HCD is not set
34323 +
34324 +#
34325 +# USB Device Class drivers
34326 +#
34327 +# CONFIG_USB_ACM is not set
34328 +# CONFIG_USB_PRINTER is not set
34329 +
34330 +#
34331 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
34332 +#
34333 +
34334 +#
34335 +# may also be needed; see USB_STORAGE Help for more information
34336 +#
34337 +CONFIG_USB_STORAGE=y
34338 +# CONFIG_USB_STORAGE_DEBUG is not set
34339 +# CONFIG_USB_STORAGE_DATAFAB is not set
34340 +# CONFIG_USB_STORAGE_FREECOM is not set
34341 +# CONFIG_USB_STORAGE_ISD200 is not set
34342 +# CONFIG_USB_STORAGE_DPCM is not set
34343 +# CONFIG_USB_STORAGE_USBAT is not set
34344 +# CONFIG_USB_STORAGE_SDDR09 is not set
34345 +# CONFIG_USB_STORAGE_SDDR55 is not set
34346 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
34347 +# CONFIG_USB_STORAGE_ALAUDA is not set
34348 +# CONFIG_USB_STORAGE_KARMA is not set
34349 +# CONFIG_USB_LIBUSUAL is not set
34350 +
34351 +#
34352 +# USB Imaging devices
34353 +#
34354 +# CONFIG_USB_MDC800 is not set
34355 +# CONFIG_USB_MICROTEK is not set
34356 +# CONFIG_USB_MON is not set
34357 +
34358 +#
34359 +# USB port drivers
34360 +#
34361 +
34362 +#
34363 +# USB Serial Converter support
34364 +#
34365 +# CONFIG_USB_SERIAL is not set
34366 +
34367 +#
34368 +# USB Miscellaneous drivers
34369 +#
34370 +# CONFIG_USB_EMI62 is not set
34371 +# CONFIG_USB_EMI26 is not set
34372 +# CONFIG_USB_ADUTUX is not set
34373 +# CONFIG_USB_AUERSWALD is not set
34374 +# CONFIG_USB_RIO500 is not set
34375 +# CONFIG_USB_LEGOTOWER is not set
34376 +# CONFIG_USB_LCD is not set
34377 +# CONFIG_USB_BERRY_CHARGE is not set
34378 +# CONFIG_USB_LED is not set
34379 +# CONFIG_USB_CYPRESS_CY7C63 is not set
34380 +# CONFIG_USB_CYTHERM is not set
34381 +# CONFIG_USB_PHIDGET is not set
34382 +# CONFIG_USB_IDMOUSE is not set
34383 +# CONFIG_USB_FTDI_ELAN is not set
34384 +# CONFIG_USB_APPLEDISPLAY is not set
34385 +# CONFIG_USB_SISUSBVGA is not set
34386 +# CONFIG_USB_LD is not set
34387 +# CONFIG_USB_TRANCEVIBRATOR is not set
34388 +# CONFIG_USB_IOWARRIOR is not set
34389 +# CONFIG_USB_TEST is not set
34390 +
34391 +#
34392 +# USB DSL modem support
34393 +#
34394 +
34395 +#
34396 +# USB Gadget Support
34397 +#
34398 +# CONFIG_USB_GADGET is not set
34399 +# CONFIG_MMC is not set
34400 +# CONFIG_NEW_LEDS is not set
34401 +# CONFIG_INFINIBAND is not set
34402 +# CONFIG_EDAC is not set
34403 +CONFIG_RTC_LIB=y
34404 +CONFIG_RTC_CLASS=y
34405 +CONFIG_RTC_HCTOSYS=y
34406 +CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
34407 +# CONFIG_RTC_DEBUG is not set
34408 +
34409 +#
34410 +# RTC interfaces
34411 +#
34412 +CONFIG_RTC_INTF_SYSFS=y
34413 +CONFIG_RTC_INTF_PROC=y
34414 +CONFIG_RTC_INTF_DEV=y
34415 +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
34416 +# CONFIG_RTC_DRV_TEST is not set
34417 +
34418 +#
34419 +# I2C RTC drivers
34420 +#
34421 +CONFIG_RTC_DRV_DS1307=y
34422 +# CONFIG_RTC_DRV_DS1374 is not set
34423 +# CONFIG_RTC_DRV_DS1672 is not set
34424 +# CONFIG_RTC_DRV_MAX6900 is not set
34425 +# CONFIG_RTC_DRV_RS5C372 is not set
34426 +# CONFIG_RTC_DRV_ISL1208 is not set
34427 +# CONFIG_RTC_DRV_X1205 is not set
34428 +# CONFIG_RTC_DRV_PCF8563 is not set
34429 +# CONFIG_RTC_DRV_PCF8583 is not set
34430 +# CONFIG_RTC_DRV_M41T80 is not set
34431 +
34432 +#
34433 +# SPI RTC drivers
34434 +#
34435 +
34436 +#
34437 +# Platform RTC drivers
34438 +#
34439 +# CONFIG_RTC_DRV_CMOS is not set
34440 +# CONFIG_RTC_DRV_DS1553 is not set
34441 +# CONFIG_RTC_DRV_STK17TA8 is not set
34442 +# CONFIG_RTC_DRV_DS1742 is not set
34443 +# CONFIG_RTC_DRV_M48T86 is not set
34444 +# CONFIG_RTC_DRV_M48T59 is not set
34445 +# CONFIG_RTC_DRV_V3020 is not set
34446 +
34447 +#
34448 +# on-CPU RTC drivers
34449 +#
34450 +
34451 +#
34452 +# Userspace I/O
34453 +#
34454 +# CONFIG_UIO is not set
34455 +
34456 +#
34457 +# File systems
34458 +#
34459 +CONFIG_EXT2_FS=y
34460 +# CONFIG_EXT2_FS_XATTR is not set
34461 +# CONFIG_EXT2_FS_XIP is not set
34462 +CONFIG_EXT3_FS=y
34463 +CONFIG_EXT3_FS_XATTR=y
34464 +# CONFIG_EXT3_FS_POSIX_ACL is not set
34465 +# CONFIG_EXT3_FS_SECURITY is not set
34466 +# CONFIG_EXT4DEV_FS is not set
34467 +CONFIG_JBD=y
34468 +CONFIG_FS_MBCACHE=y
34469 +# CONFIG_REISERFS_FS is not set
34470 +# CONFIG_JFS_FS is not set
34471 +# CONFIG_FS_POSIX_ACL is not set
34472 +CONFIG_XFS_FS=m
34473 +# CONFIG_XFS_QUOTA is not set
34474 +# CONFIG_XFS_SECURITY is not set
34475 +# CONFIG_XFS_POSIX_ACL is not set
34476 +# CONFIG_XFS_RT is not set
34477 +# CONFIG_GFS2_FS is not set
34478 +# CONFIG_OCFS2_FS is not set
34479 +# CONFIG_MINIX_FS is not set
34480 +# CONFIG_ROMFS_FS is not set
34481 +CONFIG_INOTIFY=y
34482 +CONFIG_INOTIFY_USER=y
34483 +# CONFIG_QUOTA is not set
34484 +CONFIG_DNOTIFY=y
34485 +# CONFIG_AUTOFS_FS is not set
34486 +# CONFIG_AUTOFS4_FS is not set
34487 +# CONFIG_FUSE_FS is not set
34488 +
34489 +#
34490 +# CD-ROM/DVD Filesystems
34491 +#
34492 +# CONFIG_ISO9660_FS is not set
34493 +# CONFIG_UDF_FS is not set
34494 +
34495 +#
34496 +# DOS/FAT/NT Filesystems
34497 +#
34498 +# CONFIG_MSDOS_FS is not set
34499 +# CONFIG_VFAT_FS is not set
34500 +# CONFIG_NTFS_FS is not set
34501 +
34502 +#
34503 +# Pseudo filesystems
34504 +#
34505 +CONFIG_PROC_FS=y
34506 +CONFIG_PROC_KCORE=y
34507 +CONFIG_PROC_SYSCTL=y
34508 +CONFIG_SYSFS=y
34509 +CONFIG_TMPFS=y
34510 +# CONFIG_TMPFS_POSIX_ACL is not set
34511 +# CONFIG_HUGETLB_PAGE is not set
34512 +# CONFIG_CONFIGFS_FS is not set
34513 +
34514 +#
34515 +# Miscellaneous filesystems
34516 +#
34517 +# CONFIG_ADFS_FS is not set
34518 +# CONFIG_AFFS_FS is not set
34519 +# CONFIG_HFS_FS is not set
34520 +# CONFIG_HFSPLUS_FS is not set
34521 +# CONFIG_BEFS_FS is not set
34522 +# CONFIG_BFS_FS is not set
34523 +# CONFIG_EFS_FS is not set
34524 +CONFIG_JFFS2_FS=y
34525 +CONFIG_JFFS2_FS_DEBUG=0
34526 +CONFIG_JFFS2_FS_WRITEBUFFER=y
34527 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
34528 +# CONFIG_JFFS2_SUMMARY is not set
34529 +# CONFIG_JFFS2_FS_XATTR is not set
34530 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
34531 +CONFIG_JFFS2_ZLIB=y
34532 +# CONFIG_JFFS2_LZO is not set
34533 +CONFIG_JFFS2_RTIME=y
34534 +# CONFIG_JFFS2_RUBIN is not set
34535 +# CONFIG_CRAMFS is not set
34536 +# CONFIG_VXFS_FS is not set
34537 +# CONFIG_HPFS_FS is not set
34538 +# CONFIG_QNX4FS_FS is not set
34539 +# CONFIG_SYSV_FS is not set
34540 +# CONFIG_UFS_FS is not set
34541 +# CONFIG_NETWORK_FILESYSTEMS is not set
34542 +
34543 +#
34544 +# Partition Types
34545 +#
34546 +CONFIG_PARTITION_ADVANCED=y
34547 +# CONFIG_ACORN_PARTITION is not set
34548 +# CONFIG_OSF_PARTITION is not set
34549 +# CONFIG_AMIGA_PARTITION is not set
34550 +# CONFIG_ATARI_PARTITION is not set
34551 +# CONFIG_MAC_PARTITION is not set
34552 +CONFIG_MSDOS_PARTITION=y
34553 +# CONFIG_BSD_DISKLABEL is not set
34554 +# CONFIG_MINIX_SUBPARTITION is not set
34555 +# CONFIG_SOLARIS_X86_PARTITION is not set
34556 +# CONFIG_UNIXWARE_DISKLABEL is not set
34557 +# CONFIG_LDM_PARTITION is not set
34558 +# CONFIG_SGI_PARTITION is not set
34559 +# CONFIG_ULTRIX_PARTITION is not set
34560 +# CONFIG_SUN_PARTITION is not set
34561 +# CONFIG_KARMA_PARTITION is not set
34562 +# CONFIG_EFI_PARTITION is not set
34563 +# CONFIG_SYSV68_PARTITION is not set
34564 +CONFIG_NLS=y
34565 +CONFIG_NLS_DEFAULT="utf8"
34566 +CONFIG_NLS_CODEPAGE_437=y
34567 +# CONFIG_NLS_CODEPAGE_737 is not set
34568 +# CONFIG_NLS_CODEPAGE_775 is not set
34569 +# CONFIG_NLS_CODEPAGE_850 is not set
34570 +# CONFIG_NLS_CODEPAGE_852 is not set
34571 +# CONFIG_NLS_CODEPAGE_855 is not set
34572 +# CONFIG_NLS_CODEPAGE_857 is not set
34573 +# CONFIG_NLS_CODEPAGE_860 is not set
34574 +# CONFIG_NLS_CODEPAGE_861 is not set
34575 +# CONFIG_NLS_CODEPAGE_862 is not set
34576 +# CONFIG_NLS_CODEPAGE_863 is not set
34577 +# CONFIG_NLS_CODEPAGE_864 is not set
34578 +# CONFIG_NLS_CODEPAGE_865 is not set
34579 +# CONFIG_NLS_CODEPAGE_866 is not set
34580 +# CONFIG_NLS_CODEPAGE_869 is not set
34581 +# CONFIG_NLS_CODEPAGE_936 is not set
34582 +# CONFIG_NLS_CODEPAGE_950 is not set
34583 +# CONFIG_NLS_CODEPAGE_932 is not set
34584 +# CONFIG_NLS_CODEPAGE_949 is not set
34585 +# CONFIG_NLS_CODEPAGE_874 is not set
34586 +# CONFIG_NLS_ISO8859_8 is not set
34587 +# CONFIG_NLS_CODEPAGE_1250 is not set
34588 +# CONFIG_NLS_CODEPAGE_1251 is not set
34589 +# CONFIG_NLS_ASCII is not set
34590 +CONFIG_NLS_ISO8859_1=y
34591 +# CONFIG_NLS_ISO8859_2 is not set
34592 +# CONFIG_NLS_ISO8859_3 is not set
34593 +# CONFIG_NLS_ISO8859_4 is not set
34594 +# CONFIG_NLS_ISO8859_5 is not set
34595 +# CONFIG_NLS_ISO8859_6 is not set
34596 +# CONFIG_NLS_ISO8859_7 is not set
34597 +# CONFIG_NLS_ISO8859_9 is not set
34598 +# CONFIG_NLS_ISO8859_13 is not set
34599 +# CONFIG_NLS_ISO8859_14 is not set
34600 +# CONFIG_NLS_ISO8859_15 is not set
34601 +# CONFIG_NLS_KOI8_R is not set
34602 +# CONFIG_NLS_KOI8_U is not set
34603 +CONFIG_NLS_UTF8=y
34604 +# CONFIG_DLM is not set
34605 +# CONFIG_UCC_SLOW is not set
34606 +
34607 +#
34608 +# Library routines
34609 +#
34610 +CONFIG_BITREVERSE=y
34611 +# CONFIG_CRC_CCITT is not set
34612 +# CONFIG_CRC16 is not set
34613 +# CONFIG_CRC_ITU_T is not set
34614 +CONFIG_CRC32=y
34615 +# CONFIG_CRC7 is not set
34616 +# CONFIG_LIBCRC32C is not set
34617 +CONFIG_ZLIB_INFLATE=y
34618 +CONFIG_ZLIB_DEFLATE=y
34619 +CONFIG_PLIST=y
34620 +CONFIG_HAS_IOMEM=y
34621 +CONFIG_HAS_IOPORT=y
34622 +CONFIG_HAS_DMA=y
34623 +CONFIG_INSTRUMENTATION=y
34624 +# CONFIG_PROFILING is not set
34625 +# CONFIG_MARKERS is not set
34626 +
34627 +#
34628 +# Kernel hacking
34629 +#
34630 +# CONFIG_PRINTK_TIME is not set
34631 +# CONFIG_ENABLE_WARN_DEPRECATED is not set
34632 +# CONFIG_ENABLE_MUST_CHECK is not set
34633 +# CONFIG_MAGIC_SYSRQ is not set
34634 +# CONFIG_UNUSED_SYMBOLS is not set
34635 +# CONFIG_DEBUG_FS is not set
34636 +# CONFIG_HEADERS_CHECK is not set
34637 +# CONFIG_DEBUG_KERNEL is not set
34638 +# CONFIG_SLUB_DEBUG_ON is not set
34639 +# CONFIG_DEBUG_BUGVERBOSE is not set
34640 +# CONFIG_SAMPLES is not set
34641 +# CONFIG_BOOTX_TEXT is not set
34642 +# CONFIG_PPC_EARLY_DEBUG is not set
34643 +
34644 +#
34645 +# Security options
34646 +#
34647 +# CONFIG_KEYS is not set
34648 +# CONFIG_SECURITY is not set
34649 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
34650 +CONFIG_XOR_BLOCKS=y
34651 +CONFIG_ASYNC_CORE=y
34652 +CONFIG_ASYNC_MEMCPY=y
34653 +CONFIG_ASYNC_XOR=y
34654 +# CONFIG_CRYPTO is not set
34655 +# CONFIG_PPC_CLOCK is not set
34656 Index: linux-2.6.24.7/arch/powerpc/configs/taishan_defconfig
34657 ===================================================================
34658 --- /dev/null
34659 +++ linux-2.6.24.7/arch/powerpc/configs/taishan_defconfig
34660 @@ -0,0 +1,790 @@
34661 +#
34662 +# Automatically generated make config: don't edit
34663 +# Linux kernel version: 2.6.24-rc6
34664 +# Mon Dec 24 11:23:39 2007
34665 +#
34666 +# CONFIG_PPC64 is not set
34667 +
34668 +#
34669 +# Processor support
34670 +#
34671 +# CONFIG_6xx is not set
34672 +# CONFIG_PPC_85xx is not set
34673 +# CONFIG_PPC_8xx is not set
34674 +# CONFIG_40x is not set
34675 +CONFIG_44x=y
34676 +# CONFIG_E200 is not set
34677 +CONFIG_4xx=y
34678 +CONFIG_BOOKE=y
34679 +CONFIG_PTE_64BIT=y
34680 +CONFIG_PHYS_64BIT=y
34681 +# CONFIG_PPC_MM_SLICES is not set
34682 +CONFIG_NOT_COHERENT_CACHE=y
34683 +CONFIG_PPC32=y
34684 +CONFIG_WORD_SIZE=32
34685 +CONFIG_PPC_MERGE=y
34686 +CONFIG_MMU=y
34687 +CONFIG_GENERIC_CMOS_UPDATE=y
34688 +CONFIG_GENERIC_TIME=y
34689 +CONFIG_GENERIC_TIME_VSYSCALL=y
34690 +CONFIG_GENERIC_CLOCKEVENTS=y
34691 +CONFIG_GENERIC_HARDIRQS=y
34692 +CONFIG_IRQ_PER_CPU=y
34693 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
34694 +CONFIG_ARCH_HAS_ILOG2_U32=y
34695 +CONFIG_GENERIC_HWEIGHT=y
34696 +CONFIG_GENERIC_CALIBRATE_DELAY=y
34697 +CONFIG_GENERIC_FIND_NEXT_BIT=y
34698 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
34699 +CONFIG_PPC=y
34700 +CONFIG_EARLY_PRINTK=y
34701 +CONFIG_GENERIC_NVRAM=y
34702 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
34703 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
34704 +CONFIG_PPC_OF=y
34705 +CONFIG_OF=y
34706 +CONFIG_PPC_UDBG_16550=y
34707 +# CONFIG_GENERIC_TBSYNC is not set
34708 +CONFIG_AUDIT_ARCH=y
34709 +CONFIG_GENERIC_BUG=y
34710 +# CONFIG_DEFAULT_UIMAGE is not set
34711 +CONFIG_PPC_DCR_NATIVE=y
34712 +# CONFIG_PPC_DCR_MMIO is not set
34713 +CONFIG_PPC_DCR=y
34714 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
34715 +
34716 +#
34717 +# General setup
34718 +#
34719 +CONFIG_EXPERIMENTAL=y
34720 +CONFIG_BROKEN_ON_SMP=y
34721 +CONFIG_INIT_ENV_ARG_LIMIT=32
34722 +CONFIG_LOCALVERSION=""
34723 +CONFIG_LOCALVERSION_AUTO=y
34724 +CONFIG_SWAP=y
34725 +CONFIG_SYSVIPC=y
34726 +CONFIG_SYSVIPC_SYSCTL=y
34727 +CONFIG_POSIX_MQUEUE=y
34728 +# CONFIG_BSD_PROCESS_ACCT is not set
34729 +# CONFIG_TASKSTATS is not set
34730 +# CONFIG_USER_NS is not set
34731 +# CONFIG_PID_NS is not set
34732 +# CONFIG_AUDIT is not set
34733 +# CONFIG_IKCONFIG is not set
34734 +CONFIG_LOG_BUF_SHIFT=14
34735 +# CONFIG_CGROUPS is not set
34736 +CONFIG_FAIR_GROUP_SCHED=y
34737 +CONFIG_FAIR_USER_SCHED=y
34738 +# CONFIG_FAIR_CGROUP_SCHED is not set
34739 +CONFIG_SYSFS_DEPRECATED=y
34740 +# CONFIG_RELAY is not set
34741 +CONFIG_BLK_DEV_INITRD=y
34742 +CONFIG_INITRAMFS_SOURCE=""
34743 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
34744 +CONFIG_SYSCTL=y
34745 +CONFIG_EMBEDDED=y
34746 +CONFIG_SYSCTL_SYSCALL=y
34747 +CONFIG_KALLSYMS=y
34748 +# CONFIG_KALLSYMS_ALL is not set
34749 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
34750 +CONFIG_HOTPLUG=y
34751 +CONFIG_PRINTK=y
34752 +CONFIG_BUG=y
34753 +CONFIG_ELF_CORE=y
34754 +CONFIG_BASE_FULL=y
34755 +CONFIG_FUTEX=y
34756 +CONFIG_ANON_INODES=y
34757 +CONFIG_EPOLL=y
34758 +CONFIG_SIGNALFD=y
34759 +CONFIG_EVENTFD=y
34760 +CONFIG_SHMEM=y
34761 +CONFIG_VM_EVENT_COUNTERS=y
34762 +CONFIG_SLUB_DEBUG=y
34763 +# CONFIG_SLAB is not set
34764 +CONFIG_SLUB=y
34765 +# CONFIG_SLOB is not set
34766 +CONFIG_RT_MUTEXES=y
34767 +# CONFIG_TINY_SHMEM is not set
34768 +CONFIG_BASE_SMALL=0
34769 +CONFIG_MODULES=y
34770 +CONFIG_MODULE_UNLOAD=y
34771 +# CONFIG_MODULE_FORCE_UNLOAD is not set
34772 +# CONFIG_MODVERSIONS is not set
34773 +# CONFIG_MODULE_SRCVERSION_ALL is not set
34774 +CONFIG_KMOD=y
34775 +CONFIG_BLOCK=y
34776 +CONFIG_LBD=y
34777 +# CONFIG_BLK_DEV_IO_TRACE is not set
34778 +# CONFIG_LSF is not set
34779 +# CONFIG_BLK_DEV_BSG is not set
34780 +
34781 +#
34782 +# IO Schedulers
34783 +#
34784 +CONFIG_IOSCHED_NOOP=y
34785 +CONFIG_IOSCHED_AS=y
34786 +CONFIG_IOSCHED_DEADLINE=y
34787 +CONFIG_IOSCHED_CFQ=y
34788 +CONFIG_DEFAULT_AS=y
34789 +# CONFIG_DEFAULT_DEADLINE is not set
34790 +# CONFIG_DEFAULT_CFQ is not set
34791 +# CONFIG_DEFAULT_NOOP is not set
34792 +CONFIG_DEFAULT_IOSCHED="anticipatory"
34793 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
34794 +
34795 +#
34796 +# Platform support
34797 +#
34798 +# CONFIG_PPC_MPC52xx is not set
34799 +# CONFIG_PPC_MPC5200 is not set
34800 +# CONFIG_PPC_CELL is not set
34801 +# CONFIG_PPC_CELL_NATIVE is not set
34802 +# CONFIG_PQ2ADS is not set
34803 +# CONFIG_BAMBOO is not set
34804 +# CONFIG_EBONY is not set
34805 +# CONFIG_SEQUOIA is not set
34806 +CONFIG_TAISHAN=y
34807 +# CONFIG_KATMAI is not set
34808 +# CONFIG_RAINIER is not set
34809 +CONFIG_440GX=y
34810 +# CONFIG_MPIC is not set
34811 +# CONFIG_MPIC_WEIRD is not set
34812 +# CONFIG_PPC_I8259 is not set
34813 +# CONFIG_PPC_RTAS is not set
34814 +# CONFIG_MMIO_NVRAM is not set
34815 +# CONFIG_PPC_MPC106 is not set
34816 +# CONFIG_PPC_970_NAP is not set
34817 +# CONFIG_PPC_INDIRECT_IO is not set
34818 +# CONFIG_GENERIC_IOMAP is not set
34819 +# CONFIG_CPU_FREQ is not set
34820 +# CONFIG_CPM2 is not set
34821 +# CONFIG_FSL_ULI1575 is not set
34822 +
34823 +#
34824 +# Kernel options
34825 +#
34826 +# CONFIG_HIGHMEM is not set
34827 +# CONFIG_TICK_ONESHOT is not set
34828 +# CONFIG_NO_HZ is not set
34829 +# CONFIG_HIGH_RES_TIMERS is not set
34830 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
34831 +# CONFIG_HZ_100 is not set
34832 +CONFIG_HZ_250=y
34833 +# CONFIG_HZ_300 is not set
34834 +# CONFIG_HZ_1000 is not set
34835 +CONFIG_HZ=250
34836 +CONFIG_PREEMPT_NONE=y
34837 +# CONFIG_PREEMPT_VOLUNTARY is not set
34838 +# CONFIG_PREEMPT is not set
34839 +CONFIG_BINFMT_ELF=y
34840 +# CONFIG_BINFMT_MISC is not set
34841 +# CONFIG_MATH_EMULATION is not set
34842 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
34843 +CONFIG_ARCH_FLATMEM_ENABLE=y
34844 +CONFIG_ARCH_POPULATES_NODE_MAP=y
34845 +CONFIG_SELECT_MEMORY_MODEL=y
34846 +CONFIG_FLATMEM_MANUAL=y
34847 +# CONFIG_DISCONTIGMEM_MANUAL is not set
34848 +# CONFIG_SPARSEMEM_MANUAL is not set
34849 +CONFIG_FLATMEM=y
34850 +CONFIG_FLAT_NODE_MEM_MAP=y
34851 +# CONFIG_SPARSEMEM_STATIC is not set
34852 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
34853 +CONFIG_SPLIT_PTLOCK_CPUS=4
34854 +CONFIG_RESOURCES_64BIT=y
34855 +CONFIG_ZONE_DMA_FLAG=1
34856 +CONFIG_BOUNCE=y
34857 +CONFIG_VIRT_TO_BUS=y
34858 +CONFIG_PROC_DEVICETREE=y
34859 +CONFIG_CMDLINE_BOOL=y
34860 +CONFIG_CMDLINE=""
34861 +CONFIG_SECCOMP=y
34862 +CONFIG_WANT_DEVICE_TREE=y
34863 +CONFIG_DEVICE_TREE="taishan.dts"
34864 +CONFIG_ISA_DMA_API=y
34865 +
34866 +#
34867 +# Bus options
34868 +#
34869 +CONFIG_ZONE_DMA=y
34870 +CONFIG_PPC_INDIRECT_PCI=y
34871 +CONFIG_PCI=y
34872 +CONFIG_PCI_DOMAINS=y
34873 +CONFIG_PCI_SYSCALL=y
34874 +# CONFIG_PCIEPORTBUS is not set
34875 +CONFIG_ARCH_SUPPORTS_MSI=y
34876 +# CONFIG_PCI_MSI is not set
34877 +CONFIG_PCI_LEGACY=y
34878 +# CONFIG_PCI_DEBUG is not set
34879 +# CONFIG_PCCARD is not set
34880 +# CONFIG_HOTPLUG_PCI is not set
34881 +
34882 +#
34883 +# Advanced setup
34884 +#
34885 +# CONFIG_ADVANCED_OPTIONS is not set
34886 +
34887 +#
34888 +# Default settings for advanced configuration options are used
34889 +#
34890 +CONFIG_HIGHMEM_START=0xfe000000
34891 +CONFIG_LOWMEM_SIZE=0x30000000
34892 +CONFIG_KERNEL_START=0xc0000000
34893 +CONFIG_TASK_SIZE=0xc0000000
34894 +CONFIG_CONSISTENT_START=0xff100000
34895 +CONFIG_CONSISTENT_SIZE=0x00200000
34896 +CONFIG_BOOT_LOAD=0x01000000
34897 +
34898 +#
34899 +# Networking
34900 +#
34901 +CONFIG_NET=y
34902 +
34903 +#
34904 +# Networking options
34905 +#
34906 +CONFIG_PACKET=y
34907 +# CONFIG_PACKET_MMAP is not set
34908 +CONFIG_UNIX=y
34909 +# CONFIG_NET_KEY is not set
34910 +CONFIG_INET=y
34911 +# CONFIG_IP_MULTICAST is not set
34912 +# CONFIG_IP_ADVANCED_ROUTER is not set
34913 +CONFIG_IP_FIB_HASH=y
34914 +CONFIG_IP_PNP=y
34915 +CONFIG_IP_PNP_DHCP=y
34916 +CONFIG_IP_PNP_BOOTP=y
34917 +# CONFIG_IP_PNP_RARP is not set
34918 +# CONFIG_NET_IPIP is not set
34919 +# CONFIG_NET_IPGRE is not set
34920 +# CONFIG_ARPD is not set
34921 +# CONFIG_SYN_COOKIES is not set
34922 +# CONFIG_INET_AH is not set
34923 +# CONFIG_INET_ESP is not set
34924 +# CONFIG_INET_IPCOMP is not set
34925 +# CONFIG_INET_XFRM_TUNNEL is not set
34926 +# CONFIG_INET_TUNNEL is not set
34927 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
34928 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
34929 +# CONFIG_INET_XFRM_MODE_BEET is not set
34930 +# CONFIG_INET_LRO is not set
34931 +CONFIG_INET_DIAG=y
34932 +CONFIG_INET_TCP_DIAG=y
34933 +# CONFIG_TCP_CONG_ADVANCED is not set
34934 +CONFIG_TCP_CONG_CUBIC=y
34935 +CONFIG_DEFAULT_TCP_CONG="cubic"
34936 +# CONFIG_TCP_MD5SIG is not set
34937 +# CONFIG_IPV6 is not set
34938 +# CONFIG_INET6_XFRM_TUNNEL is not set
34939 +# CONFIG_INET6_TUNNEL is not set
34940 +# CONFIG_NETWORK_SECMARK is not set
34941 +# CONFIG_NETFILTER is not set
34942 +# CONFIG_IP_DCCP is not set
34943 +# CONFIG_IP_SCTP is not set
34944 +# CONFIG_TIPC is not set
34945 +# CONFIG_ATM is not set
34946 +# CONFIG_BRIDGE is not set
34947 +# CONFIG_VLAN_8021Q is not set
34948 +# CONFIG_DECNET is not set
34949 +# CONFIG_LLC2 is not set
34950 +# CONFIG_IPX is not set
34951 +# CONFIG_ATALK is not set
34952 +# CONFIG_X25 is not set
34953 +# CONFIG_LAPB is not set
34954 +# CONFIG_ECONET is not set
34955 +# CONFIG_WAN_ROUTER is not set
34956 +# CONFIG_NET_SCHED is not set
34957 +
34958 +#
34959 +# Network testing
34960 +#
34961 +# CONFIG_NET_PKTGEN is not set
34962 +# CONFIG_HAMRADIO is not set
34963 +# CONFIG_IRDA is not set
34964 +# CONFIG_BT is not set
34965 +# CONFIG_AF_RXRPC is not set
34966 +
34967 +#
34968 +# Wireless
34969 +#
34970 +# CONFIG_CFG80211 is not set
34971 +# CONFIG_WIRELESS_EXT is not set
34972 +# CONFIG_MAC80211 is not set
34973 +# CONFIG_IEEE80211 is not set
34974 +# CONFIG_RFKILL is not set
34975 +# CONFIG_NET_9P is not set
34976 +
34977 +#
34978 +# Device Drivers
34979 +#
34980 +
34981 +#
34982 +# Generic Driver Options
34983 +#
34984 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
34985 +CONFIG_STANDALONE=y
34986 +CONFIG_PREVENT_FIRMWARE_BUILD=y
34987 +CONFIG_FW_LOADER=y
34988 +# CONFIG_DEBUG_DRIVER is not set
34989 +# CONFIG_DEBUG_DEVRES is not set
34990 +# CONFIG_SYS_HYPERVISOR is not set
34991 +CONFIG_CONNECTOR=y
34992 +CONFIG_PROC_EVENTS=y
34993 +# CONFIG_MTD is not set
34994 +CONFIG_OF_DEVICE=y
34995 +# CONFIG_PARPORT is not set
34996 +CONFIG_BLK_DEV=y
34997 +# CONFIG_BLK_DEV_FD is not set
34998 +# CONFIG_BLK_CPQ_DA is not set
34999 +# CONFIG_BLK_CPQ_CISS_DA is not set
35000 +# CONFIG_BLK_DEV_DAC960 is not set
35001 +# CONFIG_BLK_DEV_UMEM is not set
35002 +# CONFIG_BLK_DEV_COW_COMMON is not set
35003 +# CONFIG_BLK_DEV_LOOP is not set
35004 +# CONFIG_BLK_DEV_NBD is not set
35005 +# CONFIG_BLK_DEV_SX8 is not set
35006 +CONFIG_BLK_DEV_RAM=y
35007 +CONFIG_BLK_DEV_RAM_COUNT=16
35008 +CONFIG_BLK_DEV_RAM_SIZE=35000
35009 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
35010 +# CONFIG_CDROM_PKTCDVD is not set
35011 +# CONFIG_ATA_OVER_ETH is not set
35012 +# CONFIG_XILINX_SYSACE is not set
35013 +CONFIG_MISC_DEVICES=y
35014 +# CONFIG_PHANTOM is not set
35015 +# CONFIG_EEPROM_93CX6 is not set
35016 +# CONFIG_SGI_IOC4 is not set
35017 +# CONFIG_TIFM_CORE is not set
35018 +# CONFIG_IDE is not set
35019 +
35020 +#
35021 +# SCSI device support
35022 +#
35023 +# CONFIG_RAID_ATTRS is not set
35024 +# CONFIG_SCSI is not set
35025 +# CONFIG_SCSI_DMA is not set
35026 +# CONFIG_SCSI_NETLINK is not set
35027 +# CONFIG_ATA is not set
35028 +# CONFIG_MD is not set
35029 +# CONFIG_FUSION is not set
35030 +
35031 +#
35032 +# IEEE 1394 (FireWire) support
35033 +#
35034 +# CONFIG_FIREWIRE is not set
35035 +# CONFIG_IEEE1394 is not set
35036 +# CONFIG_I2O is not set
35037 +CONFIG_MACINTOSH_DRIVERS=y
35038 +# CONFIG_MAC_EMUMOUSEBTN is not set
35039 +# CONFIG_WINDFARM is not set
35040 +CONFIG_NETDEVICES=y
35041 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
35042 +# CONFIG_DUMMY is not set
35043 +# CONFIG_BONDING is not set
35044 +# CONFIG_MACVLAN is not set
35045 +# CONFIG_EQUALIZER is not set
35046 +# CONFIG_TUN is not set
35047 +# CONFIG_VETH is not set
35048 +# CONFIG_IP1000 is not set
35049 +# CONFIG_ARCNET is not set
35050 +# CONFIG_PHYLIB is not set
35051 +CONFIG_NET_ETHERNET=y
35052 +# CONFIG_MII is not set
35053 +# CONFIG_HAPPYMEAL is not set
35054 +# CONFIG_SUNGEM is not set
35055 +# CONFIG_CASSINI is not set
35056 +# CONFIG_NET_VENDOR_3COM is not set
35057 +# CONFIG_NET_TULIP is not set
35058 +# CONFIG_HP100 is not set
35059 +CONFIG_IBM_NEW_EMAC=y
35060 +CONFIG_IBM_NEW_EMAC_RXB=128
35061 +CONFIG_IBM_NEW_EMAC_TXB=64
35062 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
35063 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
35064 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
35065 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
35066 +CONFIG_IBM_NEW_EMAC_ZMII=y
35067 +CONFIG_IBM_NEW_EMAC_RGMII=y
35068 +CONFIG_IBM_NEW_EMAC_TAH=y
35069 +CONFIG_IBM_NEW_EMAC_EMAC4=y
35070 +# CONFIG_NET_PCI is not set
35071 +# CONFIG_B44 is not set
35072 +CONFIG_NETDEV_1000=y
35073 +# CONFIG_ACENIC is not set
35074 +# CONFIG_DL2K is not set
35075 +# CONFIG_E1000 is not set
35076 +# CONFIG_E1000E is not set
35077 +# CONFIG_NS83820 is not set
35078 +# CONFIG_HAMACHI is not set
35079 +# CONFIG_YELLOWFIN is not set
35080 +# CONFIG_R8169 is not set
35081 +# CONFIG_SIS190 is not set
35082 +# CONFIG_SKGE is not set
35083 +# CONFIG_SKY2 is not set
35084 +# CONFIG_SK98LIN is not set
35085 +# CONFIG_VIA_VELOCITY is not set
35086 +# CONFIG_TIGON3 is not set
35087 +# CONFIG_BNX2 is not set
35088 +# CONFIG_QLA3XXX is not set
35089 +# CONFIG_ATL1 is not set
35090 +CONFIG_NETDEV_10000=y
35091 +# CONFIG_CHELSIO_T1 is not set
35092 +# CONFIG_CHELSIO_T3 is not set
35093 +# CONFIG_IXGBE is not set
35094 +# CONFIG_IXGB is not set
35095 +# CONFIG_S2IO is not set
35096 +# CONFIG_MYRI10GE is not set
35097 +# CONFIG_NETXEN_NIC is not set
35098 +# CONFIG_NIU is not set
35099 +# CONFIG_MLX4_CORE is not set
35100 +# CONFIG_TEHUTI is not set
35101 +# CONFIG_TR is not set
35102 +
35103 +#
35104 +# Wireless LAN
35105 +#
35106 +# CONFIG_WLAN_PRE80211 is not set
35107 +# CONFIG_WLAN_80211 is not set
35108 +# CONFIG_WAN is not set
35109 +# CONFIG_FDDI is not set
35110 +# CONFIG_HIPPI is not set
35111 +# CONFIG_PPP is not set
35112 +# CONFIG_SLIP is not set
35113 +# CONFIG_SHAPER is not set
35114 +# CONFIG_NETCONSOLE is not set
35115 +# CONFIG_NETPOLL is not set
35116 +# CONFIG_NET_POLL_CONTROLLER is not set
35117 +# CONFIG_ISDN is not set
35118 +# CONFIG_PHONE is not set
35119 +
35120 +#
35121 +# Input device support
35122 +#
35123 +# CONFIG_INPUT is not set
35124 +
35125 +#
35126 +# Hardware I/O ports
35127 +#
35128 +# CONFIG_SERIO is not set
35129 +# CONFIG_GAMEPORT is not set
35130 +
35131 +#
35132 +# Character devices
35133 +#
35134 +# CONFIG_VT is not set
35135 +# CONFIG_SERIAL_NONSTANDARD is not set
35136 +
35137 +#
35138 +# Serial drivers
35139 +#
35140 +CONFIG_SERIAL_8250=y
35141 +CONFIG_SERIAL_8250_CONSOLE=y
35142 +# CONFIG_SERIAL_8250_PCI is not set
35143 +CONFIG_SERIAL_8250_NR_UARTS=4
35144 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
35145 +CONFIG_SERIAL_8250_EXTENDED=y
35146 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
35147 +CONFIG_SERIAL_8250_SHARE_IRQ=y
35148 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
35149 +# CONFIG_SERIAL_8250_RSA is not set
35150 +
35151 +#
35152 +# Non-8250 serial port support
35153 +#
35154 +# CONFIG_SERIAL_UARTLITE is not set
35155 +CONFIG_SERIAL_CORE=y
35156 +CONFIG_SERIAL_CORE_CONSOLE=y
35157 +# CONFIG_SERIAL_JSM is not set
35158 +CONFIG_SERIAL_OF_PLATFORM=y
35159 +CONFIG_UNIX98_PTYS=y
35160 +CONFIG_LEGACY_PTYS=y
35161 +CONFIG_LEGACY_PTY_COUNT=256
35162 +# CONFIG_IPMI_HANDLER is not set
35163 +# CONFIG_HW_RANDOM is not set
35164 +# CONFIG_NVRAM is not set
35165 +# CONFIG_GEN_RTC is not set
35166 +# CONFIG_R3964 is not set
35167 +# CONFIG_APPLICOM is not set
35168 +# CONFIG_RAW_DRIVER is not set
35169 +# CONFIG_TCG_TPM is not set
35170 +CONFIG_DEVPORT=y
35171 +# CONFIG_I2C is not set
35172 +
35173 +#
35174 +# SPI support
35175 +#
35176 +# CONFIG_SPI is not set
35177 +# CONFIG_SPI_MASTER is not set
35178 +# CONFIG_W1 is not set
35179 +# CONFIG_POWER_SUPPLY is not set
35180 +# CONFIG_HWMON is not set
35181 +# CONFIG_WATCHDOG is not set
35182 +
35183 +#
35184 +# Sonics Silicon Backplane
35185 +#
35186 +CONFIG_SSB_POSSIBLE=y
35187 +# CONFIG_SSB is not set
35188 +
35189 +#
35190 +# Multifunction device drivers
35191 +#
35192 +# CONFIG_MFD_SM501 is not set
35193 +
35194 +#
35195 +# Multimedia devices
35196 +#
35197 +# CONFIG_VIDEO_DEV is not set
35198 +# CONFIG_DVB_CORE is not set
35199 +CONFIG_DAB=y
35200 +
35201 +#
35202 +# Graphics support
35203 +#
35204 +# CONFIG_AGP is not set
35205 +# CONFIG_DRM is not set
35206 +# CONFIG_VGASTATE is not set
35207 +CONFIG_VIDEO_OUTPUT_CONTROL=m
35208 +# CONFIG_FB is not set
35209 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
35210 +
35211 +#
35212 +# Display device support
35213 +#
35214 +# CONFIG_DISPLAY_SUPPORT is not set
35215 +
35216 +#
35217 +# Sound
35218 +#
35219 +# CONFIG_SOUND is not set
35220 +CONFIG_USB_SUPPORT=y
35221 +CONFIG_USB_ARCH_HAS_HCD=y
35222 +CONFIG_USB_ARCH_HAS_OHCI=y
35223 +CONFIG_USB_ARCH_HAS_EHCI=y
35224 +# CONFIG_USB is not set
35225 +
35226 +#
35227 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
35228 +#
35229 +
35230 +#
35231 +# USB Gadget Support
35232 +#
35233 +# CONFIG_USB_GADGET is not set
35234 +# CONFIG_MMC is not set
35235 +# CONFIG_NEW_LEDS is not set
35236 +# CONFIG_INFINIBAND is not set
35237 +# CONFIG_EDAC is not set
35238 +# CONFIG_RTC_CLASS is not set
35239 +
35240 +#
35241 +# Userspace I/O
35242 +#
35243 +# CONFIG_UIO is not set
35244 +
35245 +#
35246 +# File systems
35247 +#
35248 +CONFIG_EXT2_FS=y
35249 +# CONFIG_EXT2_FS_XATTR is not set
35250 +# CONFIG_EXT2_FS_XIP is not set
35251 +# CONFIG_EXT3_FS is not set
35252 +# CONFIG_EXT4DEV_FS is not set
35253 +# CONFIG_REISERFS_FS is not set
35254 +# CONFIG_JFS_FS is not set
35255 +# CONFIG_FS_POSIX_ACL is not set
35256 +# CONFIG_XFS_FS is not set
35257 +# CONFIG_GFS2_FS is not set
35258 +# CONFIG_OCFS2_FS is not set
35259 +# CONFIG_MINIX_FS is not set
35260 +# CONFIG_ROMFS_FS is not set
35261 +CONFIG_INOTIFY=y
35262 +CONFIG_INOTIFY_USER=y
35263 +# CONFIG_QUOTA is not set
35264 +CONFIG_DNOTIFY=y
35265 +# CONFIG_AUTOFS_FS is not set
35266 +# CONFIG_AUTOFS4_FS is not set
35267 +# CONFIG_FUSE_FS is not set
35268 +
35269 +#
35270 +# CD-ROM/DVD Filesystems
35271 +#
35272 +# CONFIG_ISO9660_FS is not set
35273 +# CONFIG_UDF_FS is not set
35274 +
35275 +#
35276 +# DOS/FAT/NT Filesystems
35277 +#
35278 +# CONFIG_MSDOS_FS is not set
35279 +# CONFIG_VFAT_FS is not set
35280 +# CONFIG_NTFS_FS is not set
35281 +
35282 +#
35283 +# Pseudo filesystems
35284 +#
35285 +CONFIG_PROC_FS=y
35286 +CONFIG_PROC_KCORE=y
35287 +CONFIG_PROC_SYSCTL=y
35288 +CONFIG_SYSFS=y
35289 +CONFIG_TMPFS=y
35290 +# CONFIG_TMPFS_POSIX_ACL is not set
35291 +# CONFIG_HUGETLB_PAGE is not set
35292 +# CONFIG_CONFIGFS_FS is not set
35293 +
35294 +#
35295 +# Miscellaneous filesystems
35296 +#
35297 +# CONFIG_ADFS_FS is not set
35298 +# CONFIG_AFFS_FS is not set
35299 +# CONFIG_HFS_FS is not set
35300 +# CONFIG_HFSPLUS_FS is not set
35301 +# CONFIG_BEFS_FS is not set
35302 +# CONFIG_BFS_FS is not set
35303 +# CONFIG_EFS_FS is not set
35304 +CONFIG_CRAMFS=y
35305 +# CONFIG_VXFS_FS is not set
35306 +# CONFIG_HPFS_FS is not set
35307 +# CONFIG_QNX4FS_FS is not set
35308 +# CONFIG_SYSV_FS is not set
35309 +# CONFIG_UFS_FS is not set
35310 +CONFIG_NETWORK_FILESYSTEMS=y
35311 +CONFIG_NFS_FS=y
35312 +CONFIG_NFS_V3=y
35313 +# CONFIG_NFS_V3_ACL is not set
35314 +# CONFIG_NFS_V4 is not set
35315 +# CONFIG_NFS_DIRECTIO is not set
35316 +# CONFIG_NFSD is not set
35317 +CONFIG_ROOT_NFS=y
35318 +CONFIG_LOCKD=y
35319 +CONFIG_LOCKD_V4=y
35320 +CONFIG_NFS_COMMON=y
35321 +CONFIG_SUNRPC=y
35322 +# CONFIG_SUNRPC_BIND34 is not set
35323 +# CONFIG_RPCSEC_GSS_KRB5 is not set
35324 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
35325 +# CONFIG_SMB_FS is not set
35326 +# CONFIG_CIFS is not set
35327 +# CONFIG_NCP_FS is not set
35328 +# CONFIG_CODA_FS is not set
35329 +# CONFIG_AFS_FS is not set
35330 +
35331 +#
35332 +# Partition Types
35333 +#
35334 +# CONFIG_PARTITION_ADVANCED is not set
35335 +CONFIG_MSDOS_PARTITION=y
35336 +# CONFIG_NLS is not set
35337 +# CONFIG_DLM is not set
35338 +# CONFIG_UCC_SLOW is not set
35339 +
35340 +#
35341 +# Library routines
35342 +#
35343 +CONFIG_BITREVERSE=y
35344 +# CONFIG_CRC_CCITT is not set
35345 +# CONFIG_CRC16 is not set
35346 +# CONFIG_CRC_ITU_T is not set
35347 +CONFIG_CRC32=y
35348 +# CONFIG_CRC7 is not set
35349 +# CONFIG_LIBCRC32C is not set
35350 +CONFIG_ZLIB_INFLATE=y
35351 +CONFIG_PLIST=y
35352 +CONFIG_HAS_IOMEM=y
35353 +CONFIG_HAS_IOPORT=y
35354 +CONFIG_HAS_DMA=y
35355 +CONFIG_INSTRUMENTATION=y
35356 +# CONFIG_PROFILING is not set
35357 +# CONFIG_KPROBES is not set
35358 +# CONFIG_MARKERS is not set
35359 +
35360 +#
35361 +# Kernel hacking
35362 +#
35363 +# CONFIG_PRINTK_TIME is not set
35364 +CONFIG_ENABLE_WARN_DEPRECATED=y
35365 +CONFIG_ENABLE_MUST_CHECK=y
35366 +CONFIG_MAGIC_SYSRQ=y
35367 +# CONFIG_UNUSED_SYMBOLS is not set
35368 +# CONFIG_DEBUG_FS is not set
35369 +# CONFIG_HEADERS_CHECK is not set
35370 +CONFIG_DEBUG_KERNEL=y
35371 +# CONFIG_DEBUG_SHIRQ is not set
35372 +CONFIG_DETECT_SOFTLOCKUP=y
35373 +CONFIG_SCHED_DEBUG=y
35374 +# CONFIG_SCHEDSTATS is not set
35375 +# CONFIG_TIMER_STATS is not set
35376 +# CONFIG_SLUB_DEBUG_ON is not set
35377 +# CONFIG_DEBUG_RT_MUTEXES is not set
35378 +# CONFIG_RT_MUTEX_TESTER is not set
35379 +# CONFIG_DEBUG_SPINLOCK is not set
35380 +# CONFIG_DEBUG_MUTEXES is not set
35381 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
35382 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
35383 +# CONFIG_DEBUG_KOBJECT is not set
35384 +# CONFIG_DEBUG_BUGVERBOSE is not set
35385 +# CONFIG_DEBUG_INFO is not set
35386 +# CONFIG_DEBUG_VM is not set
35387 +# CONFIG_DEBUG_LIST is not set
35388 +# CONFIG_DEBUG_SG is not set
35389 +CONFIG_FORCED_INLINING=y
35390 +# CONFIG_BOOT_PRINTK_DELAY is not set
35391 +# CONFIG_RCU_TORTURE_TEST is not set
35392 +# CONFIG_FAULT_INJECTION is not set
35393 +# CONFIG_SAMPLES is not set
35394 +# CONFIG_DEBUG_STACKOVERFLOW is not set
35395 +# CONFIG_DEBUG_STACK_USAGE is not set
35396 +# CONFIG_DEBUG_PAGEALLOC is not set
35397 +CONFIG_DEBUGGER=y
35398 +# CONFIG_KGDB is not set
35399 +# CONFIG_XMON is not set
35400 +# CONFIG_BDI_SWITCH is not set
35401 +# CONFIG_PPC_EARLY_DEBUG is not set
35402 +
35403 +#
35404 +# Security options
35405 +#
35406 +# CONFIG_KEYS is not set
35407 +# CONFIG_SECURITY is not set
35408 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
35409 +CONFIG_CRYPTO=y
35410 +CONFIG_CRYPTO_ALGAPI=y
35411 +CONFIG_CRYPTO_BLKCIPHER=y
35412 +CONFIG_CRYPTO_MANAGER=y
35413 +# CONFIG_CRYPTO_HMAC is not set
35414 +# CONFIG_CRYPTO_XCBC is not set
35415 +# CONFIG_CRYPTO_NULL is not set
35416 +# CONFIG_CRYPTO_MD4 is not set
35417 +CONFIG_CRYPTO_MD5=y
35418 +# CONFIG_CRYPTO_SHA1 is not set
35419 +# CONFIG_CRYPTO_SHA256 is not set
35420 +# CONFIG_CRYPTO_SHA512 is not set
35421 +# CONFIG_CRYPTO_WP512 is not set
35422 +# CONFIG_CRYPTO_TGR192 is not set
35423 +# CONFIG_CRYPTO_GF128MUL is not set
35424 +CONFIG_CRYPTO_ECB=y
35425 +CONFIG_CRYPTO_CBC=y
35426 +CONFIG_CRYPTO_PCBC=y
35427 +# CONFIG_CRYPTO_LRW is not set
35428 +# CONFIG_CRYPTO_XTS is not set
35429 +# CONFIG_CRYPTO_CRYPTD is not set
35430 +CONFIG_CRYPTO_DES=y
35431 +# CONFIG_CRYPTO_FCRYPT is not set
35432 +# CONFIG_CRYPTO_BLOWFISH is not set
35433 +# CONFIG_CRYPTO_TWOFISH is not set
35434 +# CONFIG_CRYPTO_SERPENT is not set
35435 +# CONFIG_CRYPTO_AES is not set
35436 +# CONFIG_CRYPTO_CAST5 is not set
35437 +# CONFIG_CRYPTO_CAST6 is not set
35438 +# CONFIG_CRYPTO_TEA is not set
35439 +# CONFIG_CRYPTO_ARC4 is not set
35440 +# CONFIG_CRYPTO_KHAZAD is not set
35441 +# CONFIG_CRYPTO_ANUBIS is not set
35442 +# CONFIG_CRYPTO_SEED is not set
35443 +# CONFIG_CRYPTO_DEFLATE is not set
35444 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
35445 +# CONFIG_CRYPTO_CRC32C is not set
35446 +# CONFIG_CRYPTO_CAMELLIA is not set
35447 +# CONFIG_CRYPTO_TEST is not set
35448 +# CONFIG_CRYPTO_AUTHENC is not set
35449 +CONFIG_CRYPTO_HW=y
35450 +# CONFIG_PPC_CLOCK is not set
35451 Index: linux-2.6.24.7/arch/powerpc/configs/walnut_defconfig
35452 ===================================================================
35453 --- linux-2.6.24.7.orig/arch/powerpc/configs/walnut_defconfig
35454 +++ linux-2.6.24.7/arch/powerpc/configs/walnut_defconfig
35455 @@ -1,7 +1,7 @@
35456  #
35457  # Automatically generated make config: don't edit
35458 -# Linux kernel version: 2.6.24-rc4
35459 -# Thu Dec  6 16:49:33 2007
35460 +# Linux kernel version: 2.6.24-rc6
35461 +# Mon Dec 24 11:23:58 2007
35462  #
35463  # CONFIG_PPC64 is not set
35464  
35465 @@ -40,7 +40,7 @@ CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
35466  CONFIG_ARCH_MAY_HAVE_PC_FDC=y
35467  CONFIG_PPC_OF=y
35468  CONFIG_OF=y
35469 -# CONFIG_PPC_UDBG_16550 is not set
35470 +CONFIG_PPC_UDBG_16550=y
35471  # CONFIG_GENERIC_TBSYNC is not set
35472  CONFIG_AUDIT_ARCH=y
35473  CONFIG_GENERIC_BUG=y
35474 @@ -127,6 +127,7 @@ CONFIG_DEFAULT_AS=y
35475  # CONFIG_DEFAULT_CFQ is not set
35476  # CONFIG_DEFAULT_NOOP is not set
35477  CONFIG_DEFAULT_IOSCHED="anticipatory"
35478 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
35479  
35480  #
35481  # Platform support
35482 @@ -136,7 +137,9 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
35483  # CONFIG_PPC_CELL is not set
35484  # CONFIG_PPC_CELL_NATIVE is not set
35485  # CONFIG_PQ2ADS is not set
35486 +# CONFIG_EP405 is not set
35487  # CONFIG_KILAUEA is not set
35488 +# CONFIG_MAKALU is not set
35489  CONFIG_WALNUT=y
35490  # CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
35491  CONFIG_405GP=y
35492 @@ -204,11 +207,17 @@ CONFIG_ISA_DMA_API=y
35493  # Bus options
35494  #
35495  CONFIG_ZONE_DMA=y
35496 -# CONFIG_PCI is not set
35497 -# CONFIG_PCI_DOMAINS is not set
35498 -# CONFIG_PCI_SYSCALL is not set
35499 -# CONFIG_ARCH_SUPPORTS_MSI is not set
35500 +CONFIG_PPC_INDIRECT_PCI=y
35501 +CONFIG_PCI=y
35502 +CONFIG_PCI_DOMAINS=y
35503 +CONFIG_PCI_SYSCALL=y
35504 +# CONFIG_PCIEPORTBUS is not set
35505 +CONFIG_ARCH_SUPPORTS_MSI=y
35506 +# CONFIG_PCI_MSI is not set
35507 +# CONFIG_PCI_LEGACY is not set
35508 +# CONFIG_PCI_DEBUG is not set
35509  # CONFIG_PCCARD is not set
35510 +# CONFIG_HOTPLUG_PCI is not set
35511  
35512  #
35513  # Advanced setup
35514 @@ -373,11 +382,13 @@ CONFIG_MTD_CFI_UTIL=y
35515  # CONFIG_MTD_COMPLEX_MAPPINGS is not set
35516  # CONFIG_MTD_PHYSMAP is not set
35517  CONFIG_MTD_PHYSMAP_OF=y
35518 +# CONFIG_MTD_INTEL_VR_NOR is not set
35519  # CONFIG_MTD_PLATRAM is not set
35520  
35521  #
35522  # Self-contained MTD device drivers
35523  #
35524 +# CONFIG_MTD_PMC551 is not set
35525  # CONFIG_MTD_SLRAM is not set
35526  # CONFIG_MTD_PHRAM is not set
35527  # CONFIG_MTD_MTDRAM is not set
35528 @@ -400,9 +411,14 @@ CONFIG_OF_DEVICE=y
35529  # CONFIG_PARPORT is not set
35530  CONFIG_BLK_DEV=y
35531  # CONFIG_BLK_DEV_FD is not set
35532 +# CONFIG_BLK_CPQ_DA is not set
35533 +# CONFIG_BLK_CPQ_CISS_DA is not set
35534 +# CONFIG_BLK_DEV_DAC960 is not set
35535 +# CONFIG_BLK_DEV_UMEM is not set
35536  # CONFIG_BLK_DEV_COW_COMMON is not set
35537  # CONFIG_BLK_DEV_LOOP is not set
35538  # CONFIG_BLK_DEV_NBD is not set
35539 +# CONFIG_BLK_DEV_SX8 is not set
35540  CONFIG_BLK_DEV_RAM=y
35541  CONFIG_BLK_DEV_RAM_COUNT=16
35542  CONFIG_BLK_DEV_RAM_SIZE=35000
35543 @@ -411,7 +427,10 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
35544  # CONFIG_ATA_OVER_ETH is not set
35545  # CONFIG_XILINX_SYSACE is not set
35546  CONFIG_MISC_DEVICES=y
35547 +# CONFIG_PHANTOM is not set
35548  # CONFIG_EEPROM_93CX6 is not set
35549 +# CONFIG_SGI_IOC4 is not set
35550 +# CONFIG_TIFM_CORE is not set
35551  # CONFIG_IDE is not set
35552  
35553  #
35554 @@ -423,6 +442,14 @@ CONFIG_MISC_DEVICES=y
35555  # CONFIG_SCSI_NETLINK is not set
35556  # CONFIG_ATA is not set
35557  # CONFIG_MD is not set
35558 +# CONFIG_FUSION is not set
35559 +
35560 +#
35561 +# IEEE 1394 (FireWire) support
35562 +#
35563 +# CONFIG_FIREWIRE is not set
35564 +# CONFIG_IEEE1394 is not set
35565 +# CONFIG_I2O is not set
35566  # CONFIG_MACINTOSH_DRIVERS is not set
35567  CONFIG_NETDEVICES=y
35568  # CONFIG_NETDEVICES_MULTIQUEUE is not set
35569 @@ -432,9 +459,17 @@ CONFIG_NETDEVICES=y
35570  # CONFIG_EQUALIZER is not set
35571  # CONFIG_TUN is not set
35572  # CONFIG_VETH is not set
35573 +# CONFIG_IP1000 is not set
35574 +# CONFIG_ARCNET is not set
35575  # CONFIG_PHYLIB is not set
35576  CONFIG_NET_ETHERNET=y
35577  # CONFIG_MII is not set
35578 +# CONFIG_HAPPYMEAL is not set
35579 +# CONFIG_SUNGEM is not set
35580 +# CONFIG_CASSINI is not set
35581 +# CONFIG_NET_VENDOR_3COM is not set
35582 +# CONFIG_NET_TULIP is not set
35583 +# CONFIG_HP100 is not set
35584  CONFIG_IBM_NEW_EMAC=y
35585  CONFIG_IBM_NEW_EMAC_RXB=128
35586  CONFIG_IBM_NEW_EMAC_TXB=64
35587 @@ -446,9 +481,38 @@ CONFIG_IBM_NEW_EMAC_ZMII=y
35588  # CONFIG_IBM_NEW_EMAC_RGMII is not set
35589  # CONFIG_IBM_NEW_EMAC_TAH is not set
35590  # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
35591 +# CONFIG_NET_PCI is not set
35592  # CONFIG_B44 is not set
35593  CONFIG_NETDEV_1000=y
35594 +# CONFIG_ACENIC is not set
35595 +# CONFIG_DL2K is not set
35596 +# CONFIG_E1000 is not set
35597 +# CONFIG_E1000E is not set
35598 +# CONFIG_NS83820 is not set
35599 +# CONFIG_HAMACHI is not set
35600 +# CONFIG_YELLOWFIN is not set
35601 +# CONFIG_R8169 is not set
35602 +# CONFIG_SIS190 is not set
35603 +# CONFIG_SKGE is not set
35604 +# CONFIG_SKY2 is not set
35605 +# CONFIG_SK98LIN is not set
35606 +# CONFIG_VIA_VELOCITY is not set
35607 +# CONFIG_TIGON3 is not set
35608 +# CONFIG_BNX2 is not set
35609 +# CONFIG_QLA3XXX is not set
35610 +# CONFIG_ATL1 is not set
35611  CONFIG_NETDEV_10000=y
35612 +# CONFIG_CHELSIO_T1 is not set
35613 +# CONFIG_CHELSIO_T3 is not set
35614 +# CONFIG_IXGBE is not set
35615 +# CONFIG_IXGB is not set
35616 +# CONFIG_S2IO is not set
35617 +# CONFIG_MYRI10GE is not set
35618 +# CONFIG_NETXEN_NIC is not set
35619 +# CONFIG_NIU is not set
35620 +# CONFIG_MLX4_CORE is not set
35621 +# CONFIG_TEHUTI is not set
35622 +# CONFIG_TR is not set
35623  
35624  #
35625  # Wireless LAN
35626 @@ -456,6 +520,8 @@ CONFIG_NETDEV_10000=y
35627  # CONFIG_WLAN_PRE80211 is not set
35628  # CONFIG_WLAN_80211 is not set
35629  # CONFIG_WAN is not set
35630 +# CONFIG_FDDI is not set
35631 +# CONFIG_HIPPI is not set
35632  # CONFIG_PPP is not set
35633  # CONFIG_SLIP is not set
35634  # CONFIG_SHAPER is not set
35635 @@ -487,6 +553,7 @@ CONFIG_NETDEV_10000=y
35636  #
35637  CONFIG_SERIAL_8250=y
35638  CONFIG_SERIAL_8250_CONSOLE=y
35639 +CONFIG_SERIAL_8250_PCI=y
35640  CONFIG_SERIAL_8250_NR_UARTS=4
35641  CONFIG_SERIAL_8250_RUNTIME_UARTS=4
35642  CONFIG_SERIAL_8250_EXTENDED=y
35643 @@ -501,6 +568,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
35644  # CONFIG_SERIAL_UARTLITE is not set
35645  CONFIG_SERIAL_CORE=y
35646  CONFIG_SERIAL_CORE_CONSOLE=y
35647 +# CONFIG_SERIAL_JSM is not set
35648  CONFIG_SERIAL_OF_PLATFORM=y
35649  CONFIG_UNIX98_PTYS=y
35650  CONFIG_LEGACY_PTYS=y
35651 @@ -510,8 +578,10 @@ CONFIG_LEGACY_PTY_COUNT=256
35652  # CONFIG_NVRAM is not set
35653  # CONFIG_GEN_RTC is not set
35654  # CONFIG_R3964 is not set
35655 +# CONFIG_APPLICOM is not set
35656  # CONFIG_RAW_DRIVER is not set
35657  # CONFIG_TCG_TPM is not set
35658 +CONFIG_DEVPORT=y
35659  # CONFIG_I2C is not set
35660  
35661  #
35662 @@ -545,6 +615,8 @@ CONFIG_SSB_POSSIBLE=y
35663  #
35664  # Graphics support
35665  #
35666 +# CONFIG_AGP is not set
35667 +# CONFIG_DRM is not set
35668  # CONFIG_VGASTATE is not set
35669  CONFIG_VIDEO_OUTPUT_CONTROL=m
35670  # CONFIG_FB is not set
35671 @@ -560,9 +632,10 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
35672  #
35673  # CONFIG_SOUND is not set
35674  CONFIG_USB_SUPPORT=y
35675 -# CONFIG_USB_ARCH_HAS_HCD is not set
35676 -# CONFIG_USB_ARCH_HAS_OHCI is not set
35677 -# CONFIG_USB_ARCH_HAS_EHCI is not set
35678 +CONFIG_USB_ARCH_HAS_HCD=y
35679 +CONFIG_USB_ARCH_HAS_OHCI=y
35680 +CONFIG_USB_ARCH_HAS_EHCI=y
35681 +# CONFIG_USB is not set
35682  
35683  #
35684  # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
35685 @@ -574,6 +647,7 @@ CONFIG_USB_SUPPORT=y
35686  # CONFIG_USB_GADGET is not set
35687  # CONFIG_MMC is not set
35688  # CONFIG_NEW_LEDS is not set
35689 +# CONFIG_INFINIBAND is not set
35690  # CONFIG_EDAC is not set
35691  # CONFIG_RTC_CLASS is not set
35692  
35693 Index: linux-2.6.24.7/arch/powerpc/configs/warp_defconfig
35694 ===================================================================
35695 --- /dev/null
35696 +++ linux-2.6.24.7/arch/powerpc/configs/warp_defconfig
35697 @@ -0,0 +1,1057 @@
35698 +#
35699 +# Automatically generated make config: don't edit
35700 +# Linux kernel version: 2.6.24-rc6
35701 +# Tue Jan  8 12:23:23 2008
35702 +#
35703 +# CONFIG_PPC64 is not set
35704 +
35705 +#
35706 +# Processor support
35707 +#
35708 +# CONFIG_6xx is not set
35709 +# CONFIG_PPC_85xx is not set
35710 +# CONFIG_PPC_8xx is not set
35711 +# CONFIG_40x is not set
35712 +CONFIG_44x=y
35713 +# CONFIG_E200 is not set
35714 +CONFIG_PPC_FPU=y
35715 +CONFIG_4xx=y
35716 +CONFIG_BOOKE=y
35717 +CONFIG_PTE_64BIT=y
35718 +CONFIG_PHYS_64BIT=y
35719 +# CONFIG_PPC_MM_SLICES is not set
35720 +CONFIG_NOT_COHERENT_CACHE=y
35721 +CONFIG_PPC32=y
35722 +CONFIG_WORD_SIZE=32
35723 +CONFIG_PPC_MERGE=y
35724 +CONFIG_MMU=y
35725 +CONFIG_GENERIC_CMOS_UPDATE=y
35726 +CONFIG_GENERIC_TIME=y
35727 +CONFIG_GENERIC_TIME_VSYSCALL=y
35728 +CONFIG_GENERIC_CLOCKEVENTS=y
35729 +CONFIG_GENERIC_HARDIRQS=y
35730 +CONFIG_IRQ_PER_CPU=y
35731 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
35732 +CONFIG_ARCH_HAS_ILOG2_U32=y
35733 +CONFIG_GENERIC_HWEIGHT=y
35734 +CONFIG_GENERIC_CALIBRATE_DELAY=y
35735 +CONFIG_GENERIC_FIND_NEXT_BIT=y
35736 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
35737 +CONFIG_PPC=y
35738 +CONFIG_EARLY_PRINTK=y
35739 +CONFIG_GENERIC_NVRAM=y
35740 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
35741 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
35742 +CONFIG_PPC_OF=y
35743 +CONFIG_OF=y
35744 +CONFIG_PPC_UDBG_16550=y
35745 +# CONFIG_GENERIC_TBSYNC is not set
35746 +CONFIG_AUDIT_ARCH=y
35747 +CONFIG_GENERIC_BUG=y
35748 +# CONFIG_DEFAULT_UIMAGE is not set
35749 +CONFIG_PPC_DCR_NATIVE=y
35750 +# CONFIG_PPC_DCR_MMIO is not set
35751 +CONFIG_PPC_DCR=y
35752 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
35753 +
35754 +#
35755 +# General setup
35756 +#
35757 +CONFIG_EXPERIMENTAL=y
35758 +CONFIG_BROKEN_ON_SMP=y
35759 +CONFIG_INIT_ENV_ARG_LIMIT=32
35760 +CONFIG_LOCALVERSION="-pika"
35761 +# CONFIG_LOCALVERSION_AUTO is not set
35762 +CONFIG_SWAP=y
35763 +CONFIG_SYSVIPC=y
35764 +CONFIG_SYSVIPC_SYSCTL=y
35765 +# CONFIG_POSIX_MQUEUE is not set
35766 +# CONFIG_BSD_PROCESS_ACCT is not set
35767 +# CONFIG_TASKSTATS is not set
35768 +# CONFIG_USER_NS is not set
35769 +# CONFIG_PID_NS is not set
35770 +# CONFIG_AUDIT is not set
35771 +# CONFIG_IKCONFIG is not set
35772 +CONFIG_LOG_BUF_SHIFT=14
35773 +# CONFIG_CGROUPS is not set
35774 +CONFIG_FAIR_GROUP_SCHED=y
35775 +CONFIG_FAIR_USER_SCHED=y
35776 +# CONFIG_FAIR_CGROUP_SCHED is not set
35777 +CONFIG_SYSFS_DEPRECATED=y
35778 +# CONFIG_RELAY is not set
35779 +CONFIG_BLK_DEV_INITRD=y
35780 +CONFIG_INITRAMFS_SOURCE=""
35781 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
35782 +CONFIG_SYSCTL=y
35783 +CONFIG_EMBEDDED=y
35784 +CONFIG_SYSCTL_SYSCALL=y
35785 +CONFIG_KALLSYMS=y
35786 +# CONFIG_KALLSYMS_ALL is not set
35787 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
35788 +# CONFIG_HOTPLUG is not set
35789 +CONFIG_PRINTK=y
35790 +CONFIG_BUG=y
35791 +CONFIG_ELF_CORE=y
35792 +CONFIG_BASE_FULL=y
35793 +CONFIG_FUTEX=y
35794 +CONFIG_ANON_INODES=y
35795 +CONFIG_EPOLL=y
35796 +CONFIG_SIGNALFD=y
35797 +CONFIG_EVENTFD=y
35798 +CONFIG_SHMEM=y
35799 +CONFIG_VM_EVENT_COUNTERS=y
35800 +CONFIG_SLAB=y
35801 +# CONFIG_SLUB is not set
35802 +# CONFIG_SLOB is not set
35803 +CONFIG_RT_MUTEXES=y
35804 +# CONFIG_TINY_SHMEM is not set
35805 +CONFIG_BASE_SMALL=0
35806 +CONFIG_MODULES=y
35807 +CONFIG_MODULE_UNLOAD=y
35808 +# CONFIG_MODULE_FORCE_UNLOAD is not set
35809 +# CONFIG_MODVERSIONS is not set
35810 +# CONFIG_MODULE_SRCVERSION_ALL is not set
35811 +CONFIG_KMOD=y
35812 +CONFIG_BLOCK=y
35813 +# CONFIG_LBD is not set
35814 +# CONFIG_BLK_DEV_IO_TRACE is not set
35815 +# CONFIG_LSF is not set
35816 +# CONFIG_BLK_DEV_BSG is not set
35817 +
35818 +#
35819 +# IO Schedulers
35820 +#
35821 +CONFIG_IOSCHED_NOOP=y
35822 +CONFIG_IOSCHED_AS=y
35823 +CONFIG_IOSCHED_DEADLINE=y
35824 +CONFIG_IOSCHED_CFQ=y
35825 +CONFIG_DEFAULT_AS=y
35826 +# CONFIG_DEFAULT_DEADLINE is not set
35827 +# CONFIG_DEFAULT_CFQ is not set
35828 +# CONFIG_DEFAULT_NOOP is not set
35829 +CONFIG_DEFAULT_IOSCHED="anticipatory"
35830 +
35831 +#
35832 +# Platform support
35833 +#
35834 +# CONFIG_PPC_MPC52xx is not set
35835 +# CONFIG_PPC_MPC5200 is not set
35836 +# CONFIG_PPC_CELL is not set
35837 +# CONFIG_PPC_CELL_NATIVE is not set
35838 +# CONFIG_PQ2ADS is not set
35839 +# CONFIG_BAMBOO is not set
35840 +# CONFIG_EBONY is not set
35841 +# CONFIG_SEQUOIA is not set
35842 +# CONFIG_TAISHAN is not set
35843 +# CONFIG_KATMAI is not set
35844 +# CONFIG_RAINIER is not set
35845 +CONFIG_WARP=y
35846 +CONFIG_440EP=y
35847 +CONFIG_IBM440EP_ERR42=y
35848 +# CONFIG_MPIC is not set
35849 +# CONFIG_MPIC_WEIRD is not set
35850 +# CONFIG_PPC_I8259 is not set
35851 +# CONFIG_PPC_RTAS is not set
35852 +# CONFIG_MMIO_NVRAM is not set
35853 +# CONFIG_PPC_MPC106 is not set
35854 +# CONFIG_PPC_970_NAP is not set
35855 +# CONFIG_PPC_INDIRECT_IO is not set
35856 +# CONFIG_GENERIC_IOMAP is not set
35857 +# CONFIG_CPU_FREQ is not set
35858 +# CONFIG_CPM2 is not set
35859 +# CONFIG_FSL_ULI1575 is not set
35860 +
35861 +#
35862 +# Kernel options
35863 +#
35864 +# CONFIG_HIGHMEM is not set
35865 +# CONFIG_TICK_ONESHOT is not set
35866 +# CONFIG_NO_HZ is not set
35867 +# CONFIG_HIGH_RES_TIMERS is not set
35868 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
35869 +# CONFIG_HZ_100 is not set
35870 +# CONFIG_HZ_250 is not set
35871 +# CONFIG_HZ_300 is not set
35872 +CONFIG_HZ_1000=y
35873 +CONFIG_HZ=1000
35874 +CONFIG_PREEMPT_NONE=y
35875 +# CONFIG_PREEMPT_VOLUNTARY is not set
35876 +# CONFIG_PREEMPT is not set
35877 +CONFIG_BINFMT_ELF=y
35878 +# CONFIG_BINFMT_MISC is not set
35879 +# CONFIG_MATH_EMULATION is not set
35880 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
35881 +CONFIG_ARCH_FLATMEM_ENABLE=y
35882 +CONFIG_ARCH_POPULATES_NODE_MAP=y
35883 +CONFIG_SELECT_MEMORY_MODEL=y
35884 +CONFIG_FLATMEM_MANUAL=y
35885 +# CONFIG_DISCONTIGMEM_MANUAL is not set
35886 +# CONFIG_SPARSEMEM_MANUAL is not set
35887 +CONFIG_FLATMEM=y
35888 +CONFIG_FLAT_NODE_MEM_MAP=y
35889 +# CONFIG_SPARSEMEM_STATIC is not set
35890 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
35891 +CONFIG_SPLIT_PTLOCK_CPUS=4
35892 +CONFIG_RESOURCES_64BIT=y
35893 +CONFIG_ZONE_DMA_FLAG=1
35894 +CONFIG_BOUNCE=y
35895 +CONFIG_VIRT_TO_BUS=y
35896 +CONFIG_PROC_DEVICETREE=y
35897 +CONFIG_CMDLINE_BOOL=y
35898 +CONFIG_CMDLINE="ip=on"
35899 +CONFIG_SECCOMP=y
35900 +CONFIG_WANT_DEVICE_TREE=y
35901 +CONFIG_DEVICE_TREE="warp.dts"
35902 +CONFIG_ISA_DMA_API=y
35903 +
35904 +#
35905 +# Bus options
35906 +#
35907 +CONFIG_ZONE_DMA=y
35908 +# CONFIG_PCI is not set
35909 +# CONFIG_PCI_DOMAINS is not set
35910 +# CONFIG_PCI_SYSCALL is not set
35911 +# CONFIG_ARCH_SUPPORTS_MSI is not set
35912 +
35913 +#
35914 +# Advanced setup
35915 +#
35916 +# CONFIG_ADVANCED_OPTIONS is not set
35917 +
35918 +#
35919 +# Default settings for advanced configuration options are used
35920 +#
35921 +CONFIG_HIGHMEM_START=0xfe000000
35922 +CONFIG_LOWMEM_SIZE=0x30000000
35923 +CONFIG_KERNEL_START=0xc0000000
35924 +CONFIG_TASK_SIZE=0xc0000000
35925 +CONFIG_CONSISTENT_START=0xff100000
35926 +CONFIG_CONSISTENT_SIZE=0x00200000
35927 +CONFIG_BOOT_LOAD=0x01000000
35928 +
35929 +#
35930 +# Networking
35931 +#
35932 +CONFIG_NET=y
35933 +
35934 +#
35935 +# Networking options
35936 +#
35937 +CONFIG_PACKET=y
35938 +# CONFIG_PACKET_MMAP is not set
35939 +CONFIG_UNIX=y
35940 +CONFIG_XFRM=y
35941 +# CONFIG_XFRM_USER is not set
35942 +# CONFIG_XFRM_SUB_POLICY is not set
35943 +# CONFIG_XFRM_MIGRATE is not set
35944 +# CONFIG_NET_KEY is not set
35945 +CONFIG_INET=y
35946 +# CONFIG_IP_MULTICAST is not set
35947 +# CONFIG_IP_ADVANCED_ROUTER is not set
35948 +CONFIG_IP_FIB_HASH=y
35949 +CONFIG_IP_PNP=y
35950 +CONFIG_IP_PNP_DHCP=y
35951 +# CONFIG_IP_PNP_BOOTP is not set
35952 +# CONFIG_IP_PNP_RARP is not set
35953 +# CONFIG_NET_IPIP is not set
35954 +# CONFIG_NET_IPGRE is not set
35955 +# CONFIG_ARPD is not set
35956 +# CONFIG_SYN_COOKIES is not set
35957 +# CONFIG_INET_AH is not set
35958 +# CONFIG_INET_ESP is not set
35959 +# CONFIG_INET_IPCOMP is not set
35960 +# CONFIG_INET_XFRM_TUNNEL is not set
35961 +# CONFIG_INET_TUNNEL is not set
35962 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
35963 +CONFIG_INET_XFRM_MODE_TUNNEL=y
35964 +CONFIG_INET_XFRM_MODE_BEET=y
35965 +# CONFIG_INET_LRO is not set
35966 +CONFIG_INET_DIAG=y
35967 +CONFIG_INET_TCP_DIAG=y
35968 +# CONFIG_TCP_CONG_ADVANCED is not set
35969 +CONFIG_TCP_CONG_CUBIC=y
35970 +CONFIG_DEFAULT_TCP_CONG="cubic"
35971 +# CONFIG_TCP_MD5SIG is not set
35972 +# CONFIG_IP_VS is not set
35973 +# CONFIG_IPV6 is not set
35974 +# CONFIG_INET6_XFRM_TUNNEL is not set
35975 +# CONFIG_INET6_TUNNEL is not set
35976 +# CONFIG_NETWORK_SECMARK is not set
35977 +CONFIG_NETFILTER=y
35978 +# CONFIG_NETFILTER_DEBUG is not set
35979 +
35980 +#
35981 +# Core Netfilter Configuration
35982 +#
35983 +# CONFIG_NETFILTER_NETLINK is not set
35984 +# CONFIG_NF_CONNTRACK_ENABLED is not set
35985 +# CONFIG_NF_CONNTRACK is not set
35986 +# CONFIG_NETFILTER_XTABLES is not set
35987 +
35988 +#
35989 +# IP: Netfilter Configuration
35990 +#
35991 +# CONFIG_IP_NF_QUEUE is not set
35992 +# CONFIG_IP_NF_IPTABLES is not set
35993 +# CONFIG_IP_NF_ARPTABLES is not set
35994 +# CONFIG_IP_DCCP is not set
35995 +# CONFIG_IP_SCTP is not set
35996 +# CONFIG_TIPC is not set
35997 +# CONFIG_ATM is not set
35998 +# CONFIG_BRIDGE is not set
35999 +CONFIG_VLAN_8021Q=y
36000 +# CONFIG_DECNET is not set
36001 +# CONFIG_LLC2 is not set
36002 +# CONFIG_IPX is not set
36003 +# CONFIG_ATALK is not set
36004 +# CONFIG_X25 is not set
36005 +# CONFIG_LAPB is not set
36006 +# CONFIG_ECONET is not set
36007 +# CONFIG_WAN_ROUTER is not set
36008 +# CONFIG_NET_SCHED is not set
36009 +
36010 +#
36011 +# Network testing
36012 +#
36013 +# CONFIG_NET_PKTGEN is not set
36014 +# CONFIG_HAMRADIO is not set
36015 +# CONFIG_IRDA is not set
36016 +# CONFIG_BT is not set
36017 +# CONFIG_AF_RXRPC is not set
36018 +
36019 +#
36020 +# Wireless
36021 +#
36022 +# CONFIG_CFG80211 is not set
36023 +# CONFIG_WIRELESS_EXT is not set
36024 +# CONFIG_MAC80211 is not set
36025 +# CONFIG_IEEE80211 is not set
36026 +# CONFIG_RFKILL is not set
36027 +# CONFIG_NET_9P is not set
36028 +
36029 +#
36030 +# Device Drivers
36031 +#
36032 +
36033 +#
36034 +# Generic Driver Options
36035 +#
36036 +# CONFIG_STANDALONE is not set
36037 +CONFIG_PREVENT_FIRMWARE_BUILD=y
36038 +# CONFIG_DEBUG_DRIVER is not set
36039 +# CONFIG_DEBUG_DEVRES is not set
36040 +# CONFIG_SYS_HYPERVISOR is not set
36041 +# CONFIG_CONNECTOR is not set
36042 +CONFIG_MTD=y
36043 +# CONFIG_MTD_DEBUG is not set
36044 +# CONFIG_MTD_CONCAT is not set
36045 +CONFIG_MTD_PARTITIONS=y
36046 +# CONFIG_MTD_REDBOOT_PARTS is not set
36047 +# CONFIG_MTD_CMDLINE_PARTS is not set
36048 +
36049 +#
36050 +# User Modules And Translation Layers
36051 +#
36052 +CONFIG_MTD_CHAR=y
36053 +CONFIG_MTD_BLKDEVS=y
36054 +CONFIG_MTD_BLOCK=y
36055 +# CONFIG_FTL is not set
36056 +# CONFIG_NFTL is not set
36057 +# CONFIG_INFTL is not set
36058 +# CONFIG_RFD_FTL is not set
36059 +# CONFIG_SSFDC is not set
36060 +CONFIG_MTD_OOPS=m
36061 +
36062 +#
36063 +# RAM/ROM/Flash chip drivers
36064 +#
36065 +CONFIG_MTD_CFI=y
36066 +# CONFIG_MTD_JEDECPROBE is not set
36067 +CONFIG_MTD_GEN_PROBE=y
36068 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
36069 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
36070 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
36071 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
36072 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
36073 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
36074 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
36075 +CONFIG_MTD_CFI_I1=y
36076 +CONFIG_MTD_CFI_I2=y
36077 +# CONFIG_MTD_CFI_I4 is not set
36078 +# CONFIG_MTD_CFI_I8 is not set
36079 +# CONFIG_MTD_CFI_INTELEXT is not set
36080 +CONFIG_MTD_CFI_AMDSTD=y
36081 +# CONFIG_MTD_CFI_STAA is not set
36082 +CONFIG_MTD_CFI_UTIL=y
36083 +# CONFIG_MTD_RAM is not set
36084 +# CONFIG_MTD_ROM is not set
36085 +# CONFIG_MTD_ABSENT is not set
36086 +
36087 +#
36088 +# Mapping drivers for chip access
36089 +#
36090 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
36091 +# CONFIG_MTD_PHYSMAP is not set
36092 +CONFIG_MTD_PHYSMAP_OF=y
36093 +# CONFIG_MTD_PLATRAM is not set
36094 +
36095 +#
36096 +# Self-contained MTD device drivers
36097 +#
36098 +# CONFIG_MTD_SLRAM is not set
36099 +# CONFIG_MTD_PHRAM is not set
36100 +# CONFIG_MTD_MTDRAM is not set
36101 +# CONFIG_MTD_BLOCK2MTD is not set
36102 +
36103 +#
36104 +# Disk-On-Chip Device Drivers
36105 +#
36106 +# CONFIG_MTD_DOC2000 is not set
36107 +# CONFIG_MTD_DOC2001 is not set
36108 +# CONFIG_MTD_DOC2001PLUS is not set
36109 +CONFIG_MTD_NAND=y
36110 +# CONFIG_MTD_NAND_VERIFY_WRITE is not set
36111 +CONFIG_MTD_NAND_ECC_SMC=y
36112 +# CONFIG_MTD_NAND_MUSEUM_IDS is not set
36113 +CONFIG_MTD_NAND_IDS=y
36114 +CONFIG_MTD_NAND_NDFC=y
36115 +# CONFIG_MTD_NAND_DISKONCHIP is not set
36116 +# CONFIG_MTD_NAND_NANDSIM is not set
36117 +# CONFIG_MTD_NAND_PLATFORM is not set
36118 +# CONFIG_MTD_ALAUDA is not set
36119 +# CONFIG_MTD_ONENAND is not set
36120 +
36121 +#
36122 +# UBI - Unsorted block images
36123 +#
36124 +# CONFIG_MTD_UBI is not set
36125 +CONFIG_OF_DEVICE=y
36126 +# CONFIG_PARPORT is not set
36127 +CONFIG_BLK_DEV=y
36128 +# CONFIG_BLK_DEV_FD is not set
36129 +# CONFIG_BLK_DEV_COW_COMMON is not set
36130 +# CONFIG_BLK_DEV_LOOP is not set
36131 +# CONFIG_BLK_DEV_NBD is not set
36132 +# CONFIG_BLK_DEV_UB is not set
36133 +CONFIG_BLK_DEV_RAM=y
36134 +CONFIG_BLK_DEV_RAM_COUNT=16
36135 +CONFIG_BLK_DEV_RAM_SIZE=4096
36136 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
36137 +# CONFIG_CDROM_PKTCDVD is not set
36138 +# CONFIG_ATA_OVER_ETH is not set
36139 +# CONFIG_XILINX_SYSACE is not set
36140 +CONFIG_MISC_DEVICES=y
36141 +# CONFIG_EEPROM_93CX6 is not set
36142 +# CONFIG_IDE is not set
36143 +
36144 +#
36145 +# SCSI device support
36146 +#
36147 +# CONFIG_RAID_ATTRS is not set
36148 +CONFIG_SCSI=y
36149 +CONFIG_SCSI_DMA=y
36150 +# CONFIG_SCSI_TGT is not set
36151 +# CONFIG_SCSI_NETLINK is not set
36152 +CONFIG_SCSI_PROC_FS=y
36153 +
36154 +#
36155 +# SCSI support type (disk, tape, CD-ROM)
36156 +#
36157 +CONFIG_BLK_DEV_SD=y
36158 +# CONFIG_CHR_DEV_ST is not set
36159 +# CONFIG_CHR_DEV_OSST is not set
36160 +# CONFIG_BLK_DEV_SR is not set
36161 +# CONFIG_CHR_DEV_SG is not set
36162 +# CONFIG_CHR_DEV_SCH is not set
36163 +
36164 +#
36165 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
36166 +#
36167 +# CONFIG_SCSI_MULTI_LUN is not set
36168 +# CONFIG_SCSI_CONSTANTS is not set
36169 +# CONFIG_SCSI_LOGGING is not set
36170 +# CONFIG_SCSI_SCAN_ASYNC is not set
36171 +# CONFIG_SCSI_WAIT_SCAN is not set
36172 +
36173 +#
36174 +# SCSI Transports
36175 +#
36176 +CONFIG_SCSI_SPI_ATTRS=y
36177 +# CONFIG_SCSI_FC_ATTRS is not set
36178 +# CONFIG_SCSI_ISCSI_ATTRS is not set
36179 +# CONFIG_SCSI_SAS_LIBSAS is not set
36180 +# CONFIG_SCSI_SRP_ATTRS is not set
36181 +# CONFIG_SCSI_LOWLEVEL is not set
36182 +# CONFIG_ATA is not set
36183 +# CONFIG_MD is not set
36184 +# CONFIG_MACINTOSH_DRIVERS is not set
36185 +CONFIG_NETDEVICES=y
36186 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
36187 +# CONFIG_DUMMY is not set
36188 +# CONFIG_BONDING is not set
36189 +# CONFIG_MACVLAN is not set
36190 +# CONFIG_EQUALIZER is not set
36191 +# CONFIG_TUN is not set
36192 +# CONFIG_VETH is not set
36193 +# CONFIG_PHYLIB is not set
36194 +CONFIG_NET_ETHERNET=y
36195 +CONFIG_MII=y
36196 +CONFIG_IBM_NEW_EMAC=y
36197 +CONFIG_IBM_NEW_EMAC_RXB=128
36198 +CONFIG_IBM_NEW_EMAC_TXB=64
36199 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
36200 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
36201 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
36202 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
36203 +CONFIG_IBM_NEW_EMAC_ZMII=y
36204 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
36205 +# CONFIG_IBM_NEW_EMAC_TAH is not set
36206 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
36207 +# CONFIG_B44 is not set
36208 +# CONFIG_NETDEV_1000 is not set
36209 +# CONFIG_NETDEV_10000 is not set
36210 +
36211 +#
36212 +# Wireless LAN
36213 +#
36214 +# CONFIG_WLAN_PRE80211 is not set
36215 +# CONFIG_WLAN_80211 is not set
36216 +
36217 +#
36218 +# USB Network Adapters
36219 +#
36220 +# CONFIG_USB_CATC is not set
36221 +# CONFIG_USB_KAWETH is not set
36222 +# CONFIG_USB_PEGASUS is not set
36223 +# CONFIG_USB_RTL8150 is not set
36224 +# CONFIG_USB_USBNET is not set
36225 +# CONFIG_WAN is not set
36226 +# CONFIG_PPP is not set
36227 +# CONFIG_SLIP is not set
36228 +# CONFIG_SHAPER is not set
36229 +# CONFIG_NETCONSOLE is not set
36230 +# CONFIG_NETPOLL is not set
36231 +# CONFIG_NET_POLL_CONTROLLER is not set
36232 +# CONFIG_ISDN is not set
36233 +# CONFIG_PHONE is not set
36234 +
36235 +#
36236 +# Input device support
36237 +#
36238 +# CONFIG_INPUT is not set
36239 +
36240 +#
36241 +# Hardware I/O ports
36242 +#
36243 +# CONFIG_SERIO is not set
36244 +# CONFIG_GAMEPORT is not set
36245 +
36246 +#
36247 +# Character devices
36248 +#
36249 +# CONFIG_VT is not set
36250 +# CONFIG_SERIAL_NONSTANDARD is not set
36251 +
36252 +#
36253 +# Serial drivers
36254 +#
36255 +CONFIG_SERIAL_8250=y
36256 +CONFIG_SERIAL_8250_CONSOLE=y
36257 +CONFIG_SERIAL_8250_NR_UARTS=4
36258 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
36259 +CONFIG_SERIAL_8250_EXTENDED=y
36260 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
36261 +CONFIG_SERIAL_8250_SHARE_IRQ=y
36262 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
36263 +# CONFIG_SERIAL_8250_RSA is not set
36264 +
36265 +#
36266 +# Non-8250 serial port support
36267 +#
36268 +# CONFIG_SERIAL_UARTLITE is not set
36269 +CONFIG_SERIAL_CORE=y
36270 +CONFIG_SERIAL_CORE_CONSOLE=y
36271 +# CONFIG_SERIAL_OF_PLATFORM is not set
36272 +CONFIG_UNIX98_PTYS=y
36273 +CONFIG_LEGACY_PTYS=y
36274 +CONFIG_LEGACY_PTY_COUNT=256
36275 +# CONFIG_IPMI_HANDLER is not set
36276 +CONFIG_HW_RANDOM=y
36277 +# CONFIG_NVRAM is not set
36278 +# CONFIG_GEN_RTC is not set
36279 +# CONFIG_R3964 is not set
36280 +# CONFIG_RAW_DRIVER is not set
36281 +# CONFIG_TCG_TPM is not set
36282 +CONFIG_I2C=y
36283 +CONFIG_I2C_BOARDINFO=y
36284 +# CONFIG_I2C_CHARDEV is not set
36285 +
36286 +#
36287 +# I2C Algorithms
36288 +#
36289 +# CONFIG_I2C_ALGOBIT is not set
36290 +# CONFIG_I2C_ALGOPCF is not set
36291 +# CONFIG_I2C_ALGOPCA is not set
36292 +
36293 +#
36294 +# I2C Hardware Bus support
36295 +#
36296 +CONFIG_I2C_IBM_IIC=y
36297 +# CONFIG_I2C_MPC is not set
36298 +# CONFIG_I2C_OCORES is not set
36299 +# CONFIG_I2C_PARPORT_LIGHT is not set
36300 +# CONFIG_I2C_SIMTEC is not set
36301 +# CONFIG_I2C_TAOS_EVM is not set
36302 +# CONFIG_I2C_STUB is not set
36303 +# CONFIG_I2C_TINY_USB is not set
36304 +
36305 +#
36306 +# Miscellaneous I2C Chip support
36307 +#
36308 +# CONFIG_SENSORS_DS1337 is not set
36309 +# CONFIG_SENSORS_DS1374 is not set
36310 +# CONFIG_DS1682 is not set
36311 +CONFIG_SENSORS_EEPROM=y
36312 +# CONFIG_SENSORS_PCF8574 is not set
36313 +# CONFIG_SENSORS_PCA9539 is not set
36314 +# CONFIG_SENSORS_PCF8591 is not set
36315 +# CONFIG_SENSORS_M41T00 is not set
36316 +# CONFIG_SENSORS_MAX6875 is not set
36317 +# CONFIG_SENSORS_TSL2550 is not set
36318 +# CONFIG_I2C_DEBUG_CORE is not set
36319 +# CONFIG_I2C_DEBUG_ALGO is not set
36320 +# CONFIG_I2C_DEBUG_BUS is not set
36321 +# CONFIG_I2C_DEBUG_CHIP is not set
36322 +
36323 +#
36324 +# SPI support
36325 +#
36326 +# CONFIG_SPI is not set
36327 +# CONFIG_SPI_MASTER is not set
36328 +# CONFIG_W1 is not set
36329 +# CONFIG_POWER_SUPPLY is not set
36330 +CONFIG_HWMON=y
36331 +# CONFIG_HWMON_VID is not set
36332 +CONFIG_SENSORS_AD7414=y
36333 +# CONFIG_SENSORS_AD7418 is not set
36334 +# CONFIG_SENSORS_ADM1021 is not set
36335 +# CONFIG_SENSORS_ADM1025 is not set
36336 +# CONFIG_SENSORS_ADM1026 is not set
36337 +# CONFIG_SENSORS_ADM1029 is not set
36338 +# CONFIG_SENSORS_ADM1031 is not set
36339 +# CONFIG_SENSORS_ADM9240 is not set
36340 +# CONFIG_SENSORS_ADT7470 is not set
36341 +# CONFIG_SENSORS_ATXP1 is not set
36342 +# CONFIG_SENSORS_DS1621 is not set
36343 +# CONFIG_SENSORS_F71805F is not set
36344 +# CONFIG_SENSORS_F71882FG is not set
36345 +# CONFIG_SENSORS_F75375S is not set
36346 +# CONFIG_SENSORS_GL518SM is not set
36347 +# CONFIG_SENSORS_GL520SM is not set
36348 +# CONFIG_SENSORS_IT87 is not set
36349 +# CONFIG_SENSORS_LM63 is not set
36350 +# CONFIG_SENSORS_LM75 is not set
36351 +# CONFIG_SENSORS_LM77 is not set
36352 +# CONFIG_SENSORS_LM78 is not set
36353 +# CONFIG_SENSORS_LM80 is not set
36354 +# CONFIG_SENSORS_LM83 is not set
36355 +# CONFIG_SENSORS_LM85 is not set
36356 +# CONFIG_SENSORS_LM87 is not set
36357 +# CONFIG_SENSORS_LM90 is not set
36358 +# CONFIG_SENSORS_LM92 is not set
36359 +# CONFIG_SENSORS_LM93 is not set
36360 +# CONFIG_SENSORS_MAX1619 is not set
36361 +# CONFIG_SENSORS_MAX6650 is not set
36362 +# CONFIG_SENSORS_PC87360 is not set
36363 +# CONFIG_SENSORS_PC87427 is not set
36364 +# CONFIG_SENSORS_DME1737 is not set
36365 +# CONFIG_SENSORS_SMSC47M1 is not set
36366 +# CONFIG_SENSORS_SMSC47M192 is not set
36367 +# CONFIG_SENSORS_SMSC47B397 is not set
36368 +# CONFIG_SENSORS_THMC50 is not set
36369 +# CONFIG_SENSORS_VT1211 is not set
36370 +# CONFIG_SENSORS_W83781D is not set
36371 +# CONFIG_SENSORS_W83791D is not set
36372 +# CONFIG_SENSORS_W83792D is not set
36373 +# CONFIG_SENSORS_W83793 is not set
36374 +# CONFIG_SENSORS_W83L785TS is not set
36375 +# CONFIG_SENSORS_W83627HF is not set
36376 +# CONFIG_SENSORS_W83627EHF is not set
36377 +# CONFIG_HWMON_DEBUG_CHIP is not set
36378 +# CONFIG_WATCHDOG is not set
36379 +
36380 +#
36381 +# Sonics Silicon Backplane
36382 +#
36383 +CONFIG_SSB_POSSIBLE=y
36384 +# CONFIG_SSB is not set
36385 +
36386 +#
36387 +# Multifunction device drivers
36388 +#
36389 +# CONFIG_MFD_SM501 is not set
36390 +
36391 +#
36392 +# Multimedia devices
36393 +#
36394 +# CONFIG_VIDEO_DEV is not set
36395 +# CONFIG_DVB_CORE is not set
36396 +# CONFIG_DAB is not set
36397 +
36398 +#
36399 +# Graphics support
36400 +#
36401 +# CONFIG_VGASTATE is not set
36402 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
36403 +# CONFIG_FB is not set
36404 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
36405 +
36406 +#
36407 +# Display device support
36408 +#
36409 +# CONFIG_DISPLAY_SUPPORT is not set
36410 +
36411 +#
36412 +# Sound
36413 +#
36414 +# CONFIG_SOUND is not set
36415 +CONFIG_USB_SUPPORT=y
36416 +CONFIG_USB_ARCH_HAS_HCD=y
36417 +CONFIG_USB_ARCH_HAS_OHCI=y
36418 +# CONFIG_USB_ARCH_HAS_EHCI is not set
36419 +CONFIG_USB=y
36420 +# CONFIG_USB_DEBUG is not set
36421 +
36422 +#
36423 +# Miscellaneous USB options
36424 +#
36425 +# CONFIG_USB_DEVICEFS is not set
36426 +CONFIG_USB_DEVICE_CLASS=y
36427 +# CONFIG_USB_DYNAMIC_MINORS is not set
36428 +# CONFIG_USB_OTG is not set
36429 +
36430 +#
36431 +# USB Host Controller Drivers
36432 +#
36433 +# CONFIG_USB_ISP116X_HCD is not set
36434 +CONFIG_USB_OHCI_HCD=y
36435 +CONFIG_USB_OHCI_HCD_PPC_OF=y
36436 +CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
36437 +# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
36438 +CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
36439 +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
36440 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
36441 +# CONFIG_USB_SL811_HCD is not set
36442 +# CONFIG_USB_R8A66597_HCD is not set
36443 +
36444 +#
36445 +# USB Device Class drivers
36446 +#
36447 +# CONFIG_USB_ACM is not set
36448 +# CONFIG_USB_PRINTER is not set
36449 +
36450 +#
36451 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
36452 +#
36453 +
36454 +#
36455 +# may also be needed; see USB_STORAGE Help for more information
36456 +#
36457 +CONFIG_USB_STORAGE=y
36458 +# CONFIG_USB_STORAGE_DEBUG is not set
36459 +# CONFIG_USB_STORAGE_DATAFAB is not set
36460 +# CONFIG_USB_STORAGE_FREECOM is not set
36461 +# CONFIG_USB_STORAGE_ISD200 is not set
36462 +# CONFIG_USB_STORAGE_DPCM is not set
36463 +# CONFIG_USB_STORAGE_USBAT is not set
36464 +# CONFIG_USB_STORAGE_SDDR09 is not set
36465 +# CONFIG_USB_STORAGE_SDDR55 is not set
36466 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
36467 +# CONFIG_USB_STORAGE_ALAUDA is not set
36468 +# CONFIG_USB_STORAGE_KARMA is not set
36469 +# CONFIG_USB_LIBUSUAL is not set
36470 +
36471 +#
36472 +# USB Imaging devices
36473 +#
36474 +# CONFIG_USB_MDC800 is not set
36475 +# CONFIG_USB_MICROTEK is not set
36476 +CONFIG_USB_MON=y
36477 +
36478 +#
36479 +# USB port drivers
36480 +#
36481 +
36482 +#
36483 +# USB Serial Converter support
36484 +#
36485 +# CONFIG_USB_SERIAL is not set
36486 +
36487 +#
36488 +# USB Miscellaneous drivers
36489 +#
36490 +# CONFIG_USB_EMI62 is not set
36491 +# CONFIG_USB_EMI26 is not set
36492 +# CONFIG_USB_ADUTUX is not set
36493 +# CONFIG_USB_AUERSWALD is not set
36494 +# CONFIG_USB_RIO500 is not set
36495 +# CONFIG_USB_LEGOTOWER is not set
36496 +# CONFIG_USB_LCD is not set
36497 +# CONFIG_USB_BERRY_CHARGE is not set
36498 +# CONFIG_USB_LED is not set
36499 +# CONFIG_USB_CYPRESS_CY7C63 is not set
36500 +# CONFIG_USB_CYTHERM is not set
36501 +# CONFIG_USB_PHIDGET is not set
36502 +# CONFIG_USB_IDMOUSE is not set
36503 +# CONFIG_USB_FTDI_ELAN is not set
36504 +# CONFIG_USB_APPLEDISPLAY is not set
36505 +# CONFIG_USB_LD is not set
36506 +# CONFIG_USB_TRANCEVIBRATOR is not set
36507 +# CONFIG_USB_IOWARRIOR is not set
36508 +
36509 +#
36510 +# USB DSL modem support
36511 +#
36512 +
36513 +#
36514 +# USB Gadget Support
36515 +#
36516 +# CONFIG_USB_GADGET is not set
36517 +CONFIG_MMC=m
36518 +# CONFIG_MMC_DEBUG is not set
36519 +# CONFIG_MMC_UNSAFE_RESUME is not set
36520 +
36521 +#
36522 +# MMC/SD Card Drivers
36523 +#
36524 +CONFIG_MMC_BLOCK=m
36525 +CONFIG_MMC_BLOCK_BOUNCE=y
36526 +# CONFIG_SDIO_UART is not set
36527 +
36528 +#
36529 +# MMC/SD Host Controller Drivers
36530 +#
36531 +# CONFIG_MMC_WBSD is not set
36532 +# CONFIG_NEW_LEDS is not set
36533 +# CONFIG_EDAC is not set
36534 +# CONFIG_RTC_CLASS is not set
36535 +
36536 +#
36537 +# Userspace I/O
36538 +#
36539 +# CONFIG_UIO is not set
36540 +
36541 +#
36542 +# File systems
36543 +#
36544 +CONFIG_EXT2_FS=y
36545 +# CONFIG_EXT2_FS_XATTR is not set
36546 +# CONFIG_EXT2_FS_XIP is not set
36547 +# CONFIG_EXT3_FS is not set
36548 +# CONFIG_EXT4DEV_FS is not set
36549 +# CONFIG_REISERFS_FS is not set
36550 +# CONFIG_JFS_FS is not set
36551 +# CONFIG_FS_POSIX_ACL is not set
36552 +# CONFIG_XFS_FS is not set
36553 +# CONFIG_GFS2_FS is not set
36554 +# CONFIG_OCFS2_FS is not set
36555 +# CONFIG_MINIX_FS is not set
36556 +# CONFIG_ROMFS_FS is not set
36557 +CONFIG_INOTIFY=y
36558 +CONFIG_INOTIFY_USER=y
36559 +# CONFIG_QUOTA is not set
36560 +CONFIG_DNOTIFY=y
36561 +# CONFIG_AUTOFS_FS is not set
36562 +# CONFIG_AUTOFS4_FS is not set
36563 +# CONFIG_FUSE_FS is not set
36564 +
36565 +#
36566 +# CD-ROM/DVD Filesystems
36567 +#
36568 +# CONFIG_ISO9660_FS is not set
36569 +# CONFIG_UDF_FS is not set
36570 +
36571 +#
36572 +# DOS/FAT/NT Filesystems
36573 +#
36574 +CONFIG_FAT_FS=y
36575 +CONFIG_MSDOS_FS=y
36576 +CONFIG_VFAT_FS=y
36577 +CONFIG_FAT_DEFAULT_CODEPAGE=437
36578 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
36579 +# CONFIG_NTFS_FS is not set
36580 +
36581 +#
36582 +# Pseudo filesystems
36583 +#
36584 +CONFIG_PROC_FS=y
36585 +CONFIG_PROC_KCORE=y
36586 +CONFIG_PROC_SYSCTL=y
36587 +CONFIG_SYSFS=y
36588 +# CONFIG_TMPFS is not set
36589 +# CONFIG_HUGETLB_PAGE is not set
36590 +# CONFIG_CONFIGFS_FS is not set
36591 +
36592 +#
36593 +# Miscellaneous filesystems
36594 +#
36595 +# CONFIG_ADFS_FS is not set
36596 +# CONFIG_AFFS_FS is not set
36597 +# CONFIG_HFS_FS is not set
36598 +# CONFIG_HFSPLUS_FS is not set
36599 +# CONFIG_BEFS_FS is not set
36600 +# CONFIG_BFS_FS is not set
36601 +# CONFIG_EFS_FS is not set
36602 +CONFIG_JFFS2_FS=y
36603 +CONFIG_JFFS2_FS_DEBUG=0
36604 +CONFIG_JFFS2_FS_WRITEBUFFER=y
36605 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
36606 +# CONFIG_JFFS2_SUMMARY is not set
36607 +# CONFIG_JFFS2_FS_XATTR is not set
36608 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
36609 +CONFIG_JFFS2_ZLIB=y
36610 +# CONFIG_JFFS2_LZO is not set
36611 +CONFIG_JFFS2_RTIME=y
36612 +# CONFIG_JFFS2_RUBIN is not set
36613 +CONFIG_CRAMFS=y
36614 +# CONFIG_VXFS_FS is not set
36615 +# CONFIG_HPFS_FS is not set
36616 +# CONFIG_QNX4FS_FS is not set
36617 +# CONFIG_SYSV_FS is not set
36618 +# CONFIG_UFS_FS is not set
36619 +CONFIG_NETWORK_FILESYSTEMS=y
36620 +CONFIG_NFS_FS=y
36621 +CONFIG_NFS_V3=y
36622 +# CONFIG_NFS_V3_ACL is not set
36623 +# CONFIG_NFS_V4 is not set
36624 +# CONFIG_NFS_DIRECTIO is not set
36625 +# CONFIG_NFSD is not set
36626 +CONFIG_ROOT_NFS=y
36627 +CONFIG_LOCKD=y
36628 +CONFIG_LOCKD_V4=y
36629 +CONFIG_NFS_COMMON=y
36630 +CONFIG_SUNRPC=y
36631 +# CONFIG_SUNRPC_BIND34 is not set
36632 +# CONFIG_RPCSEC_GSS_KRB5 is not set
36633 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
36634 +# CONFIG_SMB_FS is not set
36635 +# CONFIG_CIFS is not set
36636 +# CONFIG_NCP_FS is not set
36637 +# CONFIG_CODA_FS is not set
36638 +# CONFIG_AFS_FS is not set
36639 +
36640 +#
36641 +# Partition Types
36642 +#
36643 +# CONFIG_PARTITION_ADVANCED is not set
36644 +CONFIG_MSDOS_PARTITION=y
36645 +CONFIG_NLS=y
36646 +CONFIG_NLS_DEFAULT="iso8859-1"
36647 +CONFIG_NLS_CODEPAGE_437=y
36648 +# CONFIG_NLS_CODEPAGE_737 is not set
36649 +# CONFIG_NLS_CODEPAGE_775 is not set
36650 +CONFIG_NLS_CODEPAGE_850=y
36651 +# CONFIG_NLS_CODEPAGE_852 is not set
36652 +# CONFIG_NLS_CODEPAGE_855 is not set
36653 +# CONFIG_NLS_CODEPAGE_857 is not set
36654 +# CONFIG_NLS_CODEPAGE_860 is not set
36655 +# CONFIG_NLS_CODEPAGE_861 is not set
36656 +# CONFIG_NLS_CODEPAGE_862 is not set
36657 +# CONFIG_NLS_CODEPAGE_863 is not set
36658 +# CONFIG_NLS_CODEPAGE_864 is not set
36659 +# CONFIG_NLS_CODEPAGE_865 is not set
36660 +# CONFIG_NLS_CODEPAGE_866 is not set
36661 +# CONFIG_NLS_CODEPAGE_869 is not set
36662 +# CONFIG_NLS_CODEPAGE_936 is not set
36663 +# CONFIG_NLS_CODEPAGE_950 is not set
36664 +# CONFIG_NLS_CODEPAGE_932 is not set
36665 +# CONFIG_NLS_CODEPAGE_949 is not set
36666 +# CONFIG_NLS_CODEPAGE_874 is not set
36667 +# CONFIG_NLS_ISO8859_8 is not set
36668 +# CONFIG_NLS_CODEPAGE_1250 is not set
36669 +# CONFIG_NLS_CODEPAGE_1251 is not set
36670 +CONFIG_NLS_ASCII=y
36671 +CONFIG_NLS_ISO8859_1=y
36672 +# CONFIG_NLS_ISO8859_2 is not set
36673 +# CONFIG_NLS_ISO8859_3 is not set
36674 +# CONFIG_NLS_ISO8859_4 is not set
36675 +# CONFIG_NLS_ISO8859_5 is not set
36676 +# CONFIG_NLS_ISO8859_6 is not set
36677 +# CONFIG_NLS_ISO8859_7 is not set
36678 +# CONFIG_NLS_ISO8859_9 is not set
36679 +# CONFIG_NLS_ISO8859_13 is not set
36680 +# CONFIG_NLS_ISO8859_14 is not set
36681 +CONFIG_NLS_ISO8859_15=y
36682 +# CONFIG_NLS_KOI8_R is not set
36683 +# CONFIG_NLS_KOI8_U is not set
36684 +CONFIG_NLS_UTF8=y
36685 +# CONFIG_DLM is not set
36686 +# CONFIG_UCC_SLOW is not set
36687 +
36688 +#
36689 +# Library routines
36690 +#
36691 +CONFIG_BITREVERSE=y
36692 +CONFIG_CRC_CCITT=y
36693 +# CONFIG_CRC16 is not set
36694 +# CONFIG_CRC_ITU_T is not set
36695 +CONFIG_CRC32=y
36696 +# CONFIG_CRC7 is not set
36697 +# CONFIG_LIBCRC32C is not set
36698 +CONFIG_ZLIB_INFLATE=y
36699 +CONFIG_ZLIB_DEFLATE=y
36700 +CONFIG_PLIST=y
36701 +CONFIG_HAS_IOMEM=y
36702 +CONFIG_HAS_IOPORT=y
36703 +CONFIG_HAS_DMA=y
36704 +# CONFIG_INSTRUMENTATION is not set
36705 +
36706 +#
36707 +# Kernel hacking
36708 +#
36709 +# CONFIG_PRINTK_TIME is not set
36710 +CONFIG_ENABLE_WARN_DEPRECATED=y
36711 +CONFIG_ENABLE_MUST_CHECK=y
36712 +CONFIG_MAGIC_SYSRQ=y
36713 +# CONFIG_UNUSED_SYMBOLS is not set
36714 +# CONFIG_DEBUG_FS is not set
36715 +# CONFIG_HEADERS_CHECK is not set
36716 +CONFIG_DEBUG_KERNEL=y
36717 +# CONFIG_DEBUG_SHIRQ is not set
36718 +CONFIG_DETECT_SOFTLOCKUP=y
36719 +# CONFIG_SCHED_DEBUG is not set
36720 +# CONFIG_SCHEDSTATS is not set
36721 +# CONFIG_TIMER_STATS is not set
36722 +# CONFIG_DEBUG_SLAB is not set
36723 +# CONFIG_DEBUG_RT_MUTEXES is not set
36724 +# CONFIG_RT_MUTEX_TESTER is not set
36725 +# CONFIG_DEBUG_SPINLOCK is not set
36726 +# CONFIG_DEBUG_MUTEXES is not set
36727 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
36728 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
36729 +# CONFIG_DEBUG_KOBJECT is not set
36730 +# CONFIG_DEBUG_BUGVERBOSE is not set
36731 +CONFIG_DEBUG_INFO=y
36732 +# CONFIG_DEBUG_VM is not set
36733 +# CONFIG_DEBUG_LIST is not set
36734 +# CONFIG_DEBUG_SG is not set
36735 +CONFIG_FORCED_INLINING=y
36736 +# CONFIG_BOOT_PRINTK_DELAY is not set
36737 +# CONFIG_RCU_TORTURE_TEST is not set
36738 +# CONFIG_FAULT_INJECTION is not set
36739 +# CONFIG_SAMPLES is not set
36740 +# CONFIG_DEBUG_STACKOVERFLOW is not set
36741 +# CONFIG_DEBUG_STACK_USAGE is not set
36742 +# CONFIG_DEBUG_PAGEALLOC is not set
36743 +# CONFIG_DEBUGGER is not set
36744 +CONFIG_BDI_SWITCH=y
36745 +# CONFIG_PPC_EARLY_DEBUG is not set
36746 +
36747 +#
36748 +# Security options
36749 +#
36750 +# CONFIG_KEYS is not set
36751 +# CONFIG_SECURITY is not set
36752 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
36753 +# CONFIG_CRYPTO is not set
36754 +# CONFIG_PPC_CLOCK is not set
36755 Index: linux-2.6.24.7/arch/powerpc/kernel/Makefile
36756 ===================================================================
36757 --- linux-2.6.24.7.orig/arch/powerpc/kernel/Makefile
36758 +++ linux-2.6.24.7/arch/powerpc/kernel/Makefile
36759 @@ -3,7 +3,7 @@
36760  #
36761  
36762  ifeq ($(CONFIG_PPC64),y)
36763 -EXTRA_CFLAGS   += -mno-minimal-toc
36764 +CFLAGS_prom_init.o     += -mno-minimal-toc
36765  endif
36766  ifeq ($(CONFIG_PPC32),y)
36767  CFLAGS_prom_init.o      += -fPIC
36768 @@ -70,6 +70,7 @@ pci64-$(CONFIG_PPC64)         += pci_dn.o isa-b
36769  obj-$(CONFIG_PCI)              += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
36770                                    pci-common.o
36771  obj-$(CONFIG_PCI_MSI)          += msi.o
36772 +obj-$(CONFIG_RAPIDIO)          += rio.o
36773  obj-$(CONFIG_KEXEC)            += machine_kexec.o crash.o \
36774                                    machine_kexec_$(CONFIG_WORD_SIZE).o
36775  obj-$(CONFIG_AUDIT)            += audit.o
36776 @@ -91,3 +92,13 @@ obj-$(CONFIG_PPC64)          += $(obj64-y)
36777  
36778  extra-$(CONFIG_PPC_FPU)                += fpu.o
36779  extra-$(CONFIG_PPC64)          += entry_64.o
36780 +
36781 +extra-y                                += systbl_chk.i
36782 +$(obj)/systbl.o:               systbl_chk
36783 +
36784 +quiet_cmd_systbl_chk = CALL    $<
36785 +      cmd_systbl_chk = $(CONFIG_SHELL) $< $(obj)/systbl_chk.i
36786 +
36787 +PHONY += systbl_chk
36788 +systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
36789 +       $(call cmd,systbl_chk)
36790 Index: linux-2.6.24.7/arch/powerpc/kernel/btext.c
36791 ===================================================================
36792 --- linux-2.6.24.7.orig/arch/powerpc/kernel/btext.c
36793 +++ linux-2.6.24.7/arch/powerpc/kernel/btext.c
36794 @@ -236,7 +236,7 @@ int __init btext_find_display(int allow_
36795         if (rc == 0 || !allow_nonstdout)
36796                 return rc;
36797  
36798 -       for (np = NULL; (np = of_find_node_by_type(np, "display"));) {
36799 +       for_each_node_by_type(np, "display") {
36800                 if (of_get_property(np, "linux,opened", NULL)) {
36801                         printk("trying %s ...\n", np->full_name);
36802                         rc = btext_initialize(np);
36803 Index: linux-2.6.24.7/arch/powerpc/kernel/cpu_setup_44x.S
36804 ===================================================================
36805 --- linux-2.6.24.7.orig/arch/powerpc/kernel/cpu_setup_44x.S
36806 +++ linux-2.6.24.7/arch/powerpc/kernel/cpu_setup_44x.S
36807 @@ -23,11 +23,24 @@ _GLOBAL(__setup_cpu_440epx)
36808         mflr    r4
36809         bl      __init_fpu_44x
36810         bl      __plb_disable_wrp
36811 +       bl      __fixup_440A_mcheck
36812         mtlr    r4
36813         blr
36814  _GLOBAL(__setup_cpu_440grx)
36815 -       b       __plb_disable_wrp
36816 +       mflr    r4
36817 +       bl      __plb_disable_wrp
36818 +       bl      __fixup_440A_mcheck
36819 +       mtlr    r4
36820 +       blr
36821 +_GLOBAL(__setup_cpu_440gx)
36822 +_GLOBAL(__setup_cpu_440spe)
36823 +       b       __fixup_440A_mcheck
36824  
36825 + /* Temporary fixup for arch/ppc until we kill the whole thing */
36826 +#ifndef CONFIG_PPC_MERGE
36827 +_GLOBAL(__fixup_440A_mcheck)
36828 +       blr
36829 +#endif
36830  
36831  /* enable APU between CPU and FPU */
36832  _GLOBAL(__init_fpu_44x)
36833 Index: linux-2.6.24.7/arch/powerpc/kernel/cputable.c
36834 ===================================================================
36835 --- linux-2.6.24.7.orig/arch/powerpc/kernel/cputable.c
36836 +++ linux-2.6.24.7/arch/powerpc/kernel/cputable.c
36837 @@ -33,7 +33,9 @@ EXPORT_SYMBOL(cur_cpu_spec);
36838  #ifdef CONFIG_PPC32
36839  extern void __setup_cpu_440ep(unsigned long offset, struct cpu_spec* spec);
36840  extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
36841 +extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
36842  extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
36843 +extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
36844  extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
36845  extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
36846  extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
36847 @@ -85,6 +87,7 @@ static struct cpu_spec __initdata cpu_sp
36848                 .pmc_type               = PPC_PMC_IBM,
36849                 .oprofile_cpu_type      = "ppc64/power3",
36850                 .oprofile_type          = PPC_OPROFILE_RS64,
36851 +               .machine_check          = machine_check_generic,
36852                 .platform               = "power3",
36853         },
36854         {       /* Power3+ */
36855 @@ -99,6 +102,7 @@ static struct cpu_spec __initdata cpu_sp
36856                 .pmc_type               = PPC_PMC_IBM,
36857                 .oprofile_cpu_type      = "ppc64/power3",
36858                 .oprofile_type          = PPC_OPROFILE_RS64,
36859 +               .machine_check          = machine_check_generic,
36860                 .platform               = "power3",
36861         },
36862         {       /* Northstar */
36863 @@ -113,6 +117,7 @@ static struct cpu_spec __initdata cpu_sp
36864                 .pmc_type               = PPC_PMC_IBM,
36865                 .oprofile_cpu_type      = "ppc64/rs64",
36866                 .oprofile_type          = PPC_OPROFILE_RS64,
36867 +               .machine_check          = machine_check_generic,
36868                 .platform               = "rs64",
36869         },
36870         {       /* Pulsar */
36871 @@ -127,6 +132,7 @@ static struct cpu_spec __initdata cpu_sp
36872                 .pmc_type               = PPC_PMC_IBM,
36873                 .oprofile_cpu_type      = "ppc64/rs64",
36874                 .oprofile_type          = PPC_OPROFILE_RS64,
36875 +               .machine_check          = machine_check_generic,
36876                 .platform               = "rs64",
36877         },
36878         {       /* I-star */
36879 @@ -141,6 +147,7 @@ static struct cpu_spec __initdata cpu_sp
36880                 .pmc_type               = PPC_PMC_IBM,
36881                 .oprofile_cpu_type      = "ppc64/rs64",
36882                 .oprofile_type          = PPC_OPROFILE_RS64,
36883 +               .machine_check          = machine_check_generic,
36884                 .platform               = "rs64",
36885         },
36886         {       /* S-star */
36887 @@ -155,6 +162,7 @@ static struct cpu_spec __initdata cpu_sp
36888                 .pmc_type               = PPC_PMC_IBM,
36889                 .oprofile_cpu_type      = "ppc64/rs64",
36890                 .oprofile_type          = PPC_OPROFILE_RS64,
36891 +               .machine_check          = machine_check_generic,
36892                 .platform               = "rs64",
36893         },
36894         {       /* Power4 */
36895 @@ -169,6 +177,7 @@ static struct cpu_spec __initdata cpu_sp
36896                 .pmc_type               = PPC_PMC_IBM,
36897                 .oprofile_cpu_type      = "ppc64/power4",
36898                 .oprofile_type          = PPC_OPROFILE_POWER4,
36899 +               .machine_check          = machine_check_generic,
36900                 .platform               = "power4",
36901         },
36902         {       /* Power4+ */
36903 @@ -183,6 +192,7 @@ static struct cpu_spec __initdata cpu_sp
36904                 .pmc_type               = PPC_PMC_IBM,
36905                 .oprofile_cpu_type      = "ppc64/power4",
36906                 .oprofile_type          = PPC_OPROFILE_POWER4,
36907 +               .machine_check          = machine_check_generic,
36908                 .platform               = "power4",
36909         },
36910         {       /* PPC970 */
36911 @@ -200,6 +210,7 @@ static struct cpu_spec __initdata cpu_sp
36912                 .cpu_restore            = __restore_cpu_ppc970,
36913                 .oprofile_cpu_type      = "ppc64/970",
36914                 .oprofile_type          = PPC_OPROFILE_POWER4,
36915 +               .machine_check          = machine_check_generic,
36916                 .platform               = "ppc970",
36917         },
36918         {       /* PPC970FX */
36919 @@ -217,6 +228,7 @@ static struct cpu_spec __initdata cpu_sp
36920                 .cpu_restore            = __restore_cpu_ppc970,
36921                 .oprofile_cpu_type      = "ppc64/970",
36922                 .oprofile_type          = PPC_OPROFILE_POWER4,
36923 +               .machine_check          = machine_check_generic,
36924                 .platform               = "ppc970",
36925         },
36926         {       /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */
36927 @@ -234,6 +246,7 @@ static struct cpu_spec __initdata cpu_sp
36928                 .cpu_restore            = __restore_cpu_ppc970,
36929                 .oprofile_cpu_type      = "ppc64/970MP",
36930                 .oprofile_type          = PPC_OPROFILE_POWER4,
36931 +               .machine_check          = machine_check_generic,
36932                 .platform               = "ppc970",
36933         },
36934         {       /* PPC970MP */
36935 @@ -251,6 +264,7 @@ static struct cpu_spec __initdata cpu_sp
36936                 .cpu_restore            = __restore_cpu_ppc970,
36937                 .oprofile_cpu_type      = "ppc64/970MP",
36938                 .oprofile_type          = PPC_OPROFILE_POWER4,
36939 +               .machine_check          = machine_check_generic,
36940                 .platform               = "ppc970",
36941         },
36942         {       /* PPC970GX */
36943 @@ -267,6 +281,7 @@ static struct cpu_spec __initdata cpu_sp
36944                 .cpu_setup              = __setup_cpu_ppc970,
36945                 .oprofile_cpu_type      = "ppc64/970",
36946                 .oprofile_type          = PPC_OPROFILE_POWER4,
36947 +               .machine_check          = machine_check_generic,
36948                 .platform               = "ppc970",
36949         },
36950         {       /* Power5 GR */
36951 @@ -286,6 +301,7 @@ static struct cpu_spec __initdata cpu_sp
36952                  */
36953                 .oprofile_mmcra_sihv    = MMCRA_SIHV,
36954                 .oprofile_mmcra_sipr    = MMCRA_SIPR,
36955 +               .machine_check          = machine_check_generic,
36956                 .platform               = "power5",
36957         },
36958         {       /* Power5++ */
36959 @@ -301,6 +317,7 @@ static struct cpu_spec __initdata cpu_sp
36960                 .oprofile_type          = PPC_OPROFILE_POWER4,
36961                 .oprofile_mmcra_sihv    = MMCRA_SIHV,
36962                 .oprofile_mmcra_sipr    = MMCRA_SIPR,
36963 +               .machine_check          = machine_check_generic,
36964                 .platform               = "power5+",
36965         },
36966         {       /* Power5 GS */
36967 @@ -317,6 +334,7 @@ static struct cpu_spec __initdata cpu_sp
36968                 .oprofile_type          = PPC_OPROFILE_POWER4,
36969                 .oprofile_mmcra_sihv    = MMCRA_SIHV,
36970                 .oprofile_mmcra_sipr    = MMCRA_SIPR,
36971 +               .machine_check          = machine_check_generic,
36972                 .platform               = "power5+",
36973         },
36974         {       /* POWER6 in P5+ mode; 2.04-compliant processor */
36975 @@ -327,6 +345,7 @@ static struct cpu_spec __initdata cpu_sp
36976                 .cpu_user_features      = COMMON_USER_POWER5_PLUS,
36977                 .icache_bsize           = 128,
36978                 .dcache_bsize           = 128,
36979 +               .machine_check          = machine_check_generic,
36980                 .platform               = "power5+",
36981         },
36982         {       /* Power6 */
36983 @@ -346,6 +365,7 @@ static struct cpu_spec __initdata cpu_sp
36984                 .oprofile_mmcra_sipr    = POWER6_MMCRA_SIPR,
36985                 .oprofile_mmcra_clear   = POWER6_MMCRA_THRM |
36986                         POWER6_MMCRA_OTHER,
36987 +               .machine_check          = machine_check_generic,
36988                 .platform               = "power6x",
36989         },
36990         {       /* 2.05-compliant processor, i.e. Power6 "architected" mode */
36991 @@ -356,6 +376,7 @@ static struct cpu_spec __initdata cpu_sp
36992                 .cpu_user_features      = COMMON_USER_POWER6,
36993                 .icache_bsize           = 128,
36994                 .dcache_bsize           = 128,
36995 +               .machine_check          = machine_check_generic,
36996                 .platform               = "power6",
36997         },
36998         {       /* Cell Broadband Engine */
36999 @@ -372,6 +393,7 @@ static struct cpu_spec __initdata cpu_sp
37000                 .pmc_type               = PPC_PMC_IBM,
37001                 .oprofile_cpu_type      = "ppc64/cell-be",
37002                 .oprofile_type          = PPC_OPROFILE_CELL,
37003 +               .machine_check          = machine_check_generic,
37004                 .platform               = "ppc-cell-be",
37005         },
37006         {       /* PA Semi PA6T */
37007 @@ -388,6 +410,7 @@ static struct cpu_spec __initdata cpu_sp
37008                 .cpu_restore            = __restore_cpu_pa6t,
37009                 .oprofile_cpu_type      = "ppc64/pa6t",
37010                 .oprofile_type          = PPC_OPROFILE_PA6T,
37011 +               .machine_check          = machine_check_generic,
37012                 .platform               = "pa6t",
37013         },
37014         {       /* default match */
37015 @@ -400,6 +423,7 @@ static struct cpu_spec __initdata cpu_sp
37016                 .dcache_bsize           = 128,
37017                 .num_pmcs               = 6,
37018                 .pmc_type               = PPC_PMC_IBM,
37019 +               .machine_check          = machine_check_generic,
37020                 .platform               = "power4",
37021         }
37022  #endif /* CONFIG_PPC64 */
37023 @@ -414,6 +438,7 @@ static struct cpu_spec __initdata cpu_sp
37024                         PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
37025                 .icache_bsize           = 32,
37026                 .dcache_bsize           = 32,
37027 +               .machine_check          = machine_check_generic,
37028                 .platform               = "ppc601",
37029         },
37030         {       /* 603 */
37031 @@ -425,6 +450,7 @@ static struct cpu_spec __initdata cpu_sp
37032                 .icache_bsize           = 32,
37033                 .dcache_bsize           = 32,
37034                 .cpu_setup              = __setup_cpu_603,
37035 +               .machine_check          = machine_check_generic,
37036                 .platform               = "ppc603",
37037         },
37038         {       /* 603e */
37039 @@ -436,6 +462,7 @@ static struct cpu_spec __initdata cpu_sp
37040                 .icache_bsize           = 32,
37041                 .dcache_bsize           = 32,
37042                 .cpu_setup              = __setup_cpu_603,
37043 +               .machine_check          = machine_check_generic,
37044                 .platform               = "ppc603",
37045         },
37046         {       /* 603ev */
37047 @@ -447,6 +474,7 @@ static struct cpu_spec __initdata cpu_sp
37048                 .icache_bsize           = 32,
37049                 .dcache_bsize           = 32,
37050                 .cpu_setup              = __setup_cpu_603,
37051 +               .machine_check          = machine_check_generic,
37052                 .platform               = "ppc603",
37053         },
37054         {       /* 604 */
37055 @@ -459,6 +487,7 @@ static struct cpu_spec __initdata cpu_sp
37056                 .dcache_bsize           = 32,
37057                 .num_pmcs               = 2,
37058                 .cpu_setup              = __setup_cpu_604,
37059 +               .machine_check          = machine_check_generic,
37060                 .platform               = "ppc604",
37061         },
37062         {       /* 604e */
37063 @@ -471,6 +500,7 @@ static struct cpu_spec __initdata cpu_sp
37064                 .dcache_bsize           = 32,
37065                 .num_pmcs               = 4,
37066                 .cpu_setup              = __setup_cpu_604,
37067 +               .machine_check          = machine_check_generic,
37068                 .platform               = "ppc604",
37069         },
37070         {       /* 604r */
37071 @@ -483,6 +513,7 @@ static struct cpu_spec __initdata cpu_sp
37072                 .dcache_bsize           = 32,
37073                 .num_pmcs               = 4,
37074                 .cpu_setup              = __setup_cpu_604,
37075 +               .machine_check          = machine_check_generic,
37076                 .platform               = "ppc604",
37077         },
37078         {       /* 604ev */
37079 @@ -495,6 +526,7 @@ static struct cpu_spec __initdata cpu_sp
37080                 .dcache_bsize           = 32,
37081                 .num_pmcs               = 4,
37082                 .cpu_setup              = __setup_cpu_604,
37083 +               .machine_check          = machine_check_generic,
37084                 .platform               = "ppc604",
37085         },
37086         {       /* 740/750 (0x4202, don't support TAU ?) */
37087 @@ -507,6 +539,7 @@ static struct cpu_spec __initdata cpu_sp
37088                 .dcache_bsize           = 32,
37089                 .num_pmcs               = 4,
37090                 .cpu_setup              = __setup_cpu_750,
37091 +               .machine_check          = machine_check_generic,
37092                 .platform               = "ppc750",
37093         },
37094         {       /* 750CX (80100 and 8010x?) */
37095 @@ -519,6 +552,7 @@ static struct cpu_spec __initdata cpu_sp
37096                 .dcache_bsize           = 32,
37097                 .num_pmcs               = 4,
37098                 .cpu_setup              = __setup_cpu_750cx,
37099 +               .machine_check          = machine_check_generic,
37100                 .platform               = "ppc750",
37101         },
37102         {       /* 750CX (82201 and 82202) */
37103 @@ -531,6 +565,7 @@ static struct cpu_spec __initdata cpu_sp
37104                 .dcache_bsize           = 32,
37105                 .num_pmcs               = 4,
37106                 .cpu_setup              = __setup_cpu_750cx,
37107 +               .machine_check          = machine_check_generic,
37108                 .platform               = "ppc750",
37109         },
37110         {       /* 750CXe (82214) */
37111 @@ -543,6 +578,7 @@ static struct cpu_spec __initdata cpu_sp
37112                 .dcache_bsize           = 32,
37113                 .num_pmcs               = 4,
37114                 .cpu_setup              = __setup_cpu_750cx,
37115 +               .machine_check          = machine_check_generic,
37116                 .platform               = "ppc750",
37117         },
37118         {       /* 750CXe "Gekko" (83214) */
37119 @@ -555,6 +591,7 @@ static struct cpu_spec __initdata cpu_sp
37120                 .dcache_bsize           = 32,
37121                 .num_pmcs               = 4,
37122                 .cpu_setup              = __setup_cpu_750cx,
37123 +               .machine_check          = machine_check_generic,
37124                 .platform               = "ppc750",
37125         },
37126         {       /* 750CL */
37127 @@ -567,6 +604,7 @@ static struct cpu_spec __initdata cpu_sp
37128                 .dcache_bsize           = 32,
37129                 .num_pmcs               = 4,
37130                 .cpu_setup              = __setup_cpu_750,
37131 +               .machine_check          = machine_check_generic,
37132                 .platform               = "ppc750",
37133         },
37134         {       /* 745/755 */
37135 @@ -579,6 +617,7 @@ static struct cpu_spec __initdata cpu_sp
37136                 .dcache_bsize           = 32,
37137                 .num_pmcs               = 4,
37138                 .cpu_setup              = __setup_cpu_750,
37139 +               .machine_check          = machine_check_generic,
37140                 .platform               = "ppc750",
37141         },
37142         {       /* 750FX rev 1.x */
37143 @@ -591,6 +630,7 @@ static struct cpu_spec __initdata cpu_sp
37144                 .dcache_bsize           = 32,
37145                 .num_pmcs               = 4,
37146                 .cpu_setup              = __setup_cpu_750,
37147 +               .machine_check          = machine_check_generic,
37148                 .platform               = "ppc750",
37149         },
37150         {       /* 750FX rev 2.0 must disable HID0[DPM] */
37151 @@ -603,6 +643,7 @@ static struct cpu_spec __initdata cpu_sp
37152                 .dcache_bsize           = 32,
37153                 .num_pmcs               = 4,
37154                 .cpu_setup              = __setup_cpu_750,
37155 +               .machine_check          = machine_check_generic,
37156                 .platform               = "ppc750",
37157         },
37158         {       /* 750FX (All revs except 2.0) */
37159 @@ -615,6 +656,7 @@ static struct cpu_spec __initdata cpu_sp
37160                 .dcache_bsize           = 32,
37161                 .num_pmcs               = 4,
37162                 .cpu_setup              = __setup_cpu_750fx,
37163 +               .machine_check          = machine_check_generic,
37164                 .platform               = "ppc750",
37165         },
37166         {       /* 750GX */
37167 @@ -627,6 +669,7 @@ static struct cpu_spec __initdata cpu_sp
37168                 .dcache_bsize           = 32,
37169                 .num_pmcs               = 4,
37170                 .cpu_setup              = __setup_cpu_750fx,
37171 +               .machine_check          = machine_check_generic,
37172                 .platform               = "ppc750",
37173         },
37174         {       /* 740/750 (L2CR bit need fixup for 740) */
37175 @@ -639,6 +682,7 @@ static struct cpu_spec __initdata cpu_sp
37176                 .dcache_bsize           = 32,
37177                 .num_pmcs               = 4,
37178                 .cpu_setup              = __setup_cpu_750,
37179 +               .machine_check          = machine_check_generic,
37180                 .platform               = "ppc750",
37181         },
37182         {       /* 7400 rev 1.1 ? (no TAU) */
37183 @@ -652,6 +696,7 @@ static struct cpu_spec __initdata cpu_sp
37184                 .dcache_bsize           = 32,
37185                 .num_pmcs               = 4,
37186                 .cpu_setup              = __setup_cpu_7400,
37187 +               .machine_check          = machine_check_generic,
37188                 .platform               = "ppc7400",
37189         },
37190         {       /* 7400 */
37191 @@ -665,6 +710,7 @@ static struct cpu_spec __initdata cpu_sp
37192                 .dcache_bsize           = 32,
37193                 .num_pmcs               = 4,
37194                 .cpu_setup              = __setup_cpu_7400,
37195 +               .machine_check          = machine_check_generic,
37196                 .platform               = "ppc7400",
37197         },
37198         {       /* 7410 */
37199 @@ -678,6 +724,7 @@ static struct cpu_spec __initdata cpu_sp
37200                 .dcache_bsize           = 32,
37201                 .num_pmcs               = 4,
37202                 .cpu_setup              = __setup_cpu_7410,
37203 +               .machine_check          = machine_check_generic,
37204                 .platform               = "ppc7400",
37205         },
37206         {       /* 7450 2.0 - no doze/nap */
37207 @@ -693,6 +740,7 @@ static struct cpu_spec __initdata cpu_sp
37208                 .cpu_setup              = __setup_cpu_745x,
37209                 .oprofile_cpu_type      = "ppc/7450",
37210                 .oprofile_type          = PPC_OPROFILE_G4,
37211 +               .machine_check          = machine_check_generic,
37212                 .platform               = "ppc7450",
37213         },
37214         {       /* 7450 2.1 */
37215 @@ -708,6 +756,7 @@ static struct cpu_spec __initdata cpu_sp
37216                 .cpu_setup              = __setup_cpu_745x,
37217                 .oprofile_cpu_type      = "ppc/7450",
37218                 .oprofile_type          = PPC_OPROFILE_G4,
37219 +               .machine_check          = machine_check_generic,
37220                 .platform               = "ppc7450",
37221         },
37222         {       /* 7450 2.3 and newer */
37223 @@ -723,6 +772,7 @@ static struct cpu_spec __initdata cpu_sp
37224                 .cpu_setup              = __setup_cpu_745x,
37225                 .oprofile_cpu_type      = "ppc/7450",
37226                 .oprofile_type          = PPC_OPROFILE_G4,
37227 +               .machine_check          = machine_check_generic,
37228                 .platform               = "ppc7450",
37229         },
37230         {       /* 7455 rev 1.x */
37231 @@ -738,6 +788,7 @@ static struct cpu_spec __initdata cpu_sp
37232                 .cpu_setup              = __setup_cpu_745x,
37233                 .oprofile_cpu_type      = "ppc/7450",
37234                 .oprofile_type          = PPC_OPROFILE_G4,
37235 +               .machine_check          = machine_check_generic,
37236                 .platform               = "ppc7450",
37237         },
37238         {       /* 7455 rev 2.0 */
37239 @@ -753,6 +804,7 @@ static struct cpu_spec __initdata cpu_sp
37240                 .cpu_setup              = __setup_cpu_745x,
37241                 .oprofile_cpu_type      = "ppc/7450",
37242                 .oprofile_type          = PPC_OPROFILE_G4,
37243 +               .machine_check          = machine_check_generic,
37244                 .platform               = "ppc7450",
37245         },
37246         {       /* 7455 others */
37247 @@ -768,6 +820,7 @@ static struct cpu_spec __initdata cpu_sp
37248                 .cpu_setup              = __setup_cpu_745x,
37249                 .oprofile_cpu_type      = "ppc/7450",
37250                 .oprofile_type          = PPC_OPROFILE_G4,
37251 +               .machine_check          = machine_check_generic,
37252                 .platform               = "ppc7450",
37253         },
37254         {       /* 7447/7457 Rev 1.0 */
37255 @@ -783,6 +836,7 @@ static struct cpu_spec __initdata cpu_sp
37256                 .cpu_setup              = __setup_cpu_745x,
37257                 .oprofile_cpu_type      = "ppc/7450",
37258                 .oprofile_type          = PPC_OPROFILE_G4,
37259 +               .machine_check          = machine_check_generic,
37260                 .platform               = "ppc7450",
37261         },
37262         {       /* 7447/7457 Rev 1.1 */
37263 @@ -798,6 +852,7 @@ static struct cpu_spec __initdata cpu_sp
37264                 .cpu_setup              = __setup_cpu_745x,
37265                 .oprofile_cpu_type      = "ppc/7450",
37266                 .oprofile_type          = PPC_OPROFILE_G4,
37267 +               .machine_check          = machine_check_generic,
37268                 .platform               = "ppc7450",
37269         },
37270         {       /* 7447/7457 Rev 1.2 and later */
37271 @@ -812,6 +867,7 @@ static struct cpu_spec __initdata cpu_sp
37272                 .cpu_setup              = __setup_cpu_745x,
37273                 .oprofile_cpu_type      = "ppc/7450",
37274                 .oprofile_type          = PPC_OPROFILE_G4,
37275 +               .machine_check          = machine_check_generic,
37276                 .platform               = "ppc7450",
37277         },
37278         {       /* 7447A */
37279 @@ -827,6 +883,7 @@ static struct cpu_spec __initdata cpu_sp
37280                 .cpu_setup              = __setup_cpu_745x,
37281                 .oprofile_cpu_type      = "ppc/7450",
37282                 .oprofile_type          = PPC_OPROFILE_G4,
37283 +               .machine_check          = machine_check_generic,
37284                 .platform               = "ppc7450",
37285         },
37286         {       /* 7448 */
37287 @@ -842,6 +899,7 @@ static struct cpu_spec __initdata cpu_sp
37288                 .cpu_setup              = __setup_cpu_745x,
37289                 .oprofile_cpu_type      = "ppc/7450",
37290                 .oprofile_type          = PPC_OPROFILE_G4,
37291 +               .machine_check          = machine_check_generic,
37292                 .platform               = "ppc7450",
37293         },
37294         {       /* 82xx (8240, 8245, 8260 are all 603e cores) */
37295 @@ -853,6 +911,7 @@ static struct cpu_spec __initdata cpu_sp
37296                 .icache_bsize           = 32,
37297                 .dcache_bsize           = 32,
37298                 .cpu_setup              = __setup_cpu_603,
37299 +               .machine_check          = machine_check_generic,
37300                 .platform               = "ppc603",
37301         },
37302         {       /* All G2_LE (603e core, plus some) have the same pvr */
37303 @@ -864,6 +923,7 @@ static struct cpu_spec __initdata cpu_sp
37304                 .icache_bsize           = 32,
37305                 .dcache_bsize           = 32,
37306                 .cpu_setup              = __setup_cpu_603,
37307 +               .machine_check          = machine_check_generic,
37308                 .platform               = "ppc603",
37309         },
37310         {       /* e300c1 (a 603e core, plus some) on 83xx */
37311 @@ -875,6 +935,7 @@ static struct cpu_spec __initdata cpu_sp
37312                 .icache_bsize           = 32,
37313                 .dcache_bsize           = 32,
37314                 .cpu_setup              = __setup_cpu_603,
37315 +               .machine_check          = machine_check_generic,
37316                 .platform               = "ppc603",
37317         },
37318         {       /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
37319 @@ -886,9 +947,10 @@ static struct cpu_spec __initdata cpu_sp
37320                 .icache_bsize           = 32,
37321                 .dcache_bsize           = 32,
37322                 .cpu_setup              = __setup_cpu_603,
37323 +               .machine_check          = machine_check_generic,
37324                 .platform               = "ppc603",
37325         },
37326 -       {       /* e300c3 on 83xx  */
37327 +       {       /* e300c3 (e300c1, plus one IU, half cache size) on 83xx */
37328                 .pvr_mask               = 0x7fff0000,
37329                 .pvr_value              = 0x00850000,
37330                 .cpu_name               = "e300c3",
37331 @@ -899,6 +961,18 @@ static struct cpu_spec __initdata cpu_sp
37332                 .cpu_setup              = __setup_cpu_603,
37333                 .platform               = "ppc603",
37334         },
37335 +       {       /* e300c4 (e300c1, plus one IU) */
37336 +               .pvr_mask               = 0x7fff0000,
37337 +               .pvr_value              = 0x00860000,
37338 +               .cpu_name               = "e300c4",
37339 +               .cpu_features           = CPU_FTRS_E300,
37340 +               .cpu_user_features      = COMMON_USER,
37341 +               .icache_bsize           = 32,
37342 +               .dcache_bsize           = 32,
37343 +               .cpu_setup              = __setup_cpu_603,
37344 +               .machine_check          = machine_check_generic,
37345 +               .platform               = "ppc603",
37346 +       },
37347         {       /* default match, we assume split I/D cache & TB (non-601)... */
37348                 .pvr_mask               = 0x00000000,
37349                 .pvr_value              = 0x00000000,
37350 @@ -907,6 +981,7 @@ static struct cpu_spec __initdata cpu_sp
37351                 .cpu_user_features      = COMMON_USER,
37352                 .icache_bsize           = 32,
37353                 .dcache_bsize           = 32,
37354 +               .machine_check          = machine_check_generic,
37355                 .platform               = "ppc603",
37356         },
37357  #endif /* CLASSIC_PPC */
37358 @@ -933,6 +1008,7 @@ static struct cpu_spec __initdata cpu_sp
37359                 .cpu_user_features      = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
37360                 .icache_bsize           = 16,
37361                 .dcache_bsize           = 16,
37362 +               .machine_check          = machine_check_4xx,
37363                 .platform               = "ppc403",
37364         },
37365         {       /* 403GCX */
37366 @@ -944,6 +1020,7 @@ static struct cpu_spec __initdata cpu_sp
37367                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
37368                 .icache_bsize           = 16,
37369                 .dcache_bsize           = 16,
37370 +               .machine_check          = machine_check_4xx,
37371                 .platform               = "ppc403",
37372         },
37373         {       /* 403G ?? */
37374 @@ -954,6 +1031,7 @@ static struct cpu_spec __initdata cpu_sp
37375                 .cpu_user_features      = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
37376                 .icache_bsize           = 16,
37377                 .dcache_bsize           = 16,
37378 +               .machine_check          = machine_check_4xx,
37379                 .platform               = "ppc403",
37380         },
37381         {       /* 405GP */
37382 @@ -965,6 +1043,7 @@ static struct cpu_spec __initdata cpu_sp
37383                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37384                 .icache_bsize           = 32,
37385                 .dcache_bsize           = 32,
37386 +               .machine_check          = machine_check_4xx,
37387                 .platform               = "ppc405",
37388         },
37389         {       /* STB 03xxx */
37390 @@ -976,6 +1055,7 @@ static struct cpu_spec __initdata cpu_sp
37391                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37392                 .icache_bsize           = 32,
37393                 .dcache_bsize           = 32,
37394 +               .machine_check          = machine_check_4xx,
37395                 .platform               = "ppc405",
37396         },
37397         {       /* STB 04xxx */
37398 @@ -987,6 +1067,7 @@ static struct cpu_spec __initdata cpu_sp
37399                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37400                 .icache_bsize           = 32,
37401                 .dcache_bsize           = 32,
37402 +               .machine_check          = machine_check_4xx,
37403                 .platform               = "ppc405",
37404         },
37405         {       /* NP405L */
37406 @@ -998,6 +1079,7 @@ static struct cpu_spec __initdata cpu_sp
37407                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37408                 .icache_bsize           = 32,
37409                 .dcache_bsize           = 32,
37410 +               .machine_check          = machine_check_4xx,
37411                 .platform               = "ppc405",
37412         },
37413         {       /* NP4GS3 */
37414 @@ -1009,6 +1091,7 @@ static struct cpu_spec __initdata cpu_sp
37415                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37416                 .icache_bsize           = 32,
37417                 .dcache_bsize           = 32,
37418 +               .machine_check          = machine_check_4xx,
37419                 .platform               = "ppc405",
37420         },
37421         {   /* NP405H */
37422 @@ -1020,6 +1103,7 @@ static struct cpu_spec __initdata cpu_sp
37423                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37424                 .icache_bsize           = 32,
37425                 .dcache_bsize           = 32,
37426 +               .machine_check          = machine_check_4xx,
37427                 .platform               = "ppc405",
37428         },
37429         {       /* 405GPr */
37430 @@ -1031,6 +1115,7 @@ static struct cpu_spec __initdata cpu_sp
37431                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37432                 .icache_bsize           = 32,
37433                 .dcache_bsize           = 32,
37434 +               .machine_check          = machine_check_4xx,
37435                 .platform               = "ppc405",
37436         },
37437         {   /* STBx25xx */
37438 @@ -1042,6 +1127,7 @@ static struct cpu_spec __initdata cpu_sp
37439                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37440                 .icache_bsize           = 32,
37441                 .dcache_bsize           = 32,
37442 +               .machine_check          = machine_check_4xx,
37443                 .platform               = "ppc405",
37444         },
37445         {       /* 405LP */
37446 @@ -1052,6 +1138,7 @@ static struct cpu_spec __initdata cpu_sp
37447                 .cpu_user_features      = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
37448                 .icache_bsize           = 32,
37449                 .dcache_bsize           = 32,
37450 +               .machine_check          = machine_check_4xx,
37451                 .platform               = "ppc405",
37452         },
37453         {       /* Xilinx Virtex-II Pro  */
37454 @@ -1063,6 +1150,7 @@ static struct cpu_spec __initdata cpu_sp
37455                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37456                 .icache_bsize           = 32,
37457                 .dcache_bsize           = 32,
37458 +               .machine_check          = machine_check_4xx,
37459                 .platform               = "ppc405",
37460         },
37461         {       /* Xilinx Virtex-4 FX */
37462 @@ -1074,6 +1162,7 @@ static struct cpu_spec __initdata cpu_sp
37463                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37464                 .icache_bsize           = 32,
37465                 .dcache_bsize           = 32,
37466 +               .machine_check          = machine_check_4xx,
37467                 .platform               = "ppc405",
37468         },
37469         {       /* 405EP */
37470 @@ -1085,17 +1174,31 @@ static struct cpu_spec __initdata cpu_sp
37471                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37472                 .icache_bsize           = 32,
37473                 .dcache_bsize           = 32,
37474 +               .machine_check          = machine_check_4xx,
37475                 .platform               = "ppc405",
37476         },
37477         {       /* 405EX */
37478 -               .pvr_mask               = 0xffff0000,
37479 -               .pvr_value              = 0x12910000,
37480 +               .pvr_mask               = 0xffff0004,
37481 +               .pvr_value              = 0x12910004,
37482                 .cpu_name               = "405EX",
37483                 .cpu_features           = CPU_FTRS_40X,
37484                 .cpu_user_features      = PPC_FEATURE_32 |
37485                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37486                 .icache_bsize           = 32,
37487                 .dcache_bsize           = 32,
37488 +               .machine_check          = machine_check_4xx,
37489 +               .platform               = "ppc405",
37490 +       },
37491 +       {       /* 405EXr */
37492 +               .pvr_mask               = 0xffff0004,
37493 +               .pvr_value              = 0x12910000,
37494 +               .cpu_name               = "405EXr",
37495 +               .cpu_features           = CPU_FTRS_40X,
37496 +               .cpu_user_features      = PPC_FEATURE_32 |
37497 +                       PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37498 +               .icache_bsize           = 32,
37499 +               .dcache_bsize           = 32,
37500 +               .machine_check          = machine_check_4xx,
37501                 .platform               = "ppc405",
37502         },
37503  
37504 @@ -1109,6 +1212,7 @@ static struct cpu_spec __initdata cpu_sp
37505                 .cpu_user_features      = COMMON_USER_BOOKE,
37506                 .icache_bsize           = 32,
37507                 .dcache_bsize           = 32,
37508 +               .machine_check          = machine_check_4xx,
37509                 .platform               = "ppc440",
37510         },
37511         { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */
37512 @@ -1120,6 +1224,7 @@ static struct cpu_spec __initdata cpu_sp
37513                 .icache_bsize           = 32,
37514                 .dcache_bsize           = 32,
37515                 .cpu_setup              = __setup_cpu_440ep,
37516 +               .machine_check          = machine_check_4xx,
37517                 .platform               = "ppc440",
37518         },
37519         {
37520 @@ -1130,6 +1235,19 @@ static struct cpu_spec __initdata cpu_sp
37521                 .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
37522                 .icache_bsize           = 32,
37523                 .dcache_bsize           = 32,
37524 +               .machine_check          = machine_check_4xx,
37525 +               .platform               = "ppc440",
37526 +       },
37527 +       { /* Matches both physical and logical PVR for 440EP (logical pvr = pvr | 0x8) */
37528 +               .pvr_mask               = 0xf0000ff7,
37529 +               .pvr_value              = 0x400008d4,
37530 +               .cpu_name               = "440EP Rev. C",
37531 +               .cpu_features           = CPU_FTRS_44X,
37532 +               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
37533 +               .icache_bsize           = 32,
37534 +               .dcache_bsize           = 32,
37535 +               .cpu_setup              = __setup_cpu_440ep,
37536 +               .machine_check          = machine_check_4xx,
37537                 .platform               = "ppc440",
37538         },
37539         { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */
37540 @@ -1141,6 +1259,7 @@ static struct cpu_spec __initdata cpu_sp
37541                 .icache_bsize           = 32,
37542                 .dcache_bsize           = 32,
37543                 .cpu_setup              = __setup_cpu_440ep,
37544 +               .machine_check          = machine_check_4xx,
37545                 .platform               = "ppc440",
37546         },
37547         { /* 440GRX */
37548 @@ -1152,6 +1271,7 @@ static struct cpu_spec __initdata cpu_sp
37549                 .icache_bsize           = 32,
37550                 .dcache_bsize           = 32,
37551                 .cpu_setup              = __setup_cpu_440grx,
37552 +               .machine_check          = machine_check_440A,
37553                 .platform               = "ppc440",
37554         },
37555         { /* Use logical PVR for 440EPx (logical pvr = pvr | 0x8) */
37556 @@ -1163,6 +1283,7 @@ static struct cpu_spec __initdata cpu_sp
37557                 .icache_bsize           = 32,
37558                 .dcache_bsize           = 32,
37559                 .cpu_setup              = __setup_cpu_440epx,
37560 +               .machine_check          = machine_check_440A,
37561                 .platform               = "ppc440",
37562         },
37563         {       /* 440GP Rev. B */
37564 @@ -1173,6 +1294,7 @@ static struct cpu_spec __initdata cpu_sp
37565                 .cpu_user_features      = COMMON_USER_BOOKE,
37566                 .icache_bsize           = 32,
37567                 .dcache_bsize           = 32,
37568 +               .machine_check          = machine_check_4xx,
37569                 .platform               = "ppc440gp",
37570         },
37571         {       /* 440GP Rev. C */
37572 @@ -1183,6 +1305,7 @@ static struct cpu_spec __initdata cpu_sp
37573                 .cpu_user_features      = COMMON_USER_BOOKE,
37574                 .icache_bsize           = 32,
37575                 .dcache_bsize           = 32,
37576 +               .machine_check          = machine_check_4xx,
37577                 .platform               = "ppc440gp",
37578         },
37579         { /* 440GX Rev. A */
37580 @@ -1193,6 +1316,8 @@ static struct cpu_spec __initdata cpu_sp
37581                 .cpu_user_features      = COMMON_USER_BOOKE,
37582                 .icache_bsize           = 32,
37583                 .dcache_bsize           = 32,
37584 +               .cpu_setup              = __setup_cpu_440gx,
37585 +               .machine_check          = machine_check_440A,
37586                 .platform               = "ppc440",
37587         },
37588         { /* 440GX Rev. B */
37589 @@ -1203,6 +1328,8 @@ static struct cpu_spec __initdata cpu_sp
37590                 .cpu_user_features      = COMMON_USER_BOOKE,
37591                 .icache_bsize           = 32,
37592                 .dcache_bsize           = 32,
37593 +               .cpu_setup              = __setup_cpu_440gx,
37594 +               .machine_check          = machine_check_440A,
37595                 .platform               = "ppc440",
37596         },
37597         { /* 440GX Rev. C */
37598 @@ -1213,6 +1340,8 @@ static struct cpu_spec __initdata cpu_sp
37599                 .cpu_user_features      = COMMON_USER_BOOKE,
37600                 .icache_bsize           = 32,
37601                 .dcache_bsize           = 32,
37602 +               .cpu_setup              = __setup_cpu_440gx,
37603 +               .machine_check          = machine_check_440A,
37604                 .platform               = "ppc440",
37605         },
37606         { /* 440GX Rev. F */
37607 @@ -1223,6 +1352,8 @@ static struct cpu_spec __initdata cpu_sp
37608                 .cpu_user_features      = COMMON_USER_BOOKE,
37609                 .icache_bsize           = 32,
37610                 .dcache_bsize           = 32,
37611 +               .cpu_setup              = __setup_cpu_440gx,
37612 +               .machine_check          = machine_check_440A,
37613                 .platform               = "ppc440",
37614         },
37615         { /* 440SP Rev. A */
37616 @@ -1233,6 +1364,7 @@ static struct cpu_spec __initdata cpu_sp
37617                 .cpu_user_features      = COMMON_USER_BOOKE,
37618                 .icache_bsize           = 32,
37619                 .dcache_bsize           = 32,
37620 +               .machine_check          = machine_check_4xx,
37621                 .platform               = "ppc440",
37622         },
37623         { /* 440SPe Rev. A */
37624 @@ -1243,6 +1375,8 @@ static struct cpu_spec __initdata cpu_sp
37625                 .cpu_user_features      = COMMON_USER_BOOKE,
37626                 .icache_bsize           = 32,
37627                 .dcache_bsize           = 32,
37628 +               .cpu_setup              = __setup_cpu_440spe,
37629 +               .machine_check          = machine_check_440A,
37630                 .platform               = "ppc440",
37631         },
37632         { /* 440SPe Rev. B */
37633 @@ -1253,10 +1387,13 @@ static struct cpu_spec __initdata cpu_sp
37634                 .cpu_user_features      = COMMON_USER_BOOKE,
37635                 .icache_bsize           = 32,
37636                 .dcache_bsize           = 32,
37637 +               .cpu_setup              = __setup_cpu_440spe,
37638 +               .machine_check          = machine_check_440A,
37639                 .platform               = "ppc440",
37640         },
37641  #endif /* CONFIG_44x */
37642  #ifdef CONFIG_FSL_BOOKE
37643 +#ifdef CONFIG_E200
37644         {       /* e200z5 */
37645                 .pvr_mask               = 0xfff00000,
37646                 .pvr_value              = 0x81000000,
37647 @@ -1267,6 +1404,7 @@ static struct cpu_spec __initdata cpu_sp
37648                         PPC_FEATURE_HAS_EFP_SINGLE |
37649                         PPC_FEATURE_UNIFIED_CACHE,
37650                 .dcache_bsize           = 32,
37651 +               .machine_check          = machine_check_e200,
37652                 .platform               = "ppc5554",
37653         },
37654         {       /* e200z6 */
37655 @@ -1280,8 +1418,10 @@ static struct cpu_spec __initdata cpu_sp
37656                         PPC_FEATURE_HAS_EFP_SINGLE_COMP |
37657                         PPC_FEATURE_UNIFIED_CACHE,
37658                 .dcache_bsize           = 32,
37659 +               .machine_check          = machine_check_e200,
37660                 .platform               = "ppc5554",
37661         },
37662 +#elif defined(CONFIG_E500)
37663         {       /* e500 */
37664                 .pvr_mask               = 0xffff0000,
37665                 .pvr_value              = 0x80200000,
37666 @@ -1296,6 +1436,7 @@ static struct cpu_spec __initdata cpu_sp
37667                 .num_pmcs               = 4,
37668                 .oprofile_cpu_type      = "ppc/e500",
37669                 .oprofile_type          = PPC_OPROFILE_BOOKE,
37670 +               .machine_check          = machine_check_e500,
37671                 .platform               = "ppc8540",
37672         },
37673         {       /* e500v2 */
37674 @@ -1313,9 +1454,11 @@ static struct cpu_spec __initdata cpu_sp
37675                 .num_pmcs               = 4,
37676                 .oprofile_cpu_type      = "ppc/e500",
37677                 .oprofile_type          = PPC_OPROFILE_BOOKE,
37678 +               .machine_check          = machine_check_e500,
37679                 .platform               = "ppc8548",
37680         },
37681  #endif
37682 +#endif
37683  #if !CLASSIC_PPC
37684         {       /* default match */
37685                 .pvr_mask               = 0x00000000,
37686 Index: linux-2.6.24.7/arch/powerpc/kernel/crash.c
37687 ===================================================================
37688 --- linux-2.6.24.7.orig/arch/powerpc/kernel/crash.c
37689 +++ linux-2.6.24.7/arch/powerpc/kernel/crash.c
37690 @@ -32,6 +32,8 @@
37691  #include <asm/lmb.h>
37692  #include <asm/firmware.h>
37693  #include <asm/smp.h>
37694 +#include <asm/system.h>
37695 +#include <asm/setjmp.h>
37696  
37697  #ifdef DEBUG
37698  #include <asm/udbg.h>
37699 @@ -45,6 +47,11 @@ int crashing_cpu = -1;
37700  static cpumask_t cpus_in_crash = CPU_MASK_NONE;
37701  cpumask_t cpus_in_sr = CPU_MASK_NONE;
37702  
37703 +#define CRASH_HANDLER_MAX 1
37704 +/* NULL terminated list of shutdown handles */
37705 +static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1];
37706 +static DEFINE_SPINLOCK(crash_handlers_lock);
37707 +
37708  #ifdef CONFIG_SMP
37709  static atomic_t enter_on_soft_reset = ATOMIC_INIT(0);
37710  
37711 @@ -285,9 +292,72 @@ static inline void crash_kexec_stop_spus
37712  }
37713  #endif /* CONFIG_SPU_BASE */
37714  
37715 +/*
37716 + * Register a function to be called on shutdown.  Only use this if you
37717 + * can't reset your device in the second kernel.
37718 + */
37719 +int crash_shutdown_register(crash_shutdown_t handler)
37720 +{
37721 +       unsigned int i, rc;
37722 +
37723 +       spin_lock(&crash_handlers_lock);
37724 +       for (i = 0 ; i < CRASH_HANDLER_MAX; i++)
37725 +               if (!crash_shutdown_handles[i]) {
37726 +                       /* Insert handle at first empty entry */
37727 +                       crash_shutdown_handles[i] = handler;
37728 +                       rc = 0;
37729 +                       break;
37730 +               }
37731 +
37732 +       if (i == CRASH_HANDLER_MAX) {
37733 +               printk(KERN_ERR "Crash shutdown handles full, "
37734 +                      "not registered.\n");
37735 +               rc = 1;
37736 +       }
37737 +
37738 +       spin_unlock(&crash_handlers_lock);
37739 +       return rc;
37740 +}
37741 +EXPORT_SYMBOL(crash_shutdown_register);
37742 +
37743 +int crash_shutdown_unregister(crash_shutdown_t handler)
37744 +{
37745 +       unsigned int i, rc;
37746 +
37747 +       spin_lock(&crash_handlers_lock);
37748 +       for (i = 0 ; i < CRASH_HANDLER_MAX; i++)
37749 +               if (crash_shutdown_handles[i] == handler)
37750 +                       break;
37751 +
37752 +       if (i == CRASH_HANDLER_MAX) {
37753 +               printk(KERN_ERR "Crash shutdown handle not found\n");
37754 +               rc = 1;
37755 +       } else {
37756 +               /* Shift handles down */
37757 +               for (; crash_shutdown_handles[i]; i++)
37758 +                       crash_shutdown_handles[i] =
37759 +                               crash_shutdown_handles[i+1];
37760 +               rc = 0;
37761 +       }
37762 +
37763 +       spin_unlock(&crash_handlers_lock);
37764 +       return rc;
37765 +}
37766 +EXPORT_SYMBOL(crash_shutdown_unregister);
37767 +
37768 +static unsigned long crash_shutdown_buf[JMP_BUF_LEN];
37769 +
37770 +static int handle_fault(struct pt_regs *regs)
37771 +{
37772 +       longjmp(crash_shutdown_buf, 1);
37773 +       return 0;
37774 +}
37775 +
37776  void default_machine_crash_shutdown(struct pt_regs *regs)
37777  {
37778 -       unsigned int irq;
37779 +       unsigned int i;
37780 +       int (*old_handler)(struct pt_regs *regs);
37781 +
37782  
37783         /*
37784          * This function is only called after the system
37785 @@ -301,15 +371,36 @@ void default_machine_crash_shutdown(stru
37786          */
37787         hard_irq_disable();
37788  
37789 -       for_each_irq(irq) {
37790 -               struct irq_desc *desc = irq_desc + irq;
37791 +       for_each_irq(i) {
37792 +               struct irq_desc *desc = irq_desc + i;
37793  
37794                 if (desc->status & IRQ_INPROGRESS)
37795 -                       desc->chip->eoi(irq);
37796 +                       desc->chip->eoi(i);
37797  
37798                 if (!(desc->status & IRQ_DISABLED))
37799 -                       desc->chip->disable(irq);
37800 +                       desc->chip->disable(i);
37801 +       }
37802 +
37803 +       /*
37804 +        * Call registered shutdown routines savely.  Swap out
37805 +        * __debugger_fault_handler, and replace on exit.
37806 +        */
37807 +       old_handler = __debugger_fault_handler;
37808 +       __debugger_fault_handler = handle_fault;
37809 +       for (i = 0; crash_shutdown_handles[i]; i++) {
37810 +               if (setjmp(crash_shutdown_buf) == 0) {
37811 +                       /*
37812 +                        * Insert syncs and delay to ensure
37813 +                        * instructions in the dangerous region don't
37814 +                        * leak away from this protected region.
37815 +                        */
37816 +                       asm volatile("sync; isync");
37817 +                       /* dangerous region */
37818 +                       crash_shutdown_handles[i]();
37819 +                       asm volatile("sync; isync");
37820 +               }
37821         }
37822 +       __debugger_fault_handler = old_handler;
37823  
37824         /*
37825          * Make a note of crashing cpu. Will be used in machine_kexec
37826 Index: linux-2.6.24.7/arch/powerpc/kernel/dma_64.c
37827 ===================================================================
37828 --- linux-2.6.24.7.orig/arch/powerpc/kernel/dma_64.c
37829 +++ linux-2.6.24.7/arch/powerpc/kernel/dma_64.c
37830 @@ -112,10 +112,16 @@ EXPORT_SYMBOL(dma_iommu_ops);
37831  /*
37832   * Generic direct DMA implementation
37833   *
37834 - * This implementation supports a global offset that can be applied if
37835 - * the address at which memory is visible to devices is not 0.
37836 + * This implementation supports a per-device offset that can be applied if
37837 + * the address at which memory is visible to devices is not 0. Platform code
37838 + * can set archdata.dma_data to an unsigned long holding the offset. By
37839 + * default the offset is zero.
37840   */
37841 -unsigned long dma_direct_offset;
37842 +
37843 +static unsigned long get_dma_direct_offset(struct device *dev)
37844 +{
37845 +       return (unsigned long)dev->archdata.dma_data;
37846 +}
37847  
37848  static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
37849                                        dma_addr_t *dma_handle, gfp_t flag)
37850 @@ -124,13 +130,12 @@ static void *dma_direct_alloc_coherent(s
37851         void *ret;
37852         int node = dev->archdata.numa_node;
37853  
37854 -       /* TODO: Maybe use the numa node here too ? */
37855         page = alloc_pages_node(node, flag, get_order(size));
37856         if (page == NULL)
37857                 return NULL;
37858         ret = page_address(page);
37859         memset(ret, 0, size);
37860 -       *dma_handle = virt_to_abs(ret) | dma_direct_offset;
37861 +       *dma_handle = virt_to_abs(ret) + get_dma_direct_offset(dev);
37862  
37863         return ret;
37864  }
37865 @@ -145,7 +150,7 @@ static dma_addr_t dma_direct_map_single(
37866                                         size_t size,
37867                                         enum dma_data_direction direction)
37868  {
37869 -       return virt_to_abs(ptr) | dma_direct_offset;
37870 +       return virt_to_abs(ptr) + get_dma_direct_offset(dev);
37871  }
37872  
37873  static void dma_direct_unmap_single(struct device *dev, dma_addr_t dma_addr,
37874 @@ -161,7 +166,7 @@ static int dma_direct_map_sg(struct devi
37875         int i;
37876  
37877         for_each_sg(sgl, sg, nents, i) {
37878 -               sg->dma_address = sg_phys(sg) | dma_direct_offset;
37879 +               sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
37880                 sg->dma_length = sg->length;
37881         }
37882  
37883 Index: linux-2.6.24.7/arch/powerpc/kernel/head_44x.S
37884 ===================================================================
37885 --- linux-2.6.24.7.orig/arch/powerpc/kernel/head_44x.S
37886 +++ linux-2.6.24.7/arch/powerpc/kernel/head_44x.S
37887 @@ -289,11 +289,8 @@ interrupt_base:
37888         CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
37889  
37890         /* Machine Check Interrupt */
37891 -#ifdef CONFIG_440A
37892 -       MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
37893 -#else
37894         CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
37895 -#endif
37896 +       MCHECK_EXCEPTION(0x0210, MachineCheckA, machine_check_exception)
37897  
37898         /* Data Storage Interrupt */
37899         START_EXCEPTION(DataStorage)
37900 @@ -674,6 +671,15 @@ finish_tlb_load:
37901   */
37902  
37903  /*
37904 + * Adjust the machine check IVOR on 440A cores
37905 + */
37906 +_GLOBAL(__fixup_440A_mcheck)
37907 +       li      r3,MachineCheckA@l
37908 +       mtspr   SPRN_IVOR1,r3
37909 +       sync
37910 +       blr
37911 +
37912 +/*
37913   * extern void giveup_altivec(struct task_struct *prev)
37914   *
37915   * The 44x core does not have an AltiVec unit.
37916 Index: linux-2.6.24.7/arch/powerpc/kernel/head_booke.h
37917 ===================================================================
37918 --- linux-2.6.24.7.orig/arch/powerpc/kernel/head_booke.h
37919 +++ linux-2.6.24.7/arch/powerpc/kernel/head_booke.h
37920 @@ -166,7 +166,7 @@ label:
37921         mfspr   r5,SPRN_ESR;                                    \
37922         stw     r5,_ESR(r11);                                   \
37923         addi    r3,r1,STACK_FRAME_OVERHEAD;                     \
37924 -       EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
37925 +       EXC_XFER_TEMPLATE(hdlr, n+4, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
37926                           NOCOPY, mcheck_transfer_to_handler,   \
37927                           ret_from_mcheck_exc)
37928  
37929 Index: linux-2.6.24.7/arch/powerpc/kernel/head_fsl_booke.S
37930 ===================================================================
37931 --- linux-2.6.24.7.orig/arch/powerpc/kernel/head_fsl_booke.S
37932 +++ linux-2.6.24.7/arch/powerpc/kernel/head_fsl_booke.S
37933 @@ -73,8 +73,8 @@ _ENTRY(_start);
37934  /* We try to not make any assumptions about how the boot loader
37935   * setup or used the TLBs.  We invalidate all mappings from the
37936   * boot loader and load a single entry in TLB1[0] to map the
37937 - * first 16M of kernel memory.  Any boot info passed from the
37938 - * bootloader needs to live in this first 16M.
37939 + * first 64M of kernel memory.  Any boot info passed from the
37940 + * bootloader needs to live in this first 64M.
37941   *
37942   * Requirement on bootloader:
37943   *  - The page we're executing in needs to reside in TLB1 and
37944 @@ -167,7 +167,7 @@ skpinv:     addi    r6,r6,1                         /* Increment */
37945         mtspr   SPRN_MAS0,r7
37946         tlbre
37947  
37948 -       /* Just modify the entry ID and EPN for the temp mapping */
37949 +       /* Just modify the entry ID, EPN and RPN for the temp mapping */
37950         lis     r7,0x1000       /* Set MAS0(TLBSEL) = 1 */
37951         rlwimi  r7,r5,16,4,15   /* Setup MAS0 = TLBSEL | ESEL(r5) */
37952         mtspr   SPRN_MAS0,r7
37953 @@ -177,9 +177,12 @@ skpinv:    addi    r6,r6,1                         /* Increment */
37954         ori     r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_4K))@l
37955         mtspr   SPRN_MAS1,r6
37956         mfspr   r6,SPRN_MAS2
37957 -       li      r7,0            /* temp EPN = 0 */
37958 +       lis     r7,PHYSICAL_START@h
37959         rlwimi  r7,r6,0,20,31
37960         mtspr   SPRN_MAS2,r7
37961 +       mfspr   r6,SPRN_MAS3
37962 +       rlwimi  r7,r6,0,20,31
37963 +       mtspr   SPRN_MAS3,r7
37964         tlbwe
37965  
37966         xori    r6,r4,1
37967 @@ -222,11 +225,11 @@ skpinv:   addi    r6,r6,1                         /* Increment */
37968         lis     r6,0x1000               /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */
37969         mtspr   SPRN_MAS0,r6
37970         lis     r6,(MAS1_VALID|MAS1_IPROT)@h
37971 -       ori     r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_16M))@l
37972 +       ori     r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_64M))@l
37973         mtspr   SPRN_MAS1,r6
37974         li      r7,0
37975 -       lis     r6,KERNELBASE@h
37976 -       ori     r6,r6,KERNELBASE@l
37977 +       lis     r6,PAGE_OFFSET@h
37978 +       ori     r6,r6,PAGE_OFFSET@l
37979         rlwimi  r6,r7,0,20,31
37980         mtspr   SPRN_MAS2,r6
37981         li      r7,(MAS3_SX|MAS3_SW|MAS3_SR)
37982 @@ -234,6 +237,9 @@ skpinv:     addi    r6,r6,1                         /* Increment */
37983         tlbwe
37984  
37985  /* 7. Jump to KERNELBASE mapping */
37986 +       lis     r6,KERNELBASE@h
37987 +       ori     r6,r6,KERNELBASE@l
37988 +       rlwimi  r6,r7,0,20,31
37989         lis     r7,MSR_KERNEL@h
37990         ori     r7,r7,MSR_KERNEL@l
37991         bl      1f                      /* Find our address */
37992 Index: linux-2.6.24.7/arch/powerpc/kernel/ibmebus.c
37993 ===================================================================
37994 --- linux-2.6.24.7.orig/arch/powerpc/kernel/ibmebus.c
37995 +++ linux-2.6.24.7/arch/powerpc/kernel/ibmebus.c
37996 @@ -41,6 +41,7 @@
37997  #include <linux/kobject.h>
37998  #include <linux/dma-mapping.h>
37999  #include <linux/interrupt.h>
38000 +#include <linux/of.h>
38001  #include <linux/of_platform.h>
38002  #include <asm/ibmebus.h>
38003  #include <asm/abs_addr.h>
38004 @@ -52,7 +53,7 @@ static struct device ibmebus_bus_device 
38005  struct bus_type ibmebus_bus_type;
38006  
38007  /* These devices will automatically be added to the bus during init */
38008 -static struct of_device_id builtin_matches[] = {
38009 +static struct of_device_id __initdata builtin_matches[] = {
38010         { .compatible = "IBM,lhca" },
38011         { .compatible = "IBM,lhea" },
38012         {},
38013 @@ -171,7 +172,7 @@ static int ibmebus_create_devices(const 
38014  
38015         root = of_find_node_by_path("/");
38016  
38017 -       for (child = NULL; (child = of_get_next_child(root, child)); ) {
38018 +       for_each_child_of_node(root, child) {
38019                 if (!of_match_node(matches, child))
38020                         continue;
38021  
38022 @@ -197,16 +198,13 @@ int ibmebus_register_driver(struct of_pl
38023         /* If the driver uses devices that ibmebus doesn't know, add them */
38024         ibmebus_create_devices(drv->match_table);
38025  
38026 -       drv->driver.name   = drv->name;
38027 -       drv->driver.bus    = &ibmebus_bus_type;
38028 -
38029 -       return driver_register(&drv->driver);
38030 +       return of_register_driver(drv, &ibmebus_bus_type);
38031  }
38032  EXPORT_SYMBOL(ibmebus_register_driver);
38033  
38034  void ibmebus_unregister_driver(struct of_platform_driver *drv)
38035  {
38036 -       driver_unregister(&drv->driver);
38037 +       of_unregister_driver(drv);
38038  }
38039  EXPORT_SYMBOL(ibmebus_unregister_driver);
38040  
38041 Index: linux-2.6.24.7/arch/powerpc/kernel/iommu.c
38042 ===================================================================
38043 --- linux-2.6.24.7.orig/arch/powerpc/kernel/iommu.c
38044 +++ linux-2.6.24.7/arch/powerpc/kernel/iommu.c
38045 @@ -532,16 +532,14 @@ struct iommu_table *iommu_init_table(str
38046         return tbl;
38047  }
38048  
38049 -void iommu_free_table(struct device_node *dn)
38050 +void iommu_free_table(struct iommu_table *tbl, const char *node_name)
38051  {
38052 -       struct pci_dn *pdn = dn->data;
38053 -       struct iommu_table *tbl = pdn->iommu_table;
38054         unsigned long bitmap_sz, i;
38055         unsigned int order;
38056  
38057         if (!tbl || !tbl->it_map) {
38058                 printk(KERN_ERR "%s: expected TCE map for %s\n", __FUNCTION__,
38059 -                               dn->full_name);
38060 +                               node_name);
38061                 return;
38062         }
38063  
38064 @@ -550,7 +548,7 @@ void iommu_free_table(struct device_node
38065         for (i = 0; i < (tbl->it_size/64); i++) {
38066                 if (tbl->it_map[i] != 0) {
38067                         printk(KERN_WARNING "%s: Unexpected TCEs for %s\n",
38068 -                               __FUNCTION__, dn->full_name);
38069 +                               __FUNCTION__, node_name);
38070                         break;
38071                 }
38072         }
38073 Index: linux-2.6.24.7/arch/powerpc/kernel/isa-bridge.c
38074 ===================================================================
38075 --- linux-2.6.24.7.orig/arch/powerpc/kernel/isa-bridge.c
38076 +++ linux-2.6.24.7/arch/powerpc/kernel/isa-bridge.c
38077 @@ -108,7 +108,7 @@ static void __devinit pci_process_ISA_OF
38078         if (size > 0x10000)
38079                 size = 0x10000;
38080  
38081 -       printk(KERN_ERR "no ISA IO ranges or unexpected isa range,"
38082 +       printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
38083                "mapping 64k\n");
38084  
38085         __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
38086 @@ -116,7 +116,7 @@ static void __devinit pci_process_ISA_OF
38087         return;
38088  
38089  inval_range:
38090 -       printk(KERN_ERR "no ISA IO ranges or unexpected isa range,"
38091 +       printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
38092                "mapping 64k\n");
38093         __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
38094                      0x10000, _PAGE_NO_CACHE|_PAGE_GUARDED);
38095 @@ -145,7 +145,7 @@ void __init isa_bridge_find_early(struct
38096         for_each_node_by_type(np, "isa") {
38097                 /* Look for our hose being a parent */
38098                 for (parent = of_get_parent(np); parent;) {
38099 -                       if (parent == hose->arch_data) {
38100 +                       if (parent == hose->dn) {
38101                                 of_node_put(parent);
38102                                 break;
38103                         }
38104 Index: linux-2.6.24.7/arch/powerpc/kernel/legacy_serial.c
38105 ===================================================================
38106 --- linux-2.6.24.7.orig/arch/powerpc/kernel/legacy_serial.c
38107 +++ linux-2.6.24.7/arch/powerpc/kernel/legacy_serial.c
38108 @@ -307,7 +307,7 @@ void __init find_legacy_serial_ports(voi
38109         }
38110  
38111         /* First fill our array with SOC ports */
38112 -       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
38113 +       for_each_compatible_node(np, "serial", "ns16550") {
38114                 struct device_node *soc = of_get_parent(np);
38115                 if (soc && !strcmp(soc->type, "soc")) {
38116                         index = add_legacy_soc_port(np, np);
38117 @@ -318,7 +318,7 @@ void __init find_legacy_serial_ports(voi
38118         }
38119  
38120         /* First fill our array with ISA ports */
38121 -       for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
38122 +       for_each_node_by_type(np, "serial") {
38123                 struct device_node *isa = of_get_parent(np);
38124                 if (isa && !strcmp(isa->name, "isa")) {
38125                         index = add_legacy_isa_port(np, isa);
38126 @@ -329,7 +329,7 @@ void __init find_legacy_serial_ports(voi
38127         }
38128  
38129         /* First fill our array with tsi-bridge ports */
38130 -       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
38131 +       for_each_compatible_node(np, "serial", "ns16550") {
38132                 struct device_node *tsi = of_get_parent(np);
38133                 if (tsi && !strcmp(tsi->type, "tsi-bridge")) {
38134                         index = add_legacy_soc_port(np, np);
38135 @@ -340,7 +340,7 @@ void __init find_legacy_serial_ports(voi
38136         }
38137  
38138         /* First fill our array with opb bus ports */
38139 -       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
38140 +       for_each_compatible_node(np, "serial", "ns16550") {
38141                 struct device_node *opb = of_get_parent(np);
38142                 if (opb && (!strcmp(opb->type, "opb") ||
38143                             of_device_is_compatible(opb, "ibm,opb"))) {
38144 @@ -474,7 +474,7 @@ static int __init serial_dev_init(void)
38145  
38146         /*
38147          * Before we register the platfrom serial devices, we need
38148 -        * to fixup their interrutps and their IO ports.
38149 +        * to fixup their interrupts and their IO ports.
38150          */
38151         DBG("Fixing serial ports interrupts and IO ports ...\n");
38152  
38153 Index: linux-2.6.24.7/arch/powerpc/kernel/lparcfg.c
38154 ===================================================================
38155 --- linux-2.6.24.7.orig/arch/powerpc/kernel/lparcfg.c
38156 +++ linux-2.6.24.7/arch/powerpc/kernel/lparcfg.c
38157 @@ -41,7 +41,6 @@
38158  /* #define LPARCFG_DEBUG */
38159  
38160  static struct proc_dir_entry *proc_ppc64_lparcfg;
38161 -#define LPARCFG_BUFF_SIZE 4096
38162  
38163  /*
38164   * Track sum of all purrs across all processors. This is used to further
38165 @@ -595,13 +594,6 @@ int __init lparcfg_init(void)
38166         ent = create_proc_entry("ppc64/lparcfg", mode, NULL);
38167         if (ent) {
38168                 ent->proc_fops = &lparcfg_fops;
38169 -               ent->data = kmalloc(LPARCFG_BUFF_SIZE, GFP_KERNEL);
38170 -               if (!ent->data) {
38171 -                       printk(KERN_ERR
38172 -                              "Failed to allocate buffer for lparcfg\n");
38173 -                       remove_proc_entry("lparcfg", ent->parent);
38174 -                       return -ENOMEM;
38175 -               }
38176         } else {
38177                 printk(KERN_ERR "Failed to create ppc64/lparcfg\n");
38178                 return -EIO;
38179 @@ -613,10 +605,8 @@ int __init lparcfg_init(void)
38180  
38181  void __exit lparcfg_cleanup(void)
38182  {
38183 -       if (proc_ppc64_lparcfg) {
38184 -               kfree(proc_ppc64_lparcfg->data);
38185 +       if (proc_ppc64_lparcfg)
38186                 remove_proc_entry("lparcfg", proc_ppc64_lparcfg->parent);
38187 -       }
38188  }
38189  
38190  module_init(lparcfg_init);
38191 Index: linux-2.6.24.7/arch/powerpc/kernel/misc.S
38192 ===================================================================
38193 --- linux-2.6.24.7.orig/arch/powerpc/kernel/misc.S
38194 +++ linux-2.6.24.7/arch/powerpc/kernel/misc.S
38195 @@ -8,12 +8,17 @@
38196   * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
38197   * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
38198   *
38199 + * setjmp/longjmp code by Paul Mackerras.
38200 + *
38201   * This program is free software; you can redistribute it and/or
38202   * modify it under the terms of the GNU General Public License
38203   * as published by the Free Software Foundation; either version
38204   * 2 of the License, or (at your option) any later version.
38205   */
38206  #include <asm/ppc_asm.h>
38207 +#include <asm/unistd.h>
38208 +#include <asm/asm-compat.h>
38209 +#include <asm/asm-offsets.h>
38210  
38211         .text
38212  
38213 @@ -43,3 +48,71 @@ _GLOBAL(add_reloc_offset)
38214         add     r3,r3,r5
38215         mtlr    r0
38216         blr
38217 +
38218 +_GLOBAL(kernel_execve)
38219 +       li      r0,__NR_execve
38220 +       sc
38221 +       bnslr
38222 +       neg     r3,r3
38223 +       blr
38224 +
38225 +_GLOBAL(setjmp)
38226 +       mflr    r0
38227 +       PPC_STL r0,0(r3)
38228 +       PPC_STL r1,SZL(r3)
38229 +       PPC_STL r2,2*SZL(r3)
38230 +       mfcr    r0
38231 +       PPC_STL r0,3*SZL(r3)
38232 +       PPC_STL r13,4*SZL(r3)
38233 +       PPC_STL r14,5*SZL(r3)
38234 +       PPC_STL r15,6*SZL(r3)
38235 +       PPC_STL r16,7*SZL(r3)
38236 +       PPC_STL r17,8*SZL(r3)
38237 +       PPC_STL r18,9*SZL(r3)
38238 +       PPC_STL r19,10*SZL(r3)
38239 +       PPC_STL r20,11*SZL(r3)
38240 +       PPC_STL r21,12*SZL(r3)
38241 +       PPC_STL r22,13*SZL(r3)
38242 +       PPC_STL r23,14*SZL(r3)
38243 +       PPC_STL r24,15*SZL(r3)
38244 +       PPC_STL r25,16*SZL(r3)
38245 +       PPC_STL r26,17*SZL(r3)
38246 +       PPC_STL r27,18*SZL(r3)
38247 +       PPC_STL r28,19*SZL(r3)
38248 +       PPC_STL r29,20*SZL(r3)
38249 +       PPC_STL r30,21*SZL(r3)
38250 +       PPC_STL r31,22*SZL(r3)
38251 +       li      r3,0
38252 +       blr
38253 +
38254 +_GLOBAL(longjmp)
38255 +       PPC_LCMPI r4,0
38256 +       bne     1f
38257 +       li      r4,1
38258 +1:     PPC_LL  r13,4*SZL(r3)
38259 +       PPC_LL  r14,5*SZL(r3)
38260 +       PPC_LL  r15,6*SZL(r3)
38261 +       PPC_LL  r16,7*SZL(r3)
38262 +       PPC_LL  r17,8*SZL(r3)
38263 +       PPC_LL  r18,9*SZL(r3)
38264 +       PPC_LL  r19,10*SZL(r3)
38265 +       PPC_LL  r20,11*SZL(r3)
38266 +       PPC_LL  r21,12*SZL(r3)
38267 +       PPC_LL  r22,13*SZL(r3)
38268 +       PPC_LL  r23,14*SZL(r3)
38269 +       PPC_LL  r24,15*SZL(r3)
38270 +       PPC_LL  r25,16*SZL(r3)
38271 +       PPC_LL  r26,17*SZL(r3)
38272 +       PPC_LL  r27,18*SZL(r3)
38273 +       PPC_LL  r28,19*SZL(r3)
38274 +       PPC_LL  r29,20*SZL(r3)
38275 +       PPC_LL  r30,21*SZL(r3)
38276 +       PPC_LL  r31,22*SZL(r3)
38277 +       PPC_LL  r0,3*SZL(r3)
38278 +       mtcrf   0x38,r0
38279 +       PPC_LL  r0,0(r3)
38280 +       PPC_LL  r1,SZL(r3)
38281 +       PPC_LL  r2,2*SZL(r3)
38282 +       mtlr    r0
38283 +       mr      r3,r4
38284 +       blr
38285 Index: linux-2.6.24.7/arch/powerpc/kernel/misc_32.S
38286 ===================================================================
38287 --- linux-2.6.24.7.orig/arch/powerpc/kernel/misc_32.S
38288 +++ linux-2.6.24.7/arch/powerpc/kernel/misc_32.S
38289 @@ -206,6 +206,45 @@ _GLOBAL(_nmask_and_or_msr)
38290         isync
38291         blr                     /* Done */
38292  
38293 +#ifdef CONFIG_40x
38294 +
38295 +/*
38296 + * Do an IO access in real mode
38297 + */
38298 +_GLOBAL(real_readb)
38299 +       mfmsr   r7
38300 +       ori     r0,r7,MSR_DR
38301 +       xori    r0,r0,MSR_DR
38302 +       sync
38303 +       mtmsr   r0
38304 +       sync
38305 +       isync
38306 +       lbz     r3,0(r3)
38307 +       sync
38308 +       mtmsr   r7
38309 +       sync
38310 +       isync
38311 +       blr
38312 +
38313 +       /*
38314 + * Do an IO access in real mode
38315 + */
38316 +_GLOBAL(real_writeb)
38317 +       mfmsr   r7
38318 +       ori     r0,r7,MSR_DR
38319 +       xori    r0,r0,MSR_DR
38320 +       sync
38321 +       mtmsr   r0
38322 +       sync
38323 +       isync
38324 +       stb     r3,0(r4)
38325 +       sync
38326 +       mtmsr   r7
38327 +       sync
38328 +       isync
38329 +       blr
38330 +
38331 +#endif /* CONFIG_40x */
38332  
38333  /*
38334   * Flush MMU TLB
38335 @@ -793,13 +832,6 @@ _GLOBAL(kernel_thread)
38336         addi    r1,r1,16
38337         blr
38338  
38339 -_GLOBAL(kernel_execve)
38340 -       li      r0,__NR_execve
38341 -       sc
38342 -       bnslr
38343 -       neg     r3,r3
38344 -       blr
38345 -
38346  /*
38347   * This routine is just here to keep GCC happy - sigh...
38348   */
38349 Index: linux-2.6.24.7/arch/powerpc/kernel/misc_64.S
38350 ===================================================================
38351 --- linux-2.6.24.7.orig/arch/powerpc/kernel/misc_64.S
38352 +++ linux-2.6.24.7/arch/powerpc/kernel/misc_64.S
38353 @@ -518,13 +518,6 @@ _GLOBAL(giveup_altivec)
38354  
38355  #endif /* CONFIG_ALTIVEC */
38356  
38357 -_GLOBAL(kernel_execve)
38358 -       li      r0,__NR_execve
38359 -       sc
38360 -       bnslr
38361 -       neg     r3,r3
38362 -       blr
38363 -
38364  /* kexec_wait(phys_cpu)
38365   *
38366   * wait for the flag to change, indicating this kernel is going away but
38367 Index: linux-2.6.24.7/arch/powerpc/kernel/module_32.c
38368 ===================================================================
38369 --- linux-2.6.24.7.orig/arch/powerpc/kernel/module_32.c
38370 +++ linux-2.6.24.7/arch/powerpc/kernel/module_32.c
38371 @@ -24,6 +24,7 @@
38372  #include <linux/kernel.h>
38373  #include <linux/cache.h>
38374  #include <linux/bug.h>
38375 +#include <linux/sort.h>
38376  
38377  #include "setup.h"
38378  
38379 @@ -54,22 +55,60 @@ void module_free(struct module *mod, voi
38380     addend) */
38381  static unsigned int count_relocs(const Elf32_Rela *rela, unsigned int num)
38382  {
38383 -       unsigned int i, j, ret = 0;
38384 +       unsigned int i, r_info, r_addend, _count_relocs;
38385  
38386 -       /* Sure, this is order(n^2), but it's usually short, and not
38387 -           time critical */
38388 -       for (i = 0; i < num; i++) {
38389 -               for (j = 0; j < i; j++) {
38390 -                       /* If this addend appeared before, it's
38391 -                           already been counted */
38392 -                       if (ELF32_R_SYM(rela[i].r_info)
38393 -                           == ELF32_R_SYM(rela[j].r_info)
38394 -                           && rela[i].r_addend == rela[j].r_addend)
38395 -                               break;
38396 +       _count_relocs = 0;
38397 +       r_info = 0;
38398 +       r_addend = 0;
38399 +       for (i = 0; i < num; i++)
38400 +               /* Only count 24-bit relocs, others don't need stubs */
38401 +               if (ELF32_R_TYPE(rela[i].r_info) == R_PPC_REL24 &&
38402 +                   (r_info != ELF32_R_SYM(rela[i].r_info) ||
38403 +                    r_addend != rela[i].r_addend)) {
38404 +                       _count_relocs++;
38405 +                       r_info = ELF32_R_SYM(rela[i].r_info);
38406 +                       r_addend = rela[i].r_addend;
38407                 }
38408 -               if (j == i) ret++;
38409 +
38410 +       return _count_relocs;
38411 +}
38412 +
38413 +static int relacmp(const void *_x, const void *_y)
38414 +{
38415 +       const Elf32_Rela *x, *y;
38416 +
38417 +       y = (Elf32_Rela *)_x;
38418 +       x = (Elf32_Rela *)_y;
38419 +
38420 +       /* Compare the entire r_info (as opposed to ELF32_R_SYM(r_info) only) to
38421 +        * make the comparison cheaper/faster. It won't affect the sorting or
38422 +        * the counting algorithms' performance
38423 +        */
38424 +       if (x->r_info < y->r_info)
38425 +               return -1;
38426 +       else if (x->r_info > y->r_info)
38427 +               return 1;
38428 +       else if (x->r_addend < y->r_addend)
38429 +               return -1;
38430 +       else if (x->r_addend > y->r_addend)
38431 +               return 1;
38432 +       else
38433 +               return 0;
38434 +}
38435 +
38436 +static void relaswap(void *_x, void *_y, int size)
38437 +{
38438 +       uint32_t *x, *y, tmp;
38439 +       int i;
38440 +
38441 +       y = (uint32_t *)_x;
38442 +       x = (uint32_t *)_y;
38443 +
38444 +       for (i = 0; i < sizeof(Elf32_Rela) / sizeof(uint32_t); i++) {
38445 +               tmp = x[i];
38446 +               x[i] = y[i];
38447 +               y[i] = tmp;
38448         }
38449 -       return ret;
38450  }
38451  
38452  /* Get the potential trampolines size required of the init and
38453 @@ -100,6 +139,16 @@ static unsigned long get_plt_size(const 
38454                         DEBUGP("Ptr: %p.  Number: %u\n",
38455                                (void *)hdr + sechdrs[i].sh_offset,
38456                                sechdrs[i].sh_size / sizeof(Elf32_Rela));
38457 +
38458 +                       /* Sort the relocation information based on a symbol and
38459 +                        * addend key. This is a stable O(n*log n) complexity
38460 +                        * alogrithm but it will reduce the complexity of
38461 +                        * count_relocs() to linear complexity O(n)
38462 +                        */
38463 +                       sort((void *)hdr + sechdrs[i].sh_offset,
38464 +                            sechdrs[i].sh_size / sizeof(Elf32_Rela),
38465 +                            sizeof(Elf32_Rela), relacmp, relaswap);
38466 +
38467                         ret += count_relocs((void *)hdr
38468                                              + sechdrs[i].sh_offset,
38469                                              sechdrs[i].sh_size
38470 Index: linux-2.6.24.7/arch/powerpc/kernel/module_64.c
38471 ===================================================================
38472 --- linux-2.6.24.7.orig/arch/powerpc/kernel/module_64.c
38473 +++ linux-2.6.24.7/arch/powerpc/kernel/module_64.c
38474 @@ -24,6 +24,7 @@
38475  #include <asm/module.h>
38476  #include <asm/uaccess.h>
38477  #include <asm/firmware.h>
38478 +#include <linux/sort.h>
38479  
38480  #include "setup.h"
38481  
38482 @@ -81,25 +82,23 @@ static struct ppc64_stub_entry ppc64_stu
38483     different addend) */
38484  static unsigned int count_relocs(const Elf64_Rela *rela, unsigned int num)
38485  {
38486 -       unsigned int i, j, ret = 0;
38487 +       unsigned int i, r_info, r_addend, _count_relocs;
38488  
38489         /* FIXME: Only count external ones --RR */
38490 -       /* Sure, this is order(n^2), but it's usually short, and not
38491 -           time critical */
38492 -       for (i = 0; i < num; i++) {
38493 +       _count_relocs = 0;
38494 +       r_info = 0;
38495 +       r_addend = 0;
38496 +       for (i = 0; i < num; i++)
38497                 /* Only count 24-bit relocs, others don't need stubs */
38498 -               if (ELF64_R_TYPE(rela[i].r_info) != R_PPC_REL24)
38499 -                       continue;
38500 -               for (j = 0; j < i; j++) {
38501 -                       /* If this addend appeared before, it's
38502 -                           already been counted */
38503 -                       if (rela[i].r_info == rela[j].r_info
38504 -                           && rela[i].r_addend == rela[j].r_addend)
38505 -                               break;
38506 +               if (ELF64_R_TYPE(rela[i].r_info) == R_PPC_REL24 &&
38507 +                   (r_info != ELF64_R_SYM(rela[i].r_info) ||
38508 +                    r_addend != rela[i].r_addend)) {
38509 +                       _count_relocs++;
38510 +                       r_info = ELF64_R_SYM(rela[i].r_info);
38511 +                       r_addend = rela[i].r_addend;
38512                 }
38513 -               if (j == i) ret++;
38514 -       }
38515 -       return ret;
38516 +
38517 +       return _count_relocs;
38518  }
38519  
38520  void *module_alloc(unsigned long size)
38521 @@ -118,6 +117,44 @@ void module_free(struct module *mod, voi
38522             table entries. */
38523  }
38524  
38525 +static int relacmp(const void *_x, const void *_y)
38526 +{
38527 +       const Elf64_Rela *x, *y;
38528 +
38529 +       y = (Elf64_Rela *)_x;
38530 +       x = (Elf64_Rela *)_y;
38531 +
38532 +       /* Compare the entire r_info (as opposed to ELF64_R_SYM(r_info) only) to
38533 +        * make the comparison cheaper/faster. It won't affect the sorting or
38534 +        * the counting algorithms' performance
38535 +        */
38536 +       if (x->r_info < y->r_info)
38537 +               return -1;
38538 +       else if (x->r_info > y->r_info)
38539 +               return 1;
38540 +       else if (x->r_addend < y->r_addend)
38541 +               return -1;
38542 +       else if (x->r_addend > y->r_addend)
38543 +               return 1;
38544 +       else
38545 +               return 0;
38546 +}
38547 +
38548 +static void relaswap(void *_x, void *_y, int size)
38549 +{
38550 +       uint64_t *x, *y, tmp;
38551 +       int i;
38552 +
38553 +       y = (uint64_t *)_x;
38554 +       x = (uint64_t *)_y;
38555 +
38556 +       for (i = 0; i < sizeof(Elf64_Rela) / sizeof(uint64_t); i++) {
38557 +               tmp = x[i];
38558 +               x[i] = y[i];
38559 +               y[i] = tmp;
38560 +       }
38561 +}
38562 +
38563  /* Get size of potential trampolines required. */
38564  static unsigned long get_stubs_size(const Elf64_Ehdr *hdr,
38565                                     const Elf64_Shdr *sechdrs)
38566 @@ -133,6 +170,16 @@ static unsigned long get_stubs_size(cons
38567                         DEBUGP("Ptr: %p.  Number: %lu\n",
38568                                (void *)sechdrs[i].sh_addr,
38569                                sechdrs[i].sh_size / sizeof(Elf64_Rela));
38570 +
38571 +                       /* Sort the relocation information based on a symbol and
38572 +                        * addend key. This is a stable O(n*log n) complexity
38573 +                        * alogrithm but it will reduce the complexity of
38574 +                        * count_relocs() to linear complexity O(n)
38575 +                        */
38576 +                       sort((void *)sechdrs[i].sh_addr,
38577 +                            sechdrs[i].sh_size / sizeof(Elf64_Rela),
38578 +                            sizeof(Elf64_Rela), relacmp, relaswap);
38579 +
38580                         relocs += count_relocs((void *)sechdrs[i].sh_addr,
38581                                                sechdrs[i].sh_size
38582                                                / sizeof(Elf64_Rela));
38583 @@ -343,7 +390,7 @@ int apply_relocate_add(Elf64_Shdr *sechd
38584                         /* Simply set it */
38585                         *(u32 *)location = value;
38586                         break;
38587 -                       
38588 +
38589                 case R_PPC64_ADDR64:
38590                         /* Simply set it */
38591                         *(unsigned long *)location = value;
38592 @@ -399,7 +446,7 @@ int apply_relocate_add(Elf64_Shdr *sechd
38593                         }
38594  
38595                         /* Only replace bits 2 through 26 */
38596 -                       *(uint32_t *)location 
38597 +                       *(uint32_t *)location
38598                                 = (*(uint32_t *)location & ~0x03fffffc)
38599                                 | (value & 0x03fffffc);
38600                         break;
38601 Index: linux-2.6.24.7/arch/powerpc/kernel/of_device.c
38602 ===================================================================
38603 --- linux-2.6.24.7.orig/arch/powerpc/kernel/of_device.c
38604 +++ linux-2.6.24.7/arch/powerpc/kernel/of_device.c
38605 @@ -5,10 +5,10 @@
38606  #include <linux/module.h>
38607  #include <linux/mod_devicetable.h>
38608  #include <linux/slab.h>
38609 +#include <linux/of_device.h>
38610  
38611  #include <asm/errno.h>
38612  #include <asm/dcr.h>
38613 -#include <asm/of_device.h>
38614  
38615  static void of_device_make_bus_id(struct of_device *dev)
38616  {
38617 Index: linux-2.6.24.7/arch/powerpc/kernel/of_platform.c
38618 ===================================================================
38619 --- linux-2.6.24.7.orig/arch/powerpc/kernel/of_platform.c
38620 +++ linux-2.6.24.7/arch/powerpc/kernel/of_platform.c
38621 @@ -19,6 +19,7 @@
38622  #include <linux/mod_devicetable.h>
38623  #include <linux/slab.h>
38624  #include <linux/pci.h>
38625 +#include <linux/of.h>
38626  #include <linux/of_device.h>
38627  #include <linux/of_platform.h>
38628  
38629 @@ -40,7 +41,7 @@
38630   * a bus type in the list
38631   */
38632  
38633 -static struct of_device_id of_default_bus_ids[] = {
38634 +static const struct of_device_id of_default_bus_ids[] = {
38635         { .type = "soc", },
38636         { .compatible = "soc", },
38637         { .type = "spider", },
38638 @@ -64,26 +65,6 @@ static int __init of_bus_driver_init(voi
38639  
38640  postcore_initcall(of_bus_driver_init);
38641  
38642 -int of_register_platform_driver(struct of_platform_driver *drv)
38643 -{
38644 -       /* initialize common driver fields */
38645 -       if (!drv->driver.name)
38646 -               drv->driver.name = drv->name;
38647 -       if (!drv->driver.owner)
38648 -               drv->driver.owner = drv->owner;
38649 -       drv->driver.bus = &of_platform_bus_type;
38650 -
38651 -       /* register with core */
38652 -       return driver_register(&drv->driver);
38653 -}
38654 -EXPORT_SYMBOL(of_register_platform_driver);
38655 -
38656 -void of_unregister_platform_driver(struct of_platform_driver *drv)
38657 -{
38658 -       driver_unregister(&drv->driver);
38659 -}
38660 -EXPORT_SYMBOL(of_unregister_platform_driver);
38661 -
38662  struct of_device* of_platform_device_create(struct device_node *np,
38663                                             const char *bus_id,
38664                                             struct device *parent)
38665 @@ -120,15 +101,15 @@ EXPORT_SYMBOL(of_platform_device_create)
38666   * @matches: match table, NULL to use the default, OF_NO_DEEP_PROBE to
38667   * disallow recursive creation of child busses
38668   */
38669 -static int of_platform_bus_create(struct device_node *bus,
38670 -                                 struct of_device_id *matches,
38671 +static int of_platform_bus_create(const struct device_node *bus,
38672 +                                 const struct of_device_id *matches,
38673                                   struct device *parent)
38674  {
38675         struct device_node *child;
38676         struct of_device *dev;
38677         int rc = 0;
38678  
38679 -       for (child = NULL; (child = of_get_next_child(bus, child)); ) {
38680 +       for_each_child_of_node(bus, child) {
38681                 pr_debug("   create child: %s\n", child->full_name);
38682                 dev = of_platform_device_create(child, NULL, parent);
38683                 if (dev == NULL)
38684 @@ -157,7 +138,7 @@ static int of_platform_bus_create(struct
38685   */
38686  
38687  int of_platform_bus_probe(struct device_node *root,
38688 -                         struct of_device_id *matches,
38689 +                         const struct of_device_id *matches,
38690                           struct device *parent)
38691  {
38692         struct device_node *child;
38693 @@ -190,7 +171,7 @@ int of_platform_bus_probe(struct device_
38694                 rc = of_platform_bus_create(root, matches, &dev->dev);
38695                 goto bail;
38696         }
38697 -       for (child = NULL; (child = of_get_next_child(root, child)); ) {
38698 +       for_each_child_of_node(root, child) {
38699                 if (!of_match_node(matches, child))
38700                         continue;
38701  
38702 Index: linux-2.6.24.7/arch/powerpc/kernel/pci-common.c
38703 ===================================================================
38704 --- linux-2.6.24.7.orig/arch/powerpc/kernel/pci-common.c
38705 +++ linux-2.6.24.7/arch/powerpc/kernel/pci-common.c
38706 @@ -48,32 +48,26 @@
38707  static DEFINE_SPINLOCK(hose_spinlock);
38708  
38709  /* XXX kill that some day ... */
38710 -int global_phb_number;         /* Global phb counter */
38711 +static int global_phb_number;          /* Global phb counter */
38712  
38713 -extern struct list_head hose_list;
38714 +/* ISA Memory physical address */
38715 +resource_size_t isa_mem_base;
38716  
38717 -/*
38718 - * pci_controller(phb) initialized common variables.
38719 - */
38720 -static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
38721 -{
38722 -       memset(hose, 0, sizeof(struct pci_controller));
38723 -
38724 -       spin_lock(&hose_spinlock);
38725 -       hose->global_number = global_phb_number++;
38726 -       list_add_tail(&hose->list_node, &hose_list);
38727 -       spin_unlock(&hose_spinlock);
38728 -}
38729 +/* Default PCI flags is 0 */
38730 +unsigned int ppc_pci_flags;
38731  
38732 -struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
38733 +struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
38734  {
38735         struct pci_controller *phb;
38736  
38737 -       phb = alloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
38738 +       phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
38739         if (phb == NULL)
38740                 return NULL;
38741 -       pci_setup_pci_controller(phb);
38742 -       phb->arch_data = dev;
38743 +       spin_lock(&hose_spinlock);
38744 +       phb->global_number = global_phb_number++;
38745 +       list_add_tail(&phb->list_node, &hose_list);
38746 +       spin_unlock(&hose_spinlock);
38747 +       phb->dn = dev;
38748         phb->is_dynamic = mem_init_done;
38749  #ifdef CONFIG_PPC64
38750         if (dev) {
38751 @@ -126,15 +120,10 @@ int pcibios_vaddr_is_ioport(void __iomem
38752   */
38753  int pci_domain_nr(struct pci_bus *bus)
38754  {
38755 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
38756 -               return 0;
38757 -       else {
38758 -               struct pci_controller *hose = pci_bus_to_host(bus);
38759 +       struct pci_controller *hose = pci_bus_to_host(bus);
38760  
38761 -               return hose->global_number;
38762 -       }
38763 +       return hose->global_number;
38764  }
38765 -
38766  EXPORT_SYMBOL(pci_domain_nr);
38767  
38768  #ifdef CONFIG_PPC_OF
38769 @@ -153,7 +142,7 @@ struct pci_controller* pci_find_hose_for
38770         while(node) {
38771                 struct pci_controller *hose, *tmp;
38772                 list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
38773 -                       if (hose->arch_data == node)
38774 +                       if (hose->dn == node)
38775                                 return hose;
38776                 node = node->parent;
38777         }
38778 @@ -201,6 +190,20 @@ int pci_read_irq_line(struct pci_dev *pc
38779         struct of_irq oirq;
38780         unsigned int virq;
38781  
38782 +       /* The current device-tree that iSeries generates from the HV
38783 +        * PCI informations doesn't contain proper interrupt routing,
38784 +        * and all the fallback would do is print out crap, so we
38785 +        * don't attempt to resolve the interrupts here at all, some
38786 +        * iSeries specific fixup does it.
38787 +        *
38788 +        * In the long run, we will hopefully fix the generated device-tree
38789 +        * instead.
38790 +        */
38791 +#ifdef CONFIG_PPC_ISERIES
38792 +       if (firmware_has_feature(FW_FEATURE_ISERIES))
38793 +               return -1;
38794 +#endif
38795 +
38796         DBG("Try to map irq for %s...\n", pci_name(pci_dev));
38797  
38798  #ifdef DEBUG
38799 @@ -222,10 +225,11 @@ int pci_read_irq_line(struct pci_dev *pc
38800                 if (pin == 0)
38801                         return -1;
38802                 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
38803 -                   line == 0xff) {
38804 +                   line == 0xff || line == 0) {
38805                         return -1;
38806                 }
38807 -               DBG(" -> no map ! Using irq line %d from PCI config\n", line);
38808 +               DBG(" -> no map ! Using line %d (pin %d) from PCI config\n",
38809 +                   line, pin);
38810  
38811                 virq = irq_create_mapping(NULL, line);
38812                 if (virq != NO_IRQ)
38813 @@ -475,3 +479,717 @@ void pci_resource_to_user(const struct p
38814         *start = rsrc->start - offset;
38815         *end = rsrc->end - offset;
38816  }
38817 +
38818 +/**
38819 + * pci_process_bridge_OF_ranges - Parse PCI bridge resources from device tree
38820 + * @hose: newly allocated pci_controller to be setup
38821 + * @dev: device node of the host bridge
38822 + * @primary: set if primary bus (32 bits only, soon to be deprecated)
38823 + *
38824 + * This function will parse the "ranges" property of a PCI host bridge device
38825 + * node and setup the resource mapping of a pci controller based on its
38826 + * content.
38827 + *
38828 + * Life would be boring if it wasn't for a few issues that we have to deal
38829 + * with here:
38830 + *
38831 + *   - We can only cope with one IO space range and up to 3 Memory space
38832 + *     ranges. However, some machines (thanks Apple !) tend to split their
38833 + *     space into lots of small contiguous ranges. So we have to coalesce.
38834 + *
38835 + *   - We can only cope with all memory ranges having the same offset
38836 + *     between CPU addresses and PCI addresses. Unfortunately, some bridges
38837 + *     are setup for a large 1:1 mapping along with a small "window" which
38838 + *     maps PCI address 0 to some arbitrary high address of the CPU space in
38839 + *     order to give access to the ISA memory hole.
38840 + *     The way out of here that I've chosen for now is to always set the
38841 + *     offset based on the first resource found, then override it if we
38842 + *     have a different offset and the previous was set by an ISA hole.
38843 + *
38844 + *   - Some busses have IO space not starting at 0, which causes trouble with
38845 + *     the way we do our IO resource renumbering. The code somewhat deals with
38846 + *     it for 64 bits but I would expect problems on 32 bits.
38847 + *
38848 + *   - Some 32 bits platforms such as 4xx can have physical space larger than
38849 + *     32 bits so we need to use 64 bits values for the parsing
38850 + */
38851 +void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
38852 +                                           struct device_node *dev,
38853 +                                           int primary)
38854 +{
38855 +       const u32 *ranges;
38856 +       int rlen;
38857 +       int pna = of_n_addr_cells(dev);
38858 +       int np = pna + 5;
38859 +       int memno = 0, isa_hole = -1;
38860 +       u32 pci_space;
38861 +       unsigned long long pci_addr, cpu_addr, pci_next, cpu_next, size;
38862 +       unsigned long long isa_mb = 0;
38863 +       struct resource *res;
38864 +
38865 +       printk(KERN_INFO "PCI host bridge %s %s ranges:\n",
38866 +              dev->full_name, primary ? "(primary)" : "");
38867 +
38868 +       /* Get ranges property */
38869 +       ranges = of_get_property(dev, "ranges", &rlen);
38870 +       if (ranges == NULL)
38871 +               return;
38872 +
38873 +       /* Parse it */
38874 +       while ((rlen -= np * 4) >= 0) {
38875 +               /* Read next ranges element */
38876 +               pci_space = ranges[0];
38877 +               pci_addr = of_read_number(ranges + 1, 2);
38878 +               cpu_addr = of_translate_address(dev, ranges + 3);
38879 +               size = of_read_number(ranges + pna + 3, 2);
38880 +               ranges += np;
38881 +               if (cpu_addr == OF_BAD_ADDR || size == 0)
38882 +                       continue;
38883 +
38884 +               /* Now consume following elements while they are contiguous */
38885 +               for (; rlen >= np * sizeof(u32);
38886 +                    ranges += np, rlen -= np * 4) {
38887 +                       if (ranges[0] != pci_space)
38888 +                               break;
38889 +                       pci_next = of_read_number(ranges + 1, 2);
38890 +                       cpu_next = of_translate_address(dev, ranges + 3);
38891 +                       if (pci_next != pci_addr + size ||
38892 +                           cpu_next != cpu_addr + size)
38893 +                               break;
38894 +                       size += of_read_number(ranges + pna + 3, 2);
38895 +               }
38896 +
38897 +               /* Act based on address space type */
38898 +               res = NULL;
38899 +               switch ((pci_space >> 24) & 0x3) {
38900 +               case 1:         /* PCI IO space */
38901 +                       printk(KERN_INFO
38902 +                              "  IO 0x%016llx..0x%016llx -> 0x%016llx\n",
38903 +                              cpu_addr, cpu_addr + size - 1, pci_addr);
38904 +
38905 +                       /* We support only one IO range */
38906 +                       if (hose->pci_io_size) {
38907 +                               printk(KERN_INFO
38908 +                                      " \\--> Skipped (too many) !\n");
38909 +                               continue;
38910 +                       }
38911 +#ifdef CONFIG_PPC32
38912 +                       /* On 32 bits, limit I/O space to 16MB */
38913 +                       if (size > 0x01000000)
38914 +                               size = 0x01000000;
38915 +
38916 +                       /* 32 bits needs to map IOs here */
38917 +                       hose->io_base_virt = ioremap(cpu_addr, size);
38918 +
38919 +                       /* Expect trouble if pci_addr is not 0 */
38920 +                       if (primary)
38921 +                               isa_io_base =
38922 +                                       (unsigned long)hose->io_base_virt;
38923 +#endif /* CONFIG_PPC32 */
38924 +                       /* pci_io_size and io_base_phys always represent IO
38925 +                        * space starting at 0 so we factor in pci_addr
38926 +                        */
38927 +                       hose->pci_io_size = pci_addr + size;
38928 +                       hose->io_base_phys = cpu_addr - pci_addr;
38929 +
38930 +                       /* Build resource */
38931 +                       res = &hose->io_resource;
38932 +                       res->flags = IORESOURCE_IO;
38933 +                       res->start = pci_addr;
38934 +                       break;
38935 +               case 2:         /* PCI Memory space */
38936 +                       printk(KERN_INFO
38937 +                              " MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n",
38938 +                              cpu_addr, cpu_addr + size - 1, pci_addr,
38939 +                              (pci_space & 0x40000000) ? "Prefetch" : "");
38940 +
38941 +                       /* We support only 3 memory ranges */
38942 +                       if (memno >= 3) {
38943 +                               printk(KERN_INFO
38944 +                                      " \\--> Skipped (too many) !\n");
38945 +                               continue;
38946 +                       }
38947 +                       /* Handles ISA memory hole space here */
38948 +                       if (pci_addr == 0) {
38949 +                               isa_mb = cpu_addr;
38950 +                               isa_hole = memno;
38951 +                               if (primary || isa_mem_base == 0)
38952 +                                       isa_mem_base = cpu_addr;
38953 +                       }
38954 +
38955 +                       /* We get the PCI/Mem offset from the first range or
38956 +                        * the, current one if the offset came from an ISA
38957 +                        * hole. If they don't match, bugger.
38958 +                        */
38959 +                       if (memno == 0 ||
38960 +                           (isa_hole >= 0 && pci_addr != 0 &&
38961 +                            hose->pci_mem_offset == isa_mb))
38962 +                               hose->pci_mem_offset = cpu_addr - pci_addr;
38963 +                       else if (pci_addr != 0 &&
38964 +                                hose->pci_mem_offset != cpu_addr - pci_addr) {
38965 +                               printk(KERN_INFO
38966 +                                      " \\--> Skipped (offset mismatch) !\n");
38967 +                               continue;
38968 +                       }
38969 +
38970 +                       /* Build resource */
38971 +                       res = &hose->mem_resources[memno++];
38972 +                       res->flags = IORESOURCE_MEM;
38973 +                       if (pci_space & 0x40000000)
38974 +                               res->flags |= IORESOURCE_PREFETCH;
38975 +                       res->start = cpu_addr;
38976 +                       break;
38977 +               }
38978 +               if (res != NULL) {
38979 +                       res->name = dev->full_name;
38980 +                       res->end = res->start + size - 1;
38981 +                       res->parent = NULL;
38982 +                       res->sibling = NULL;
38983 +                       res->child = NULL;
38984 +               }
38985 +       }
38986 +
38987 +       /* Out of paranoia, let's put the ISA hole last if any */
38988 +       if (isa_hole >= 0 && memno > 0 && isa_hole != (memno-1)) {
38989 +               struct resource tmp = hose->mem_resources[isa_hole];
38990 +               hose->mem_resources[isa_hole] = hose->mem_resources[memno-1];
38991 +               hose->mem_resources[memno-1] = tmp;
38992 +       }
38993 +}
38994 +
38995 +/* Decide whether to display the domain number in /proc */
38996 +int pci_proc_domain(struct pci_bus *bus)
38997 +{
38998 +       struct pci_controller *hose = pci_bus_to_host(bus);
38999 +#ifdef CONFIG_PPC64
39000 +       return hose->buid != 0;
39001 +#else
39002 +       if (!(ppc_pci_flags & PPC_PCI_ENABLE_PROC_DOMAINS))
39003 +               return 0;
39004 +       if (ppc_pci_flags & PPC_PCI_COMPAT_DOMAIN_0)
39005 +               return hose->global_number != 0;
39006 +       return 1;
39007 +#endif
39008 +}
39009 +
39010 +void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
39011 +                            struct resource *res)
39012 +{
39013 +       resource_size_t offset = 0, mask = (resource_size_t)-1;
39014 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
39015 +
39016 +       if (!hose)
39017 +               return;
39018 +       if (res->flags & IORESOURCE_IO) {
39019 +               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
39020 +               mask = 0xffffffffu;
39021 +       } else if (res->flags & IORESOURCE_MEM)
39022 +               offset = hose->pci_mem_offset;
39023 +
39024 +       region->start = (res->start - offset) & mask;
39025 +       region->end = (res->end - offset) & mask;
39026 +}
39027 +EXPORT_SYMBOL(pcibios_resource_to_bus);
39028 +
39029 +void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
39030 +                            struct pci_bus_region *region)
39031 +{
39032 +       resource_size_t offset = 0, mask = (resource_size_t)-1;
39033 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
39034 +
39035 +       if (!hose)
39036 +               return;
39037 +       if (res->flags & IORESOURCE_IO) {
39038 +               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
39039 +               mask = 0xffffffffu;
39040 +       } else if (res->flags & IORESOURCE_MEM)
39041 +               offset = hose->pci_mem_offset;
39042 +       res->start = (region->start + offset) & mask;
39043 +       res->end = (region->end + offset) & mask;
39044 +}
39045 +EXPORT_SYMBOL(pcibios_bus_to_resource);
39046 +
39047 +/* Fixup a bus resource into a linux resource */
39048 +static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev)
39049 +{
39050 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
39051 +       resource_size_t offset = 0, mask = (resource_size_t)-1;
39052 +
39053 +       if (res->flags & IORESOURCE_IO) {
39054 +               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
39055 +               mask = 0xffffffffu;
39056 +       } else if (res->flags & IORESOURCE_MEM)
39057 +               offset = hose->pci_mem_offset;
39058 +
39059 +       res->start = (res->start + offset) & mask;
39060 +       res->end = (res->end + offset) & mask;
39061 +
39062 +       pr_debug("PCI:%s            %016llx-%016llx\n",
39063 +                pci_name(dev),
39064 +                (unsigned long long)res->start,
39065 +                (unsigned long long)res->end);
39066 +}
39067 +
39068 +
39069 +/* This header fixup will do the resource fixup for all devices as they are
39070 + * probed, but not for bridge ranges
39071 + */
39072 +static void __devinit pcibios_fixup_resources(struct pci_dev *dev)
39073 +{
39074 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
39075 +       int i;
39076 +
39077 +       if (!hose) {
39078 +               printk(KERN_ERR "No host bridge for PCI dev %s !\n",
39079 +                      pci_name(dev));
39080 +               return;
39081 +       }
39082 +       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
39083 +               struct resource *res = dev->resource + i;
39084 +               if (!res->flags)
39085 +                       continue;
39086 +               if (res->end == 0xffffffff) {
39087 +                       pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] is unassigned\n",
39088 +                                pci_name(dev), i,
39089 +                                (unsigned long long)res->start,
39090 +                                (unsigned long long)res->end,
39091 +                                (unsigned int)res->flags);
39092 +                       res->end -= res->start;
39093 +                       res->start = 0;
39094 +                       res->flags |= IORESOURCE_UNSET;
39095 +                       continue;
39096 +               }
39097 +
39098 +               pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] fixup...\n",
39099 +                        pci_name(dev), i,
39100 +                        (unsigned long long)res->start,\
39101 +                        (unsigned long long)res->end,
39102 +                        (unsigned int)res->flags);
39103 +
39104 +               fixup_resource(res, dev);
39105 +       }
39106 +
39107 +       /* Call machine specific resource fixup */
39108 +       if (ppc_md.pcibios_fixup_resources)
39109 +               ppc_md.pcibios_fixup_resources(dev);
39110 +}
39111 +DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);
39112 +
39113 +static void __devinit __pcibios_fixup_bus(struct pci_bus *bus)
39114 +{
39115 +       struct pci_controller *hose = pci_bus_to_host(bus);
39116 +       struct pci_dev *dev = bus->self;
39117 +
39118 +       pr_debug("PCI: Fixup bus %d (%s)\n", bus->number, dev ? pci_name(dev) : "PHB");
39119 +
39120 +       /* Fixup PCI<->PCI bridges. Host bridges are handled separately, for
39121 +        * now differently between 32 and 64 bits.
39122 +        */
39123 +       if (dev != NULL) {
39124 +               struct resource *res;
39125 +               int i;
39126 +
39127 +               for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
39128 +                       if ((res = bus->resource[i]) == NULL)
39129 +                               continue;
39130 +                       if (!res->flags)
39131 +                               continue;
39132 +                       if (i >= 3 && bus->self->transparent)
39133 +                               continue;
39134 +                       /* On PowerMac, Apple leaves bridge windows open over
39135 +                        * an inaccessible region of memory space (0...fffff)
39136 +                        * which is somewhat bogus, but that's what they think
39137 +                        * means disabled...
39138 +                        *
39139 +                        * We clear those to force them to be reallocated later
39140 +                        *
39141 +                        * We detect such regions by the fact that the base is
39142 +                        * equal to the pci_mem_offset of the host bridge and
39143 +                        * their size is smaller than 1M.
39144 +                        */
39145 +                       if (res->flags & IORESOURCE_MEM &&
39146 +                           res->start == hose->pci_mem_offset &&
39147 +                           res->end < 0x100000) {
39148 +                               printk(KERN_INFO
39149 +                                      "PCI: Closing bogus Apple Firmware"
39150 +                                      " region %d on bus 0x%02x\n",
39151 +                                      i, bus->number);
39152 +                               res->flags = 0;
39153 +                               continue;
39154 +                       }
39155 +
39156 +                       pr_debug("PCI:%s Bus rsrc %d %016llx-%016llx [%x] fixup...\n",
39157 +                                pci_name(dev), i,
39158 +                                (unsigned long long)res->start,\
39159 +                                (unsigned long long)res->end,
39160 +                                (unsigned int)res->flags);
39161 +
39162 +                       fixup_resource(res, dev);
39163 +               }
39164 +       }
39165 +
39166 +       /* Additional setup that is different between 32 and 64 bits for now */
39167 +       pcibios_do_bus_setup(bus);
39168 +
39169 +       /* Platform specific bus fixups */
39170 +       if (ppc_md.pcibios_fixup_bus)
39171 +               ppc_md.pcibios_fixup_bus(bus);
39172 +
39173 +       /* Read default IRQs and fixup if necessary */
39174 +       list_for_each_entry(dev, &bus->devices, bus_list) {
39175 +               pci_read_irq_line(dev);
39176 +               if (ppc_md.pci_irq_fixup)
39177 +                       ppc_md.pci_irq_fixup(dev);
39178 +       }
39179 +}
39180 +
39181 +void __devinit pcibios_fixup_bus(struct pci_bus *bus)
39182 +{
39183 +       /* When called from the generic PCI probe, read PCI<->PCI bridge
39184 +        * bases before proceeding
39185 +        */
39186 +       if (bus->self != NULL)
39187 +               pci_read_bridge_bases(bus);
39188 +       __pcibios_fixup_bus(bus);
39189 +}
39190 +EXPORT_SYMBOL(pcibios_fixup_bus);
39191 +
39192 +/* When building a bus from the OF tree rather than probing, we need a
39193 + * slightly different version of the fixup which doesn't read the
39194 + * bridge bases using config space accesses
39195 + */
39196 +void __devinit pcibios_fixup_of_probed_bus(struct pci_bus *bus)
39197 +{
39198 +       __pcibios_fixup_bus(bus);
39199 +}
39200 +
39201 +static int skip_isa_ioresource_align(struct pci_dev *dev)
39202 +{
39203 +       if ((ppc_pci_flags & PPC_PCI_CAN_SKIP_ISA_ALIGN) &&
39204 +           !(dev->bus->bridge_ctl & PCI_BRIDGE_CTL_ISA))
39205 +               return 1;
39206 +       return 0;
39207 +}
39208 +
39209 +/*
39210 + * We need to avoid collisions with `mirrored' VGA ports
39211 + * and other strange ISA hardware, so we always want the
39212 + * addresses to be allocated in the 0x000-0x0ff region
39213 + * modulo 0x400.
39214 + *
39215 + * Why? Because some silly external IO cards only decode
39216 + * the low 10 bits of the IO address. The 0x00-0xff region
39217 + * is reserved for motherboard devices that decode all 16
39218 + * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
39219 + * but we want to try to avoid allocating at 0x2900-0x2bff
39220 + * which might have be mirrored at 0x0100-0x03ff..
39221 + */
39222 +void pcibios_align_resource(void *data, struct resource *res,
39223 +                               resource_size_t size, resource_size_t align)
39224 +{
39225 +       struct pci_dev *dev = data;
39226 +
39227 +       if (res->flags & IORESOURCE_IO) {
39228 +               resource_size_t start = res->start;
39229 +
39230 +               if (skip_isa_ioresource_align(dev))
39231 +                       return;
39232 +               if (start & 0x300) {
39233 +                       start = (start + 0x3ff) & ~0x3ff;
39234 +                       res->start = start;
39235 +               }
39236 +       }
39237 +}
39238 +EXPORT_SYMBOL(pcibios_align_resource);
39239 +
39240 +/*
39241 + * Reparent resource children of pr that conflict with res
39242 + * under res, and make res replace those children.
39243 + */
39244 +static int __init reparent_resources(struct resource *parent,
39245 +                                    struct resource *res)
39246 +{
39247 +       struct resource *p, **pp;
39248 +       struct resource **firstpp = NULL;
39249 +
39250 +       for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) {
39251 +               if (p->end < res->start)
39252 +                       continue;
39253 +               if (res->end < p->start)
39254 +                       break;
39255 +               if (p->start < res->start || p->end > res->end)
39256 +                       return -1;      /* not completely contained */
39257 +               if (firstpp == NULL)
39258 +                       firstpp = pp;
39259 +       }
39260 +       if (firstpp == NULL)
39261 +               return -1;      /* didn't find any conflicting entries? */
39262 +       res->parent = parent;
39263 +       res->child = *firstpp;
39264 +       res->sibling = *pp;
39265 +       *firstpp = res;
39266 +       *pp = NULL;
39267 +       for (p = res->child; p != NULL; p = p->sibling) {
39268 +               p->parent = res;
39269 +               DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n",
39270 +                   p->name,
39271 +                   (unsigned long long)p->start,
39272 +                   (unsigned long long)p->end, res->name);
39273 +       }
39274 +       return 0;
39275 +}
39276 +
39277 +/*
39278 + *  Handle resources of PCI devices.  If the world were perfect, we could
39279 + *  just allocate all the resource regions and do nothing more.  It isn't.
39280 + *  On the other hand, we cannot just re-allocate all devices, as it would
39281 + *  require us to know lots of host bridge internals.  So we attempt to
39282 + *  keep as much of the original configuration as possible, but tweak it
39283 + *  when it's found to be wrong.
39284 + *
39285 + *  Known BIOS problems we have to work around:
39286 + *     - I/O or memory regions not configured
39287 + *     - regions configured, but not enabled in the command register
39288 + *     - bogus I/O addresses above 64K used
39289 + *     - expansion ROMs left enabled (this may sound harmless, but given
39290 + *       the fact the PCI specs explicitly allow address decoders to be
39291 + *       shared between expansion ROMs and other resource regions, it's
39292 + *       at least dangerous)
39293 + *
39294 + *  Our solution:
39295 + *     (1) Allocate resources for all buses behind PCI-to-PCI bridges.
39296 + *         This gives us fixed barriers on where we can allocate.
39297 + *     (2) Allocate resources for all enabled devices.  If there is
39298 + *         a collision, just mark the resource as unallocated. Also
39299 + *         disable expansion ROMs during this step.
39300 + *     (3) Try to allocate resources for disabled devices.  If the
39301 + *         resources were assigned correctly, everything goes well,
39302 + *         if they weren't, they won't disturb allocation of other
39303 + *         resources.
39304 + *     (4) Assign new addresses to resources which were either
39305 + *         not configured at all or misconfigured.  If explicitly
39306 + *         requested by the user, configure expansion ROM address
39307 + *         as well.
39308 + */
39309 +
39310 +static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
39311 +{
39312 +       struct pci_bus *bus;
39313 +       int i;
39314 +       struct resource *res, *pr;
39315 +
39316 +       /* Depth-First Search on bus tree */
39317 +       list_for_each_entry(bus, bus_list, node) {
39318 +               for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
39319 +                       if ((res = bus->resource[i]) == NULL || !res->flags
39320 +                           || res->start > res->end)
39321 +                               continue;
39322 +                       if (bus->parent == NULL)
39323 +                               pr = (res->flags & IORESOURCE_IO) ?
39324 +                                       &ioport_resource : &iomem_resource;
39325 +                       else {
39326 +                               /* Don't bother with non-root busses when
39327 +                                * re-assigning all resources. We clear the
39328 +                                * resource flags as if they were colliding
39329 +                                * and as such ensure proper re-allocation
39330 +                                * later.
39331 +                                */
39332 +                               if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_RSRC)
39333 +                                       goto clear_resource;
39334 +                               pr = pci_find_parent_resource(bus->self, res);
39335 +                               if (pr == res) {
39336 +                                       /* this happens when the generic PCI
39337 +                                        * code (wrongly) decides that this
39338 +                                        * bridge is transparent  -- paulus
39339 +                                        */
39340 +                                       continue;
39341 +                               }
39342 +                       }
39343 +
39344 +                       DBG("PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx "
39345 +                           "[0x%x], parent %p (%s)\n",
39346 +                           bus->self ? pci_name(bus->self) : "PHB",
39347 +                           bus->number, i,
39348 +                           (unsigned long long)res->start,
39349 +                           (unsigned long long)res->end,
39350 +                           (unsigned int)res->flags,
39351 +                           pr, (pr && pr->name) ? pr->name : "nil");
39352 +
39353 +                       if (pr && !(pr->flags & IORESOURCE_UNSET)) {
39354 +                               if (request_resource(pr, res) == 0)
39355 +                                       continue;
39356 +                               /*
39357 +                                * Must be a conflict with an existing entry.
39358 +                                * Move that entry (or entries) under the
39359 +                                * bridge resource and try again.
39360 +                                */
39361 +                               if (reparent_resources(pr, res) == 0)
39362 +                                       continue;
39363 +                       }
39364 +                       printk(KERN_WARNING
39365 +                              "PCI: Cannot allocate resource region "
39366 +                              "%d of PCI bridge %d, will remap\n",
39367 +                              i, bus->number);
39368 +clear_resource:
39369 +                       res->flags = 0;
39370 +               }
39371 +               pcibios_allocate_bus_resources(&bus->children);
39372 +       }
39373 +}
39374 +
39375 +static inline void __devinit alloc_resource(struct pci_dev *dev, int idx)
39376 +{
39377 +       struct resource *pr, *r = &dev->resource[idx];
39378 +
39379 +       DBG("PCI: Allocating %s: Resource %d: %016llx..%016llx [%x]\n",
39380 +           pci_name(dev), idx,
39381 +           (unsigned long long)r->start,
39382 +           (unsigned long long)r->end,
39383 +           (unsigned int)r->flags);
39384 +
39385 +       pr = pci_find_parent_resource(dev, r);
39386 +       if (!pr || (pr->flags & IORESOURCE_UNSET) ||
39387 +           request_resource(pr, r) < 0) {
39388 +               printk(KERN_WARNING "PCI: Cannot allocate resource region %d"
39389 +                      " of device %s, will remap\n", idx, pci_name(dev));
39390 +               if (pr)
39391 +                       DBG("PCI:  parent is %p: %016llx-%016llx [%x]\n", pr,
39392 +                           (unsigned long long)pr->start,
39393 +                           (unsigned long long)pr->end,
39394 +                           (unsigned int)pr->flags);
39395 +               /* We'll assign a new address later */
39396 +               r->flags |= IORESOURCE_UNSET;
39397 +               r->end -= r->start;
39398 +               r->start = 0;
39399 +       }
39400 +}
39401 +
39402 +static void __init pcibios_allocate_resources(int pass)
39403 +{
39404 +       struct pci_dev *dev = NULL;
39405 +       int idx, disabled;
39406 +       u16 command;
39407 +       struct resource *r;
39408 +
39409 +       for_each_pci_dev(dev) {
39410 +               pci_read_config_word(dev, PCI_COMMAND, &command);
39411 +               for (idx = 0; idx < 6; idx++) {
39412 +                       r = &dev->resource[idx];
39413 +                       if (r->parent)          /* Already allocated */
39414 +                               continue;
39415 +                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
39416 +                               continue;       /* Not assigned at all */
39417 +                       if (r->flags & IORESOURCE_IO)
39418 +                               disabled = !(command & PCI_COMMAND_IO);
39419 +                       else
39420 +                               disabled = !(command & PCI_COMMAND_MEMORY);
39421 +                       if (pass == disabled)
39422 +                               alloc_resource(dev, idx);
39423 +               }
39424 +               if (pass)
39425 +                       continue;
39426 +               r = &dev->resource[PCI_ROM_RESOURCE];
39427 +               if (r->flags & IORESOURCE_ROM_ENABLE) {
39428 +                       /* Turn the ROM off, leave the resource region,
39429 +                        * but keep it unregistered.
39430 +                        */
39431 +                       u32 reg;
39432 +                       DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
39433 +                       r->flags &= ~IORESOURCE_ROM_ENABLE;
39434 +                       pci_read_config_dword(dev, dev->rom_base_reg, &reg);
39435 +                       pci_write_config_dword(dev, dev->rom_base_reg,
39436 +                                              reg & ~PCI_ROM_ADDRESS_ENABLE);
39437 +               }
39438 +       }
39439 +}
39440 +
39441 +void __init pcibios_resource_survey(void)
39442 +{
39443 +       /* Allocate and assign resources. If we re-assign everything, then
39444 +        * we skip the allocate phase
39445 +        */
39446 +       pcibios_allocate_bus_resources(&pci_root_buses);
39447 +
39448 +       if (!(ppc_pci_flags & PPC_PCI_REASSIGN_ALL_RSRC)) {
39449 +               pcibios_allocate_resources(0);
39450 +               pcibios_allocate_resources(1);
39451 +       }
39452 +
39453 +       if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
39454 +               DBG("PCI: Assigning unassigned resouces...\n");
39455 +               pci_assign_unassigned_resources();
39456 +       }
39457 +
39458 +       /* Call machine dependent fixup */
39459 +       if (ppc_md.pcibios_fixup)
39460 +               ppc_md.pcibios_fixup();
39461 +}
39462 +
39463 +#ifdef CONFIG_HOTPLUG
39464 +/* This is used by the pSeries hotplug driver to allocate resource
39465 + * of newly plugged busses. We can try to consolidate with the
39466 + * rest of the code later, for now, keep it as-is
39467 + */
39468 +void __devinit pcibios_claim_one_bus(struct pci_bus *bus)
39469 +{
39470 +       struct pci_dev *dev;
39471 +       struct pci_bus *child_bus;
39472 +
39473 +       list_for_each_entry(dev, &bus->devices, bus_list) {
39474 +               int i;
39475 +
39476 +               for (i = 0; i < PCI_NUM_RESOURCES; i++) {
39477 +                       struct resource *r = &dev->resource[i];
39478 +
39479 +                       if (r->parent || !r->start || !r->flags)
39480 +                               continue;
39481 +                       pci_claim_resource(dev, i);
39482 +               }
39483 +       }
39484 +
39485 +       list_for_each_entry(child_bus, &bus->children, node)
39486 +               pcibios_claim_one_bus(child_bus);
39487 +}
39488 +EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);
39489 +#endif /* CONFIG_HOTPLUG */
39490 +
39491 +int pcibios_enable_device(struct pci_dev *dev, int mask)
39492 +{
39493 +       u16 cmd, old_cmd;
39494 +       int idx;
39495 +       struct resource *r;
39496 +
39497 +       if (ppc_md.pcibios_enable_device_hook)
39498 +               if (ppc_md.pcibios_enable_device_hook(dev))
39499 +                       return -EINVAL;
39500 +
39501 +       pci_read_config_word(dev, PCI_COMMAND, &cmd);
39502 +       old_cmd = cmd;
39503 +       for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
39504 +               /* Only set up the requested stuff */
39505 +               if (!(mask & (1 << idx)))
39506 +                       continue;
39507 +               r = &dev->resource[idx];
39508 +               if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
39509 +                       continue;
39510 +               if ((idx == PCI_ROM_RESOURCE) &&
39511 +                               (!(r->flags & IORESOURCE_ROM_ENABLE)))
39512 +                       continue;
39513 +               if (r->parent == NULL) {
39514 +                       printk(KERN_ERR "PCI: Device %s not available because"
39515 +                              " of resource collisions\n", pci_name(dev));
39516 +                       return -EINVAL;
39517 +               }
39518 +               if (r->flags & IORESOURCE_IO)
39519 +                       cmd |= PCI_COMMAND_IO;
39520 +               if (r->flags & IORESOURCE_MEM)
39521 +                       cmd |= PCI_COMMAND_MEMORY;
39522 +       }
39523 +       if (cmd != old_cmd) {
39524 +               printk("PCI: Enabling device %s (%04x -> %04x)\n",
39525 +                      pci_name(dev), old_cmd, cmd);
39526 +               pci_write_config_word(dev, PCI_COMMAND, cmd);
39527 +       }
39528 +       return 0;
39529 +}
39530 +
39531 Index: linux-2.6.24.7/arch/powerpc/kernel/pci_32.c
39532 ===================================================================
39533 --- linux-2.6.24.7.orig/arch/powerpc/kernel/pci_32.c
39534 +++ linux-2.6.24.7/arch/powerpc/kernel/pci_32.c
39535 @@ -13,6 +13,7 @@
39536  #include <linux/bootmem.h>
39537  #include <linux/irq.h>
39538  #include <linux/list.h>
39539 +#include <linux/of.h>
39540  
39541  #include <asm/processor.h>
39542  #include <asm/io.h>
39543 @@ -32,19 +33,12 @@
39544  #endif
39545  
39546  unsigned long isa_io_base     = 0;
39547 -unsigned long isa_mem_base    = 0;
39548  unsigned long pci_dram_offset = 0;
39549  int pcibios_assign_bus_offset = 1;
39550  
39551  void pcibios_make_OF_bus_map(void);
39552  
39553 -static int pci_relocate_bridge_resource(struct pci_bus *bus, int i);
39554 -static int probe_resource(struct pci_bus *parent, struct resource *pr,
39555 -                         struct resource *res, struct resource **conflict);
39556 -static void update_bridge_base(struct pci_bus *bus, int i);
39557 -static void pcibios_fixup_resources(struct pci_dev* dev);
39558  static void fixup_broken_pcnet32(struct pci_dev* dev);
39559 -static int reparent_resources(struct resource *parent, struct resource *res);
39560  static void fixup_cpc710_pci64(struct pci_dev* dev);
39561  #ifdef CONFIG_PPC_OF
39562  static u8* pci_to_OF_bus_map;
39563 @@ -53,7 +47,7 @@ static u8* pci_to_OF_bus_map;
39564  /* By default, we don't re-assign bus numbers. We do this only on
39565   * some pmacs
39566   */
39567 -int pci_assign_all_buses;
39568 +static int pci_assign_all_buses;
39569  
39570  LIST_HEAD(hose_list);
39571  
39572 @@ -100,505 +94,6 @@ fixup_cpc710_pci64(struct pci_dev* dev)
39573  }
39574  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,    PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64);
39575  
39576 -static void
39577 -pcibios_fixup_resources(struct pci_dev *dev)
39578 -{
39579 -       struct pci_controller* hose = (struct pci_controller *)dev->sysdata;
39580 -       int i;
39581 -       unsigned long offset;
39582 -
39583 -       if (!hose) {
39584 -               printk(KERN_ERR "No hose for PCI dev %s!\n", pci_name(dev));
39585 -               return;
39586 -       }
39587 -       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
39588 -               struct resource *res = dev->resource + i;
39589 -               if (!res->flags)
39590 -                       continue;
39591 -               if (res->end == 0xffffffff) {
39592 -                       DBG("PCI:%s Resource %d [%016llx-%016llx] is unassigned\n",
39593 -                           pci_name(dev), i, (u64)res->start, (u64)res->end);
39594 -                       res->end -= res->start;
39595 -                       res->start = 0;
39596 -                       res->flags |= IORESOURCE_UNSET;
39597 -                       continue;
39598 -               }
39599 -               offset = 0;
39600 -               if (res->flags & IORESOURCE_MEM) {
39601 -                       offset = hose->pci_mem_offset;
39602 -               } else if (res->flags & IORESOURCE_IO) {
39603 -                       offset = (unsigned long) hose->io_base_virt
39604 -                               - isa_io_base;
39605 -               }
39606 -               if (offset != 0) {
39607 -                       res->start += offset;
39608 -                       res->end += offset;
39609 -                       DBG("Fixup res %d (%lx) of dev %s: %llx -> %llx\n",
39610 -                           i, res->flags, pci_name(dev),
39611 -                           (u64)res->start - offset, (u64)res->start);
39612 -               }
39613 -       }
39614 -
39615 -       /* Call machine specific resource fixup */
39616 -       if (ppc_md.pcibios_fixup_resources)
39617 -               ppc_md.pcibios_fixup_resources(dev);
39618 -}
39619 -DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID,           PCI_ANY_ID,                     pcibios_fixup_resources);
39620 -
39621 -void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
39622 -                       struct resource *res)
39623 -{
39624 -       unsigned long offset = 0;
39625 -       struct pci_controller *hose = dev->sysdata;
39626 -
39627 -       if (hose && res->flags & IORESOURCE_IO)
39628 -               offset = (unsigned long)hose->io_base_virt - isa_io_base;
39629 -       else if (hose && res->flags & IORESOURCE_MEM)
39630 -               offset = hose->pci_mem_offset;
39631 -       region->start = res->start - offset;
39632 -       region->end = res->end - offset;
39633 -}
39634 -EXPORT_SYMBOL(pcibios_resource_to_bus);
39635 -
39636 -void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
39637 -                            struct pci_bus_region *region)
39638 -{
39639 -       unsigned long offset = 0;
39640 -       struct pci_controller *hose = dev->sysdata;
39641 -
39642 -       if (hose && res->flags & IORESOURCE_IO)
39643 -               offset = (unsigned long)hose->io_base_virt - isa_io_base;
39644 -       else if (hose && res->flags & IORESOURCE_MEM)
39645 -               offset = hose->pci_mem_offset;
39646 -       res->start = region->start + offset;
39647 -       res->end = region->end + offset;
39648 -}
39649 -EXPORT_SYMBOL(pcibios_bus_to_resource);
39650 -
39651 -/*
39652 - * We need to avoid collisions with `mirrored' VGA ports
39653 - * and other strange ISA hardware, so we always want the
39654 - * addresses to be allocated in the 0x000-0x0ff region
39655 - * modulo 0x400.
39656 - *
39657 - * Why? Because some silly external IO cards only decode
39658 - * the low 10 bits of the IO address. The 0x00-0xff region
39659 - * is reserved for motherboard devices that decode all 16
39660 - * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
39661 - * but we want to try to avoid allocating at 0x2900-0x2bff
39662 - * which might have be mirrored at 0x0100-0x03ff..
39663 - */
39664 -void pcibios_align_resource(void *data, struct resource *res,
39665 -                               resource_size_t size, resource_size_t align)
39666 -{
39667 -       struct pci_dev *dev = data;
39668 -
39669 -       if (res->flags & IORESOURCE_IO) {
39670 -               resource_size_t start = res->start;
39671 -
39672 -               if (size > 0x100) {
39673 -                       printk(KERN_ERR "PCI: I/O Region %s/%d too large"
39674 -                              " (%lld bytes)\n", pci_name(dev),
39675 -                              dev->resource - res, (unsigned long long)size);
39676 -               }
39677 -
39678 -               if (start & 0x300) {
39679 -                       start = (start + 0x3ff) & ~0x3ff;
39680 -                       res->start = start;
39681 -               }
39682 -       }
39683 -}
39684 -EXPORT_SYMBOL(pcibios_align_resource);
39685 -
39686 -/*
39687 - *  Handle resources of PCI devices.  If the world were perfect, we could
39688 - *  just allocate all the resource regions and do nothing more.  It isn't.
39689 - *  On the other hand, we cannot just re-allocate all devices, as it would
39690 - *  require us to know lots of host bridge internals.  So we attempt to
39691 - *  keep as much of the original configuration as possible, but tweak it
39692 - *  when it's found to be wrong.
39693 - *
39694 - *  Known BIOS problems we have to work around:
39695 - *     - I/O or memory regions not configured
39696 - *     - regions configured, but not enabled in the command register
39697 - *     - bogus I/O addresses above 64K used
39698 - *     - expansion ROMs left enabled (this may sound harmless, but given
39699 - *       the fact the PCI specs explicitly allow address decoders to be
39700 - *       shared between expansion ROMs and other resource regions, it's
39701 - *       at least dangerous)
39702 - *
39703 - *  Our solution:
39704 - *     (1) Allocate resources for all buses behind PCI-to-PCI bridges.
39705 - *         This gives us fixed barriers on where we can allocate.
39706 - *     (2) Allocate resources for all enabled devices.  If there is
39707 - *         a collision, just mark the resource as unallocated. Also
39708 - *         disable expansion ROMs during this step.
39709 - *     (3) Try to allocate resources for disabled devices.  If the
39710 - *         resources were assigned correctly, everything goes well,
39711 - *         if they weren't, they won't disturb allocation of other
39712 - *         resources.
39713 - *     (4) Assign new addresses to resources which were either
39714 - *         not configured at all or misconfigured.  If explicitly
39715 - *         requested by the user, configure expansion ROM address
39716 - *         as well.
39717 - */
39718 -
39719 -static void __init
39720 -pcibios_allocate_bus_resources(struct list_head *bus_list)
39721 -{
39722 -       struct pci_bus *bus;
39723 -       int i;
39724 -       struct resource *res, *pr;
39725 -
39726 -       /* Depth-First Search on bus tree */
39727 -       list_for_each_entry(bus, bus_list, node) {
39728 -               for (i = 0; i < 4; ++i) {
39729 -                       if ((res = bus->resource[i]) == NULL || !res->flags
39730 -                           || res->start > res->end)
39731 -                               continue;
39732 -                       if (bus->parent == NULL)
39733 -                               pr = (res->flags & IORESOURCE_IO)?
39734 -                                       &ioport_resource: &iomem_resource;
39735 -                       else {
39736 -                               pr = pci_find_parent_resource(bus->self, res);
39737 -                               if (pr == res) {
39738 -                                       /* this happens when the generic PCI
39739 -                                        * code (wrongly) decides that this
39740 -                                        * bridge is transparent  -- paulus
39741 -                                        */
39742 -                                       continue;
39743 -                               }
39744 -                       }
39745 -
39746 -                       DBG("PCI: bridge rsrc %llx..%llx (%lx), parent %p\n",
39747 -                           (u64)res->start, (u64)res->end, res->flags, pr);
39748 -                       if (pr) {
39749 -                               if (request_resource(pr, res) == 0)
39750 -                                       continue;
39751 -                               /*
39752 -                                * Must be a conflict with an existing entry.
39753 -                                * Move that entry (or entries) under the
39754 -                                * bridge resource and try again.
39755 -                                */
39756 -                               if (reparent_resources(pr, res) == 0)
39757 -                                       continue;
39758 -                       }
39759 -                       printk(KERN_ERR "PCI: Cannot allocate resource region "
39760 -                              "%d of PCI bridge %d\n", i, bus->number);
39761 -                       if (pci_relocate_bridge_resource(bus, i))
39762 -                               bus->resource[i] = NULL;
39763 -               }
39764 -               pcibios_allocate_bus_resources(&bus->children);
39765 -       }
39766 -}
39767 -
39768 -/*
39769 - * Reparent resource children of pr that conflict with res
39770 - * under res, and make res replace those children.
39771 - */
39772 -static int __init
39773 -reparent_resources(struct resource *parent, struct resource *res)
39774 -{
39775 -       struct resource *p, **pp;
39776 -       struct resource **firstpp = NULL;
39777 -
39778 -       for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) {
39779 -               if (p->end < res->start)
39780 -                       continue;
39781 -               if (res->end < p->start)
39782 -                       break;
39783 -               if (p->start < res->start || p->end > res->end)
39784 -                       return -1;      /* not completely contained */
39785 -               if (firstpp == NULL)
39786 -                       firstpp = pp;
39787 -       }
39788 -       if (firstpp == NULL)
39789 -               return -1;      /* didn't find any conflicting entries? */
39790 -       res->parent = parent;
39791 -       res->child = *firstpp;
39792 -       res->sibling = *pp;
39793 -       *firstpp = res;
39794 -       *pp = NULL;
39795 -       for (p = res->child; p != NULL; p = p->sibling) {
39796 -               p->parent = res;
39797 -               DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n",
39798 -                   p->name, (u64)p->start, (u64)p->end, res->name);
39799 -       }
39800 -       return 0;
39801 -}
39802 -
39803 -/*
39804 - * A bridge has been allocated a range which is outside the range
39805 - * of its parent bridge, so it needs to be moved.
39806 - */
39807 -static int __init
39808 -pci_relocate_bridge_resource(struct pci_bus *bus, int i)
39809 -{
39810 -       struct resource *res, *pr, *conflict;
39811 -       unsigned long try, size;
39812 -       int j;
39813 -       struct pci_bus *parent = bus->parent;
39814 -
39815 -       if (parent == NULL) {
39816 -               /* shouldn't ever happen */
39817 -               printk(KERN_ERR "PCI: can't move host bridge resource\n");
39818 -               return -1;
39819 -       }
39820 -       res = bus->resource[i];
39821 -       if (res == NULL)
39822 -               return -1;
39823 -       pr = NULL;
39824 -       for (j = 0; j < 4; j++) {
39825 -               struct resource *r = parent->resource[j];
39826 -               if (!r)
39827 -                       continue;
39828 -               if ((res->flags ^ r->flags) & (IORESOURCE_IO | IORESOURCE_MEM))
39829 -                       continue;
39830 -               if (!((res->flags ^ r->flags) & IORESOURCE_PREFETCH)) {
39831 -                       pr = r;
39832 -                       break;
39833 -               }
39834 -               if (res->flags & IORESOURCE_PREFETCH)
39835 -                       pr = r;
39836 -       }
39837 -       if (pr == NULL)
39838 -               return -1;
39839 -       size = res->end - res->start;
39840 -       if (pr->start > pr->end || size > pr->end - pr->start)
39841 -               return -1;
39842 -       try = pr->end;
39843 -       for (;;) {
39844 -               res->start = try - size;
39845 -               res->end = try;
39846 -               if (probe_resource(bus->parent, pr, res, &conflict) == 0)
39847 -                       break;
39848 -               if (conflict->start <= pr->start + size)
39849 -                       return -1;
39850 -               try = conflict->start - 1;
39851 -       }
39852 -       if (request_resource(pr, res)) {
39853 -               DBG(KERN_ERR "PCI: huh? couldn't move to %llx..%llx\n",
39854 -                   (u64)res->start, (u64)res->end);
39855 -               return -1;              /* "can't happen" */
39856 -       }
39857 -       update_bridge_base(bus, i);
39858 -       printk(KERN_INFO "PCI: bridge %d resource %d moved to %llx..%llx\n",
39859 -              bus->number, i, (unsigned long long)res->start,
39860 -              (unsigned long long)res->end);
39861 -       return 0;
39862 -}
39863 -
39864 -static int __init
39865 -probe_resource(struct pci_bus *parent, struct resource *pr,
39866 -              struct resource *res, struct resource **conflict)
39867 -{
39868 -       struct pci_bus *bus;
39869 -       struct pci_dev *dev;
39870 -       struct resource *r;
39871 -       int i;
39872 -
39873 -       for (r = pr->child; r != NULL; r = r->sibling) {
39874 -               if (r->end >= res->start && res->end >= r->start) {
39875 -                       *conflict = r;
39876 -                       return 1;
39877 -               }
39878 -       }
39879 -       list_for_each_entry(bus, &parent->children, node) {
39880 -               for (i = 0; i < 4; ++i) {
39881 -                       if ((r = bus->resource[i]) == NULL)
39882 -                               continue;
39883 -                       if (!r->flags || r->start > r->end || r == res)
39884 -                               continue;
39885 -                       if (pci_find_parent_resource(bus->self, r) != pr)
39886 -                               continue;
39887 -                       if (r->end >= res->start && res->end >= r->start) {
39888 -                               *conflict = r;
39889 -                               return 1;
39890 -                       }
39891 -               }
39892 -       }
39893 -       list_for_each_entry(dev, &parent->devices, bus_list) {
39894 -               for (i = 0; i < 6; ++i) {
39895 -                       r = &dev->resource[i];
39896 -                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
39897 -                               continue;
39898 -                       if (pci_find_parent_resource(dev, r) != pr)
39899 -                               continue;
39900 -                       if (r->end >= res->start && res->end >= r->start) {
39901 -                               *conflict = r;
39902 -                               return 1;
39903 -                       }
39904 -               }
39905 -       }
39906 -       return 0;
39907 -}
39908 -
39909 -void __init
39910 -update_bridge_resource(struct pci_dev *dev, struct resource *res)
39911 -{
39912 -       u8 io_base_lo, io_limit_lo;
39913 -       u16 mem_base, mem_limit;
39914 -       u16 cmd;
39915 -       unsigned long start, end, off;
39916 -       struct pci_controller *hose = dev->sysdata;
39917 -
39918 -       if (!hose) {
39919 -               printk("update_bridge_base: no hose?\n");
39920 -               return;
39921 -       }
39922 -       pci_read_config_word(dev, PCI_COMMAND, &cmd);
39923 -       pci_write_config_word(dev, PCI_COMMAND,
39924 -                             cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY));
39925 -       if (res->flags & IORESOURCE_IO) {
39926 -               off = (unsigned long) hose->io_base_virt - isa_io_base;
39927 -               start = res->start - off;
39928 -               end = res->end - off;
39929 -               io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK;
39930 -               io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK;
39931 -               if (end > 0xffff)
39932 -                       io_base_lo |= PCI_IO_RANGE_TYPE_32;
39933 -               else
39934 -                       io_base_lo |= PCI_IO_RANGE_TYPE_16;
39935 -               pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
39936 -                               start >> 16);
39937 -               pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
39938 -                               end >> 16);
39939 -               pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo);
39940 -               pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo);
39941 -
39942 -       } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
39943 -                  == IORESOURCE_MEM) {
39944 -               off = hose->pci_mem_offset;
39945 -               mem_base = ((res->start - off) >> 16) & PCI_MEMORY_RANGE_MASK;
39946 -               mem_limit = ((res->end - off) >> 16) & PCI_MEMORY_RANGE_MASK;
39947 -               pci_write_config_word(dev, PCI_MEMORY_BASE, mem_base);
39948 -               pci_write_config_word(dev, PCI_MEMORY_LIMIT, mem_limit);
39949 -
39950 -       } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
39951 -                  == (IORESOURCE_MEM | IORESOURCE_PREFETCH)) {
39952 -               off = hose->pci_mem_offset;
39953 -               mem_base = ((res->start - off) >> 16) & PCI_PREF_RANGE_MASK;
39954 -               mem_limit = ((res->end - off) >> 16) & PCI_PREF_RANGE_MASK;
39955 -               pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, mem_base);
39956 -               pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
39957 -
39958 -       } else {
39959 -               DBG(KERN_ERR "PCI: ugh, bridge %s res has flags=%lx\n",
39960 -                   pci_name(dev), res->flags);
39961 -       }
39962 -       pci_write_config_word(dev, PCI_COMMAND, cmd);
39963 -}
39964 -
39965 -static void __init
39966 -update_bridge_base(struct pci_bus *bus, int i)
39967 -{
39968 -       struct resource *res = bus->resource[i];
39969 -       struct pci_dev *dev = bus->self;
39970 -       update_bridge_resource(dev, res);
39971 -}
39972 -
39973 -static inline void alloc_resource(struct pci_dev *dev, int idx)
39974 -{
39975 -       struct resource *pr, *r = &dev->resource[idx];
39976 -
39977 -       DBG("PCI:%s: Resource %d: %016llx-%016llx (f=%lx)\n",
39978 -           pci_name(dev), idx, (u64)r->start, (u64)r->end, r->flags);
39979 -       pr = pci_find_parent_resource(dev, r);
39980 -       if (!pr || request_resource(pr, r) < 0) {
39981 -               printk(KERN_ERR "PCI: Cannot allocate resource region %d"
39982 -                      " of device %s\n", idx, pci_name(dev));
39983 -               if (pr)
39984 -                       DBG("PCI:  parent is %p: %016llx-%016llx (f=%lx)\n",
39985 -                           pr, (u64)pr->start, (u64)pr->end, pr->flags);
39986 -               /* We'll assign a new address later */
39987 -               r->flags |= IORESOURCE_UNSET;
39988 -               r->end -= r->start;
39989 -               r->start = 0;
39990 -       }
39991 -}
39992 -
39993 -static void __init
39994 -pcibios_allocate_resources(int pass)
39995 -{
39996 -       struct pci_dev *dev = NULL;
39997 -       int idx, disabled;
39998 -       u16 command;
39999 -       struct resource *r;
40000 -
40001 -       for_each_pci_dev(dev) {
40002 -               pci_read_config_word(dev, PCI_COMMAND, &command);
40003 -               for (idx = 0; idx < 6; idx++) {
40004 -                       r = &dev->resource[idx];
40005 -                       if (r->parent)          /* Already allocated */
40006 -                               continue;
40007 -                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
40008 -                               continue;       /* Not assigned at all */
40009 -                       if (r->flags & IORESOURCE_IO)
40010 -                               disabled = !(command & PCI_COMMAND_IO);
40011 -                       else
40012 -                               disabled = !(command & PCI_COMMAND_MEMORY);
40013 -                       if (pass == disabled)
40014 -                               alloc_resource(dev, idx);
40015 -               }
40016 -               if (pass)
40017 -                       continue;
40018 -               r = &dev->resource[PCI_ROM_RESOURCE];
40019 -               if (r->flags & IORESOURCE_ROM_ENABLE) {
40020 -                       /* Turn the ROM off, leave the resource region, but keep it unregistered. */
40021 -                       u32 reg;
40022 -                       DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
40023 -                       r->flags &= ~IORESOURCE_ROM_ENABLE;
40024 -                       pci_read_config_dword(dev, dev->rom_base_reg, &reg);
40025 -                       pci_write_config_dword(dev, dev->rom_base_reg,
40026 -                                              reg & ~PCI_ROM_ADDRESS_ENABLE);
40027 -               }
40028 -       }
40029 -}
40030 -
40031 -static void __init
40032 -pcibios_assign_resources(void)
40033 -{
40034 -       struct pci_dev *dev = NULL;
40035 -       int idx;
40036 -       struct resource *r;
40037 -
40038 -       for_each_pci_dev(dev) {
40039 -               int class = dev->class >> 8;
40040 -
40041 -               /* Don't touch classless devices and host bridges */
40042 -               if (!class || class == PCI_CLASS_BRIDGE_HOST)
40043 -                       continue;
40044 -
40045 -               for (idx = 0; idx < 6; idx++) {
40046 -                       r = &dev->resource[idx];
40047 -
40048 -                       /*
40049 -                        * We shall assign a new address to this resource,
40050 -                        * either because the BIOS (sic) forgot to do so
40051 -                        * or because we have decided the old address was
40052 -                        * unusable for some reason.
40053 -                        */
40054 -                       if ((r->flags & IORESOURCE_UNSET) && r->end &&
40055 -                           (!ppc_md.pcibios_enable_device_hook ||
40056 -                            !ppc_md.pcibios_enable_device_hook(dev, 1))) {
40057 -                               int rc;
40058 -
40059 -                               r->flags &= ~IORESOURCE_UNSET;
40060 -                               rc = pci_assign_resource(dev, idx);
40061 -                               BUG_ON(rc);
40062 -                       }
40063 -               }
40064 -
40065 -#if 0 /* don't assign ROMs */
40066 -               r = &dev->resource[PCI_ROM_RESOURCE];
40067 -               r->end -= r->start;
40068 -               r->start = 0;
40069 -               if (r->end)
40070 -                       pci_assign_resource(dev, PCI_ROM_RESOURCE);
40071 -#endif
40072 -       }
40073 -}
40074 -
40075  #ifdef CONFIG_PPC_OF
40076  /*
40077   * Functions below are used on OpenFirmware machines.
40078 @@ -619,7 +114,7 @@ make_one_node_map(struct device_node* no
40079         } else
40080                 pci_to_OF_bus_map[pci_bus] = bus_range[0];
40081  
40082 -       for (node=node->child; node != 0;node = node->sibling) {
40083 +       for_each_child_of_node(node, node) {
40084                 struct pci_dev* dev;
40085                 const unsigned int *class_code, *reg;
40086         
40087 @@ -662,8 +157,8 @@ pcibios_make_OF_bus_map(void)
40088  
40089         /* For each hose, we begin searching bridges */
40090         list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
40091 -               struct device_node* node;       
40092 -               node = (struct device_node *)hose->arch_data;
40093 +               struct device_node* node = hose->dn;
40094 +
40095                 if (!node)
40096                         continue;
40097                 make_one_node_map(node, hose->first_busno);
40098 @@ -688,15 +183,18 @@ pcibios_make_OF_bus_map(void)
40099  typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
40100  
40101  static struct device_node*
40102 -scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data)
40103 +scan_OF_pci_childs(struct device_node *parent, pci_OF_scan_iterator filter, void* data)
40104  {
40105 +       struct device_node *node;
40106         struct device_node* sub_node;
40107  
40108 -       for (; node != 0;node = node->sibling) {
40109 +       for_each_child_of_node(parent, node) {
40110                 const unsigned int *class_code;
40111         
40112 -               if (filter(node, data))
40113 +               if (filter(node, data)) {
40114 +                       of_node_put(node);
40115                         return node;
40116 +               }
40117  
40118                 /* For PCI<->PCI bridges or CardBus bridges, we go down
40119                  * Note: some OFs create a parent node "multifunc-device" as
40120 @@ -708,9 +206,11 @@ scan_OF_pci_childs(struct device_node* n
40121                         (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
40122                         strcmp(node->name, "multifunc-device"))
40123                         continue;
40124 -               sub_node = scan_OF_pci_childs(node->child, filter, data);
40125 -               if (sub_node)
40126 +               sub_node = scan_OF_pci_childs(node, filter, data);
40127 +               if (sub_node) {
40128 +                       of_node_put(node);
40129                         return sub_node;
40130 +               }
40131         }
40132         return NULL;
40133  }
40134 @@ -718,11 +218,11 @@ scan_OF_pci_childs(struct device_node* n
40135  static struct device_node *scan_OF_for_pci_dev(struct device_node *parent,
40136                                                unsigned int devfn)
40137  {
40138 -       struct device_node *np = NULL;
40139 +       struct device_node *np;
40140         const u32 *reg;
40141         unsigned int psize;
40142  
40143 -       while ((np = of_get_next_child(parent, np)) != NULL) {
40144 +       for_each_child_of_node(parent, np) {
40145                 reg = of_get_property(np, "reg", &psize);
40146                 if (reg == NULL || psize < 4)
40147                         continue;
40148 @@ -742,7 +242,7 @@ static struct device_node *scan_OF_for_p
40149                 struct pci_controller *hose = pci_bus_to_host(bus);
40150                 if (hose == NULL)
40151                         return NULL;
40152 -               return of_node_get(hose->arch_data);
40153 +               return of_node_get(hose->dn);
40154         }
40155  
40156         /* not a root bus, we need to get our parent */
40157 @@ -812,9 +312,9 @@ pci_device_from_OF_node(struct device_no
40158                 return -ENODEV;
40159         /* Make sure it's really a PCI device */
40160         hose = pci_find_hose_for_OF_device(node);
40161 -       if (!hose || !hose->arch_data)
40162 +       if (!hose || !hose->dn)
40163                 return -ENODEV;
40164 -       if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
40165 +       if (!scan_OF_pci_childs(hose->dn,
40166                         find_OF_pci_device_filter, (void *)node))
40167                 return -ENODEV;
40168         reg = of_get_property(node, "reg", NULL);
40169 @@ -843,120 +343,6 @@ pci_device_from_OF_node(struct device_no
40170  }
40171  EXPORT_SYMBOL(pci_device_from_OF_node);
40172  
40173 -void __init
40174 -pci_process_bridge_OF_ranges(struct pci_controller *hose,
40175 -                          struct device_node *dev, int primary)
40176 -{
40177 -       static unsigned int static_lc_ranges[256] __initdata;
40178 -       const unsigned int *dt_ranges;
40179 -       unsigned int *lc_ranges, *ranges, *prev, size;
40180 -       int rlen = 0, orig_rlen;
40181 -       int memno = 0;
40182 -       struct resource *res;
40183 -       int np, na = of_n_addr_cells(dev);
40184 -       np = na + 5;
40185 -
40186 -       /* First we try to merge ranges to fix a problem with some pmacs
40187 -        * that can have more than 3 ranges, fortunately using contiguous
40188 -        * addresses -- BenH
40189 -        */
40190 -       dt_ranges = of_get_property(dev, "ranges", &rlen);
40191 -       if (!dt_ranges)
40192 -               return;
40193 -       /* Sanity check, though hopefully that never happens */
40194 -       if (rlen > sizeof(static_lc_ranges)) {
40195 -               printk(KERN_WARNING "OF ranges property too large !\n");
40196 -               rlen = sizeof(static_lc_ranges);
40197 -       }
40198 -       lc_ranges = static_lc_ranges;
40199 -       memcpy(lc_ranges, dt_ranges, rlen);
40200 -       orig_rlen = rlen;
40201 -
40202 -       /* Let's work on a copy of the "ranges" property instead of damaging
40203 -        * the device-tree image in memory
40204 -        */
40205 -       ranges = lc_ranges;
40206 -       prev = NULL;
40207 -       while ((rlen -= np * sizeof(unsigned int)) >= 0) {
40208 -               if (prev) {
40209 -                       if (prev[0] == ranges[0] && prev[1] == ranges[1] &&
40210 -                               (prev[2] + prev[na+4]) == ranges[2] &&
40211 -                               (prev[na+2] + prev[na+4]) == ranges[na+2]) {
40212 -                               prev[na+4] += ranges[na+4];
40213 -                               ranges[0] = 0;
40214 -                               ranges += np;
40215 -                               continue;
40216 -                       }
40217 -               }
40218 -               prev = ranges;
40219 -               ranges += np;
40220 -       }
40221 -
40222 -       /*
40223 -        * The ranges property is laid out as an array of elements,
40224 -        * each of which comprises:
40225 -        *   cells 0 - 2:       a PCI address
40226 -        *   cells 3 or 3+4:    a CPU physical address
40227 -        *                      (size depending on dev->n_addr_cells)
40228 -        *   cells 4+5 or 5+6:  the size of the range
40229 -        */
40230 -       ranges = lc_ranges;
40231 -       rlen = orig_rlen;
40232 -       while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
40233 -               res = NULL;
40234 -               size = ranges[na+4];
40235 -               switch ((ranges[0] >> 24) & 0x3) {
40236 -               case 1:         /* I/O space */
40237 -                       if (ranges[2] != 0)
40238 -                               break;
40239 -                       hose->io_base_phys = ranges[na+2];
40240 -                       /* limit I/O space to 16MB */
40241 -                       if (size > 0x01000000)
40242 -                               size = 0x01000000;
40243 -                       hose->io_base_virt = ioremap(ranges[na+2], size);
40244 -                       if (primary)
40245 -                               isa_io_base = (unsigned long) hose->io_base_virt;
40246 -                       res = &hose->io_resource;
40247 -                       res->flags = IORESOURCE_IO;
40248 -                       res->start = ranges[2];
40249 -                       DBG("PCI: IO 0x%llx -> 0x%llx\n",
40250 -                           (u64)res->start, (u64)res->start + size - 1);
40251 -                       break;
40252 -               case 2:         /* memory space */
40253 -                       memno = 0;
40254 -                       if (ranges[1] == 0 && ranges[2] == 0
40255 -                           && ranges[na+4] <= (16 << 20)) {
40256 -                               /* 1st 16MB, i.e. ISA memory area */
40257 -                               if (primary)
40258 -                                       isa_mem_base = ranges[na+2];
40259 -                               memno = 1;
40260 -                       }
40261 -                       while (memno < 3 && hose->mem_resources[memno].flags)
40262 -                               ++memno;
40263 -                       if (memno == 0)
40264 -                               hose->pci_mem_offset = ranges[na+2] - ranges[2];
40265 -                       if (memno < 3) {
40266 -                               res = &hose->mem_resources[memno];
40267 -                               res->flags = IORESOURCE_MEM;
40268 -                               if(ranges[0] & 0x40000000)
40269 -                                       res->flags |= IORESOURCE_PREFETCH;
40270 -                               res->start = ranges[na+2];
40271 -                               DBG("PCI: MEM[%d] 0x%llx -> 0x%llx\n", memno,
40272 -                                   (u64)res->start, (u64)res->start + size - 1);
40273 -                       }
40274 -                       break;
40275 -               }
40276 -               if (res != NULL) {
40277 -                       res->name = dev->full_name;
40278 -                       res->end = res->start + size - 1;
40279 -                       res->parent = NULL;
40280 -                       res->sibling = NULL;
40281 -                       res->child = NULL;
40282 -               }
40283 -               ranges += np;
40284 -       }
40285 -}
40286 -
40287  /* We create the "pci-OF-bus-map" property now so it appears in the
40288   * /proc device tree
40289   */
40290 @@ -986,219 +372,7 @@ void pcibios_make_OF_bus_map(void)
40291  }
40292  #endif /* CONFIG_PPC_OF */
40293  
40294 -#ifdef CONFIG_PPC_PMAC
40295 -/*
40296 - * This set of routines checks for PCI<->PCI bridges that have closed
40297 - * IO resources and have child devices. It tries to re-open an IO
40298 - * window on them.
40299 - *
40300 - * This is a _temporary_ fix to workaround a problem with Apple's OF
40301 - * closing IO windows on P2P bridges when the OF drivers of cards
40302 - * below this bridge don't claim any IO range (typically ATI or
40303 - * Adaptec).
40304 - *
40305 - * A more complete fix would be to use drivers/pci/setup-bus.c, which
40306 - * involves a working pcibios_fixup_pbus_ranges(), some more care about
40307 - * ordering when creating the host bus resources, and maybe a few more
40308 - * minor tweaks
40309 - */
40310 -
40311 -/* Initialize bridges with base/limit values we have collected */
40312 -static void __init
40313 -do_update_p2p_io_resource(struct pci_bus *bus, int enable_vga)
40314 -{
40315 -       struct pci_dev *bridge = bus->self;
40316 -       struct pci_controller* hose = (struct pci_controller *)bridge->sysdata;
40317 -       u32 l;
40318 -       u16 w;
40319 -       struct resource res;
40320 -
40321 -       if (bus->resource[0] == NULL)
40322 -               return;
40323 -       res = *(bus->resource[0]);
40324 -
40325 -       DBG("Remapping Bus %d, bridge: %s\n", bus->number, pci_name(bridge));
40326 -       res.start -= ((unsigned long) hose->io_base_virt - isa_io_base);
40327 -       res.end -= ((unsigned long) hose->io_base_virt - isa_io_base);
40328 -       DBG("  IO window: %016llx-%016llx\n", res.start, res.end);
40329 -
40330 -       /* Set up the top and bottom of the PCI I/O segment for this bus. */
40331 -       pci_read_config_dword(bridge, PCI_IO_BASE, &l);
40332 -       l &= 0xffff000f;
40333 -       l |= (res.start >> 8) & 0x00f0;
40334 -       l |= res.end & 0xf000;
40335 -       pci_write_config_dword(bridge, PCI_IO_BASE, l);
40336 -
40337 -       if ((l & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32) {
40338 -               l = (res.start >> 16) | (res.end & 0xffff0000);
40339 -               pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, l);
40340 -       }
40341 -
40342 -       pci_read_config_word(bridge, PCI_COMMAND, &w);
40343 -       w |= PCI_COMMAND_IO;
40344 -       pci_write_config_word(bridge, PCI_COMMAND, w);
40345 -
40346 -#if 0 /* Enabling this causes XFree 4.2.0 to hang during PCI probe */
40347 -       if (enable_vga) {
40348 -               pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, &w);
40349 -               w |= PCI_BRIDGE_CTL_VGA;
40350 -               pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, w);
40351 -       }
40352 -#endif
40353 -}
40354 -
40355 -/* This function is pretty basic and actually quite broken for the
40356 - * general case, it's enough for us right now though. It's supposed
40357 - * to tell us if we need to open an IO range at all or not and what
40358 - * size.
40359 - */
40360 -static int __init
40361 -check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga)
40362 -{
40363 -       struct pci_dev *dev;
40364 -       int     i;
40365 -       int     rc = 0;
40366 -
40367 -#define push_end(res, mask) do {               \
40368 -       BUG_ON((mask+1) & mask);                \
40369 -       res->end = (res->end + mask) | mask;    \
40370 -} while (0)
40371 -
40372 -       list_for_each_entry(dev, &bus->devices, bus_list) {
40373 -               u16 class = dev->class >> 8;
40374 -
40375 -               if (class == PCI_CLASS_DISPLAY_VGA ||
40376 -                   class == PCI_CLASS_NOT_DEFINED_VGA)
40377 -                       *found_vga = 1;
40378 -               if (class >> 8 == PCI_BASE_CLASS_BRIDGE && dev->subordinate)
40379 -                       rc |= check_for_io_childs(dev->subordinate, res, found_vga);
40380 -               if (class == PCI_CLASS_BRIDGE_CARDBUS)
40381 -                       push_end(res, 0xfff);
40382 -
40383 -               for (i=0; i<PCI_NUM_RESOURCES; i++) {
40384 -                       struct resource *r;
40385 -                       unsigned long r_size;
40386 -
40387 -                       if (dev->class >> 8 == PCI_CLASS_BRIDGE_PCI
40388 -                           && i >= PCI_BRIDGE_RESOURCES)
40389 -                               continue;
40390 -                       r = &dev->resource[i];
40391 -                       r_size = r->end - r->start;
40392 -                       if (r_size < 0xfff)
40393 -                               r_size = 0xfff;
40394 -                       if (r->flags & IORESOURCE_IO && (r_size) != 0) {
40395 -                               rc = 1;
40396 -                               push_end(res, r_size);
40397 -                       }
40398 -               }
40399 -       }
40400 -
40401 -       return rc;
40402 -}
40403 -
40404 -/* Here we scan all P2P bridges of a given level that have a closed
40405 - * IO window. Note that the test for the presence of a VGA card should
40406 - * be improved to take into account already configured P2P bridges,
40407 - * currently, we don't see them and might end up configuring 2 bridges
40408 - * with VGA pass through enabled
40409 - */
40410 -static void __init
40411 -do_fixup_p2p_level(struct pci_bus *bus)
40412 -{
40413 -       struct pci_bus *b;
40414 -       int i, parent_io;
40415 -       int has_vga = 0;
40416 -
40417 -       for (parent_io=0; parent_io<4; parent_io++)
40418 -               if (bus->resource[parent_io]
40419 -                   && bus->resource[parent_io]->flags & IORESOURCE_IO)
40420 -                       break;
40421 -       if (parent_io >= 4)
40422 -               return;
40423 -
40424 -       list_for_each_entry(b, &bus->children, node) {
40425 -               struct pci_dev *d = b->self;
40426 -               struct pci_controller* hose = (struct pci_controller *)d->sysdata;
40427 -               struct resource *res = b->resource[0];
40428 -               struct resource tmp_res;
40429 -               unsigned long max;
40430 -               int found_vga = 0;
40431 -
40432 -               memset(&tmp_res, 0, sizeof(tmp_res));
40433 -               tmp_res.start = bus->resource[parent_io]->start;
40434 -
40435 -               /* We don't let low addresses go through that closed P2P bridge, well,
40436 -                * that may not be necessary but I feel safer that way
40437 -                */
40438 -               if (tmp_res.start == 0)
40439 -                       tmp_res.start = 0x1000;
40440 -       
40441 -               if (!list_empty(&b->devices) && res && res->flags == 0 &&
40442 -                   res != bus->resource[parent_io] &&
40443 -                   (d->class >> 8) == PCI_CLASS_BRIDGE_PCI &&
40444 -                   check_for_io_childs(b, &tmp_res, &found_vga)) {
40445 -                       u8 io_base_lo;
40446 -
40447 -                       printk(KERN_INFO "Fixing up IO bus %s\n", b->name);
40448 -
40449 -                       if (found_vga) {
40450 -                               if (has_vga) {
40451 -                                       printk(KERN_WARNING "Skipping VGA, already active"
40452 -                                           " on bus segment\n");
40453 -                                       found_vga = 0;
40454 -                               } else
40455 -                                       has_vga = 1;
40456 -                       }
40457 -                       pci_read_config_byte(d, PCI_IO_BASE, &io_base_lo);
40458 -
40459 -                       if ((io_base_lo & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32)
40460 -                               max = ((unsigned long) hose->io_base_virt
40461 -                                       - isa_io_base) + 0xffffffff;
40462 -                       else
40463 -                               max = ((unsigned long) hose->io_base_virt
40464 -                                       - isa_io_base) + 0xffff;
40465 -
40466 -                       *res = tmp_res;
40467 -                       res->flags = IORESOURCE_IO;
40468 -                       res->name = b->name;
40469 -               
40470 -                       /* Find a resource in the parent where we can allocate */
40471 -                       for (i = 0 ; i < 4; i++) {
40472 -                               struct resource *r = bus->resource[i];
40473 -                               if (!r)
40474 -                                       continue;
40475 -                               if ((r->flags & IORESOURCE_IO) == 0)
40476 -                                       continue;
40477 -                               DBG("Trying to allocate from %016llx, size %016llx from parent"
40478 -                                   " res %d: %016llx -> %016llx\n",
40479 -                                       res->start, res->end, i, r->start, r->end);
40480 -                       
40481 -                               if (allocate_resource(r, res, res->end + 1, res->start, max,
40482 -                                   res->end + 1, NULL, NULL) < 0) {
40483 -                                       DBG("Failed !\n");
40484 -                                       continue;
40485 -                               }
40486 -                               do_update_p2p_io_resource(b, found_vga);
40487 -                               break;
40488 -                       }
40489 -               }
40490 -               do_fixup_p2p_level(b);
40491 -       }
40492 -}
40493 -
40494 -static void
40495 -pcibios_fixup_p2p_bridges(void)
40496 -{
40497 -       struct pci_bus *b;
40498 -
40499 -       list_for_each_entry(b, &pci_root_buses, node)
40500 -               do_fixup_p2p_level(b);
40501 -}
40502 -
40503 -#endif /* CONFIG_PPC_PMAC */
40504 -
40505 -static int __init
40506 -pcibios_init(void)
40507 +static int __init pcibios_init(void)
40508  {
40509         struct pci_controller *hose, *tmp;
40510         struct pci_bus *bus;
40511 @@ -1206,6 +380,9 @@ pcibios_init(void)
40512  
40513         printk(KERN_INFO "PCI: Probing PCI hardware\n");
40514  
40515 +       if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_BUS)
40516 +               pci_assign_all_buses = 1;
40517 +
40518         /* Scan all of the recorded PCI controllers.  */
40519         list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
40520                 if (pci_assign_all_buses)
40521 @@ -1213,9 +390,10 @@ pcibios_init(void)
40522                 hose->last_busno = 0xff;
40523                 bus = pci_scan_bus_parented(hose->parent, hose->first_busno,
40524                                             hose->ops, hose);
40525 -               if (bus)
40526 +               if (bus) {
40527                         pci_bus_add_devices(bus);
40528 -               hose->last_busno = bus->subordinate;
40529 +                       hose->last_busno = bus->subordinate;
40530 +               }
40531                 if (pci_assign_all_buses || next_busno <= hose->last_busno)
40532                         next_busno = hose->last_busno + pcibios_assign_bus_offset;
40533         }
40534 @@ -1228,18 +406,8 @@ pcibios_init(void)
40535         if (pci_assign_all_buses && have_of)
40536                 pcibios_make_OF_bus_map();
40537  
40538 -       /* Call machine dependent fixup */
40539 -       if (ppc_md.pcibios_fixup)
40540 -               ppc_md.pcibios_fixup();
40541 -
40542 -       /* Allocate and assign resources */
40543 -       pcibios_allocate_bus_resources(&pci_root_buses);
40544 -       pcibios_allocate_resources(0);
40545 -       pcibios_allocate_resources(1);
40546 -#ifdef CONFIG_PPC_PMAC
40547 -       pcibios_fixup_p2p_bridges();
40548 -#endif /* CONFIG_PPC_PMAC */
40549 -       pcibios_assign_resources();
40550 +       /* Call common code to handle resource allocation */
40551 +       pcibios_resource_survey();
40552  
40553         /* Call machine dependent post-init code */
40554         if (ppc_md.pcibios_after_init)
40555 @@ -1250,14 +418,14 @@ pcibios_init(void)
40556  
40557  subsys_initcall(pcibios_init);
40558  
40559 -void pcibios_fixup_bus(struct pci_bus *bus)
40560 +void __devinit pcibios_do_bus_setup(struct pci_bus *bus)
40561  {
40562         struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
40563         unsigned long io_offset;
40564         struct resource *res;
40565 -       struct pci_dev *dev;
40566         int i;
40567  
40568 +       /* Hookup PHB resources */
40569         io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
40570         if (bus->parent == NULL) {
40571                 /* This is a host bridge - fill in its resources */
40572 @@ -1272,8 +440,8 @@ void pcibios_fixup_bus(struct pci_bus *b
40573                         res->end = IO_SPACE_LIMIT;
40574                         res->flags = IORESOURCE_IO;
40575                 }
40576 -               res->start += io_offset;
40577 -               res->end += io_offset;
40578 +               res->start = (res->start + io_offset) & 0xffffffffu;
40579 +               res->end = (res->end + io_offset) & 0xffffffffu;
40580  
40581                 for (i = 0; i < 3; ++i) {
40582                         res = &hose->mem_resources[i];
40583 @@ -1288,35 +456,6 @@ void pcibios_fixup_bus(struct pci_bus *b
40584                         }
40585                         bus->resource[i+1] = res;
40586                 }
40587 -       } else {
40588 -               /* This is a subordinate bridge */
40589 -               pci_read_bridge_bases(bus);
40590 -
40591 -               for (i = 0; i < 4; ++i) {
40592 -                       if ((res = bus->resource[i]) == NULL)
40593 -                               continue;
40594 -                       if (!res->flags || bus->self->transparent)
40595 -                               continue;
40596 -                       if (io_offset && (res->flags & IORESOURCE_IO)) {
40597 -                               res->start += io_offset;
40598 -                               res->end += io_offset;
40599 -                       } else if (hose->pci_mem_offset
40600 -                                  && (res->flags & IORESOURCE_MEM)) {
40601 -                               res->start += hose->pci_mem_offset;
40602 -                               res->end += hose->pci_mem_offset;
40603 -                       }
40604 -               }
40605 -       }
40606 -
40607 -       /* Platform specific bus fixups */
40608 -       if (ppc_md.pcibios_fixup_bus)
40609 -               ppc_md.pcibios_fixup_bus(bus);
40610 -
40611 -       /* Read default IRQs and fixup if necessary */
40612 -       list_for_each_entry(dev, &bus->devices, bus_list) {
40613 -               pci_read_irq_line(dev);
40614 -               if (ppc_md.pci_irq_fixup)
40615 -                       ppc_md.pci_irq_fixup(dev);
40616         }
40617  }
40618  
40619 @@ -1328,37 +467,6 @@ pcibios_update_irq(struct pci_dev *dev, 
40620         /* XXX FIXME - update OF device tree node interrupt property */
40621  }
40622  
40623 -int pcibios_enable_device(struct pci_dev *dev, int mask)
40624 -{
40625 -       u16 cmd, old_cmd;
40626 -       int idx;
40627 -       struct resource *r;
40628 -
40629 -       if (ppc_md.pcibios_enable_device_hook)
40630 -               if (ppc_md.pcibios_enable_device_hook(dev, 0))
40631 -                       return -EINVAL;
40632 -               
40633 -       pci_read_config_word(dev, PCI_COMMAND, &cmd);
40634 -       old_cmd = cmd;
40635 -       for (idx=0; idx<6; idx++) {
40636 -               r = &dev->resource[idx];
40637 -               if (r->flags & IORESOURCE_UNSET) {
40638 -                       printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
40639 -                       return -EINVAL;
40640 -               }
40641 -               if (r->flags & IORESOURCE_IO)
40642 -                       cmd |= PCI_COMMAND_IO;
40643 -               if (r->flags & IORESOURCE_MEM)
40644 -                       cmd |= PCI_COMMAND_MEMORY;
40645 -       }
40646 -       if (cmd != old_cmd) {
40647 -               printk("PCI: Enabling device %s (%04x -> %04x)\n",
40648 -                      pci_name(dev), old_cmd, cmd);
40649 -               pci_write_config_word(dev, PCI_COMMAND, cmd);
40650 -       }
40651 -       return 0;
40652 -}
40653 -
40654  static struct pci_controller*
40655  pci_bus_to_hose(int bus)
40656  {
40657 @@ -1381,17 +489,6 @@ long sys_pciconfig_iobase(long which, un
40658         struct pci_controller* hose;
40659         long result = -EOPNOTSUPP;
40660  
40661 -       /* Argh ! Please forgive me for that hack, but that's the
40662 -        * simplest way to get existing XFree to not lockup on some
40663 -        * G5 machines... So when something asks for bus 0 io base
40664 -        * (bus 0 is HT root), we return the AGP one instead.
40665 -        */
40666 -#ifdef CONFIG_PPC_PMAC
40667 -       if (machine_is(powermac) && machine_is_compatible("MacRISC4"))
40668 -               if (bus == 0)
40669 -                       bus = 0xf0;
40670 -#endif /* CONFIG_PPC_PMAC */
40671 -
40672         hose = pci_bus_to_hose(bus);
40673         if (!hose)
40674                 return -ENODEV;
40675 Index: linux-2.6.24.7/arch/powerpc/kernel/pci_64.c
40676 ===================================================================
40677 --- linux-2.6.24.7.orig/arch/powerpc/kernel/pci_64.c
40678 +++ linux-2.6.24.7/arch/powerpc/kernel/pci_64.c
40679 @@ -31,7 +31,6 @@
40680  #include <asm/byteorder.h>
40681  #include <asm/machdep.h>
40682  #include <asm/ppc-pci.h>
40683 -#include <asm/firmware.h>
40684  
40685  #ifdef DEBUG
40686  #include <asm/udbg.h>
40687 @@ -41,10 +40,6 @@
40688  #endif
40689  
40690  unsigned long pci_probe_only = 1;
40691 -int pci_assign_all_buses = 0;
40692 -
40693 -static void fixup_resource(struct resource *res, struct pci_dev *dev);
40694 -static void do_bus_setup(struct pci_bus *bus);
40695  
40696  /* pci_io_base -- the base address from which io bars are offsets.
40697   * This is the lowest I/O base address (so bar values are always positive),
40698 @@ -70,139 +65,31 @@ struct dma_mapping_ops *get_pci_dma_ops(
40699  }
40700  EXPORT_SYMBOL(get_pci_dma_ops);
40701  
40702 -static void fixup_broken_pcnet32(struct pci_dev* dev)
40703 -{
40704 -       if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
40705 -               dev->vendor = PCI_VENDOR_ID_AMD;
40706 -               pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
40707 -       }
40708 -}
40709 -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
40710 -
40711 -void  pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
40712 -                             struct resource *res)
40713 -{
40714 -       unsigned long offset = 0;
40715 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
40716 -
40717 -       if (!hose)
40718 -               return;
40719 -
40720 -       if (res->flags & IORESOURCE_IO)
40721 -               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
40722 -
40723 -       if (res->flags & IORESOURCE_MEM)
40724 -               offset = hose->pci_mem_offset;
40725 -
40726 -       region->start = res->start - offset;
40727 -       region->end = res->end - offset;
40728 -}
40729  
40730 -void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
40731 -                             struct pci_bus_region *region)
40732 +int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
40733  {
40734 -       unsigned long offset = 0;
40735 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
40736 -
40737 -       if (!hose)
40738 -               return;
40739 -
40740 -       if (res->flags & IORESOURCE_IO)
40741 -               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
40742 -
40743 -       if (res->flags & IORESOURCE_MEM)
40744 -               offset = hose->pci_mem_offset;
40745 -
40746 -       res->start = region->start + offset;
40747 -       res->end = region->end + offset;
40748 +       return dma_set_mask(&dev->dev, mask);
40749  }
40750  
40751 -#ifdef CONFIG_HOTPLUG
40752 -EXPORT_SYMBOL(pcibios_resource_to_bus);
40753 -EXPORT_SYMBOL(pcibios_bus_to_resource);
40754 -#endif
40755 -
40756 -/*
40757 - * We need to avoid collisions with `mirrored' VGA ports
40758 - * and other strange ISA hardware, so we always want the
40759 - * addresses to be allocated in the 0x000-0x0ff region
40760 - * modulo 0x400.
40761 - *
40762 - * Why? Because some silly external IO cards only decode
40763 - * the low 10 bits of the IO address. The 0x00-0xff region
40764 - * is reserved for motherboard devices that decode all 16
40765 - * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
40766 - * but we want to try to avoid allocating at 0x2900-0x2bff
40767 - * which might have be mirrored at 0x0100-0x03ff..
40768 - */
40769 -void pcibios_align_resource(void *data, struct resource *res,
40770 -                           resource_size_t size, resource_size_t align)
40771 +int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
40772  {
40773 -       struct pci_dev *dev = data;
40774 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
40775 -       resource_size_t start = res->start;
40776 -       unsigned long alignto;
40777 -
40778 -       if (res->flags & IORESOURCE_IO) {
40779 -               unsigned long offset = (unsigned long)hose->io_base_virt -
40780 -                                       _IO_BASE;
40781 -               /* Make sure we start at our min on all hoses */
40782 -               if (start - offset < PCIBIOS_MIN_IO)
40783 -                       start = PCIBIOS_MIN_IO + offset;
40784 -
40785 -               /*
40786 -                * Put everything into 0x00-0xff region modulo 0x400
40787 -                */
40788 -               if (start & 0x300)
40789 -                       start = (start + 0x3ff) & ~0x3ff;
40790 +       int rc;
40791  
40792 -       } else if (res->flags & IORESOURCE_MEM) {
40793 -               /* Make sure we start at our min on all hoses */
40794 -               if (start - hose->pci_mem_offset < PCIBIOS_MIN_MEM)
40795 -                       start = PCIBIOS_MIN_MEM + hose->pci_mem_offset;
40796 +       rc = dma_set_mask(&dev->dev, mask);
40797 +       dev->dev.coherent_dma_mask = dev->dma_mask;
40798  
40799 -               /* Align to multiple of size of minimum base.  */
40800 -               alignto = max(0x1000UL, align);
40801 -               start = ALIGN(start, alignto);
40802 -       }
40803 -
40804 -       res->start = start;
40805 +       return rc;
40806  }
40807  
40808 -void __devinit pcibios_claim_one_bus(struct pci_bus *b)
40809 +static void fixup_broken_pcnet32(struct pci_dev* dev)
40810  {
40811 -       struct pci_dev *dev;
40812 -       struct pci_bus *child_bus;
40813 -
40814 -       list_for_each_entry(dev, &b->devices, bus_list) {
40815 -               int i;
40816 -
40817 -               for (i = 0; i < PCI_NUM_RESOURCES; i++) {
40818 -                       struct resource *r = &dev->resource[i];
40819 -
40820 -                       if (r->parent || !r->start || !r->flags)
40821 -                               continue;
40822 -                       pci_claim_resource(dev, i);
40823 -               }
40824 +       if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
40825 +               dev->vendor = PCI_VENDOR_ID_AMD;
40826 +               pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
40827         }
40828 -
40829 -       list_for_each_entry(child_bus, &b->children, node)
40830 -               pcibios_claim_one_bus(child_bus);
40831  }
40832 -#ifdef CONFIG_HOTPLUG
40833 -EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);
40834 -#endif
40835 -
40836 -static void __init pcibios_claim_of_setup(void)
40837 -{
40838 -       struct pci_bus *b;
40839 -
40840 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
40841 -               return;
40842 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
40843  
40844 -       list_for_each_entry(b, &pci_root_buses, node)
40845 -               pcibios_claim_one_bus(b);
40846 -}
40847  
40848  static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
40849  {
40850 @@ -270,7 +157,6 @@ static void pci_parse_of_addrs(struct de
40851                 res->end = base + size - 1;
40852                 res->flags = flags;
40853                 res->name = pci_name(dev);
40854 -               fixup_resource(res, dev);
40855         }
40856  }
40857  
40858 @@ -339,16 +225,17 @@ struct pci_dev *of_create_pci_dev(struct
40859  EXPORT_SYMBOL(of_create_pci_dev);
40860  
40861  void __devinit of_scan_bus(struct device_node *node,
40862 -                                 struct pci_bus *bus)
40863 +                          struct pci_bus *bus)
40864  {
40865 -       struct device_node *child = NULL;
40866 +       struct device_node *child;
40867         const u32 *reg;
40868         int reglen, devfn;
40869         struct pci_dev *dev;
40870  
40871         DBG("of_scan_bus(%s) bus no %d... \n", node->full_name, bus->number);
40872  
40873 -       while ((child = of_get_next_child(node, child)) != NULL) {
40874 +       /* Scan direct children */
40875 +       for_each_child_of_node(node, child) {
40876                 DBG("  * %s\n", child->full_name);
40877                 reg = of_get_property(child, "reg", &reglen);
40878                 if (reg == NULL || reglen < 20)
40879 @@ -359,19 +246,26 @@ void __devinit of_scan_bus(struct device
40880                 dev = of_create_pci_dev(child, bus, devfn);
40881                 if (!dev)
40882                         continue;
40883 -               DBG("dev header type: %x\n", dev->hdr_type);
40884 +               DBG("    dev header type: %x\n", dev->hdr_type);
40885 +       }
40886  
40887 +       /* Ally all fixups */
40888 +       pcibios_fixup_of_probed_bus(bus);
40889 +
40890 +       /* Now scan child busses */
40891 +       list_for_each_entry(dev, &bus->devices, bus_list) {
40892                 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
40893 -                   dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
40894 -                       of_scan_pci_bridge(child, dev);
40895 +                   dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
40896 +                       struct device_node *child = pci_device_to_OF_node(dev);
40897 +                       if (dev)
40898 +                               of_scan_pci_bridge(child, dev);
40899 +               }
40900         }
40901 -
40902 -       do_bus_setup(bus);
40903  }
40904  EXPORT_SYMBOL(of_scan_bus);
40905  
40906  void __devinit of_scan_pci_bridge(struct device_node *node,
40907 -                               struct pci_dev *dev)
40908 +                                 struct pci_dev *dev)
40909  {
40910         struct pci_bus *bus;
40911         const u32 *busrange, *ranges;
40912 @@ -441,7 +335,6 @@ void __devinit of_scan_pci_bridge(struct
40913                 res->start = of_read_number(&ranges[1], 2);
40914                 res->end = res->start + size - 1;
40915                 res->flags = flags;
40916 -               fixup_resource(res, dev);
40917         }
40918         sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
40919                 bus->number);
40920 @@ -462,12 +355,12 @@ EXPORT_SYMBOL(of_scan_pci_bridge);
40921  void __devinit scan_phb(struct pci_controller *hose)
40922  {
40923         struct pci_bus *bus;
40924 -       struct device_node *node = hose->arch_data;
40925 +       struct device_node *node = hose->dn;
40926         int i, mode;
40927 -       struct resource *res;
40928  
40929 -       DBG("Scanning PHB %s\n", node ? node->full_name : "<NO NAME>");
40930 +       DBG("PCI: Scanning PHB %s\n", node ? node->full_name : "<NO NAME>");
40931  
40932 +       /* Create an empty bus for the toplevel */
40933         bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, node);
40934         if (bus == NULL) {
40935                 printk(KERN_ERR "Failed to create bus for PCI domain %04x\n",
40936 @@ -477,27 +370,27 @@ void __devinit scan_phb(struct pci_contr
40937         bus->secondary = hose->first_busno;
40938         hose->bus = bus;
40939  
40940 -       if (!firmware_has_feature(FW_FEATURE_ISERIES))
40941 -               pcibios_map_io_space(bus);
40942 -
40943 -       bus->resource[0] = res = &hose->io_resource;
40944 -       if (res->flags && request_resource(&ioport_resource, res)) {
40945 -               printk(KERN_ERR "Failed to request PCI IO region "
40946 -                      "on PCI domain %04x\n", hose->global_number);
40947 -               DBG("res->start = 0x%016lx, res->end = 0x%016lx\n",
40948 -                   res->start, res->end);
40949 -       }
40950 +       /* Get some IO space for the new PHB */
40951 +       pcibios_map_io_space(bus);
40952  
40953 +       /* Wire up PHB bus resources */
40954 +       DBG("PCI: PHB IO resource    = %016lx-%016lx [%lx]\n",
40955 +           hose->io_resource.start, hose->io_resource.end,
40956 +           hose->io_resource.flags);
40957 +       bus->resource[0] = &hose->io_resource;
40958         for (i = 0; i < 3; ++i) {
40959 -               res = &hose->mem_resources[i];
40960 -               bus->resource[i+1] = res;
40961 -               if (res->flags && request_resource(&iomem_resource, res))
40962 -                       printk(KERN_ERR "Failed to request PCI memory region "
40963 -                              "on PCI domain %04x\n", hose->global_number);
40964 -       }
40965 +               DBG("PCI: PHB MEM resource %d = %016lx-%016lx [%lx]\n", i,
40966 +                   hose->mem_resources[i].start,
40967 +                   hose->mem_resources[i].end,
40968 +                   hose->mem_resources[i].flags);
40969 +               bus->resource[i+1] = &hose->mem_resources[i];
40970 +       }
40971 +       DBG("PCI: PHB MEM offset     = %016lx\n", hose->pci_mem_offset);
40972 +       DBG("PCI: PHB IO  offset     = %08lx\n",
40973 +           (unsigned long)hose->io_base_virt - _IO_BASE);
40974  
40975 +       /* Get probe mode and perform scan */
40976         mode = PCI_PROBE_NORMAL;
40977 -
40978         if (node && ppc_md.pci_probe_mode)
40979                 mode = ppc_md.pci_probe_mode(bus);
40980         DBG("    probe mode: %d\n", mode);
40981 @@ -514,15 +407,15 @@ static int __init pcibios_init(void)
40982  {
40983         struct pci_controller *hose, *tmp;
40984  
40985 +       printk(KERN_INFO "PCI: Probing PCI hardware\n");
40986 +
40987         /* For now, override phys_mem_access_prot. If we need it,
40988          * later, we may move that initialization to each ppc_md
40989          */
40990         ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
40991  
40992 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
40993 -               iSeries_pcibios_init();
40994 -
40995 -       printk(KERN_DEBUG "PCI: Probing PCI hardware\n");
40996 +       if (pci_probe_only)
40997 +               ppc_pci_flags |= PPC_PCI_PROBE_ONLY;
40998  
40999         /* Scan all of the recorded PCI controllers.  */
41000         list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
41001 @@ -530,19 +423,8 @@ static int __init pcibios_init(void)
41002                 pci_bus_add_devices(hose->bus);
41003         }
41004  
41005 -       if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
41006 -               if (pci_probe_only)
41007 -                       pcibios_claim_of_setup();
41008 -               else
41009 -                       /* FIXME: `else' will be removed when
41010 -                          pci_assign_unassigned_resources() is able to work
41011 -                          correctly with [partially] allocated PCI tree. */
41012 -                       pci_assign_unassigned_resources();
41013 -       }
41014 -
41015 -       /* Call machine dependent final fixup */
41016 -       if (ppc_md.pcibios_fixup)
41017 -               ppc_md.pcibios_fixup();
41018 +       /* Call common code to handle resource allocation */
41019 +       pcibios_resource_survey();
41020  
41021         printk(KERN_DEBUG "PCI: Probing PCI hardware done\n");
41022  
41023 @@ -551,141 +433,6 @@ static int __init pcibios_init(void)
41024  
41025  subsys_initcall(pcibios_init);
41026  
41027 -int pcibios_enable_device(struct pci_dev *dev, int mask)
41028 -{
41029 -       u16 cmd, oldcmd;
41030 -       int i;
41031 -
41032 -       pci_read_config_word(dev, PCI_COMMAND, &cmd);
41033 -       oldcmd = cmd;
41034 -
41035 -       for (i = 0; i < PCI_NUM_RESOURCES; i++) {
41036 -               struct resource *res = &dev->resource[i];
41037 -
41038 -               /* Only set up the requested stuff */
41039 -               if (!(mask & (1<<i)))
41040 -                       continue;
41041 -
41042 -               if (res->flags & IORESOURCE_IO)
41043 -                       cmd |= PCI_COMMAND_IO;
41044 -               if (res->flags & IORESOURCE_MEM)
41045 -                       cmd |= PCI_COMMAND_MEMORY;
41046 -       }
41047 -
41048 -       if (cmd != oldcmd) {
41049 -               printk(KERN_DEBUG "PCI: Enabling device: (%s), cmd %x\n",
41050 -                      pci_name(dev), cmd);
41051 -                /* Enable the appropriate bits in the PCI command register.  */
41052 -               pci_write_config_word(dev, PCI_COMMAND, cmd);
41053 -       }
41054 -       return 0;
41055 -}
41056 -
41057 -/* Decide whether to display the domain number in /proc */
41058 -int pci_proc_domain(struct pci_bus *bus)
41059 -{
41060 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
41061 -               return 0;
41062 -       else {
41063 -               struct pci_controller *hose = pci_bus_to_host(bus);
41064 -               return hose->buid != 0;
41065 -       }
41066 -}
41067 -
41068 -void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
41069 -                                           struct device_node *dev, int prim)
41070 -{
41071 -       const unsigned int *ranges;
41072 -       unsigned int pci_space;
41073 -       unsigned long size;
41074 -       int rlen = 0;
41075 -       int memno = 0;
41076 -       struct resource *res;
41077 -       int np, na = of_n_addr_cells(dev);
41078 -       unsigned long pci_addr, cpu_phys_addr;
41079 -
41080 -       np = na + 5;
41081 -
41082 -       /* From "PCI Binding to 1275"
41083 -        * The ranges property is laid out as an array of elements,
41084 -        * each of which comprises:
41085 -        *   cells 0 - 2:       a PCI address
41086 -        *   cells 3 or 3+4:    a CPU physical address
41087 -        *                      (size depending on dev->n_addr_cells)
41088 -        *   cells 4+5 or 5+6:  the size of the range
41089 -        */
41090 -       ranges = of_get_property(dev, "ranges", &rlen);
41091 -       if (ranges == NULL)
41092 -               return;
41093 -       hose->io_base_phys = 0;
41094 -       while ((rlen -= np * sizeof(unsigned int)) >= 0) {
41095 -               res = NULL;
41096 -               pci_space = ranges[0];
41097 -               pci_addr = ((unsigned long)ranges[1] << 32) | ranges[2];
41098 -               cpu_phys_addr = of_translate_address(dev, &ranges[3]);
41099 -               size = ((unsigned long)ranges[na+3] << 32) | ranges[na+4];
41100 -               ranges += np;
41101 -               if (size == 0)
41102 -                       continue;
41103 -
41104 -               /* Now consume following elements while they are contiguous */
41105 -               while (rlen >= np * sizeof(unsigned int)) {
41106 -                       unsigned long addr, phys;
41107 -
41108 -                       if (ranges[0] != pci_space)
41109 -                               break;
41110 -                       addr = ((unsigned long)ranges[1] << 32) | ranges[2];
41111 -                       phys = ranges[3];
41112 -                       if (na >= 2)
41113 -                               phys = (phys << 32) | ranges[4];
41114 -                       if (addr != pci_addr + size ||
41115 -                           phys != cpu_phys_addr + size)
41116 -                               break;
41117 -
41118 -                       size += ((unsigned long)ranges[na+3] << 32)
41119 -                               | ranges[na+4];
41120 -                       ranges += np;
41121 -                       rlen -= np * sizeof(unsigned int);
41122 -               }
41123 -
41124 -               switch ((pci_space >> 24) & 0x3) {
41125 -               case 1:         /* I/O space */
41126 -                       hose->io_base_phys = cpu_phys_addr - pci_addr;
41127 -                       /* handle from 0 to top of I/O window */
41128 -                       hose->pci_io_size = pci_addr + size;
41129 -
41130 -                       res = &hose->io_resource;
41131 -                       res->flags = IORESOURCE_IO;
41132 -                       res->start = pci_addr;
41133 -                       DBG("phb%d: IO 0x%lx -> 0x%lx\n", hose->global_number,
41134 -                                   res->start, res->start + size - 1);
41135 -                       break;
41136 -               case 2:         /* memory space */
41137 -                       memno = 0;
41138 -                       while (memno < 3 && hose->mem_resources[memno].flags)
41139 -                               ++memno;
41140 -
41141 -                       if (memno == 0)
41142 -                               hose->pci_mem_offset = cpu_phys_addr - pci_addr;
41143 -                       if (memno < 3) {
41144 -                               res = &hose->mem_resources[memno];
41145 -                               res->flags = IORESOURCE_MEM;
41146 -                               res->start = cpu_phys_addr;
41147 -                               DBG("phb%d: MEM 0x%lx -> 0x%lx\n", hose->global_number,
41148 -                                           res->start, res->start + size - 1);
41149 -                       }
41150 -                       break;
41151 -               }
41152 -               if (res != NULL) {
41153 -                       res->name = dev->full_name;
41154 -                       res->end = res->start + size - 1;
41155 -                       res->parent = NULL;
41156 -                       res->sibling = NULL;
41157 -                       res->child = NULL;
41158 -               }
41159 -       }
41160 -}
41161 -
41162  #ifdef CONFIG_HOTPLUG
41163  
41164  int pcibios_unmap_io_space(struct pci_bus *bus)
41165 @@ -719,8 +466,7 @@ int pcibios_unmap_io_space(struct pci_bu
41166         if (hose->io_base_alloc == 0)
41167                 return 0;
41168  
41169 -       DBG("IO unmapping for PHB %s\n",
41170 -           ((struct device_node *)hose->arch_data)->full_name);
41171 +       DBG("IO unmapping for PHB %s\n", hose->dn->full_name);
41172         DBG("  alloc=0x%p\n", hose->io_base_alloc);
41173  
41174         /* This is a PHB, we fully unmap the IO area */
41175 @@ -779,8 +525,7 @@ int __devinit pcibios_map_io_space(struc
41176         hose->io_base_virt = (void __iomem *)(area->addr +
41177                                               hose->io_base_phys - phys_page);
41178  
41179 -       DBG("IO mapping for PHB %s\n",
41180 -           ((struct device_node *)hose->arch_data)->full_name);
41181 +       DBG("IO mapping for PHB %s\n", hose->dn->full_name);
41182         DBG("  phys=0x%016lx, virt=0x%p (alloc=0x%p)\n",
41183             hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
41184         DBG("  size=0x%016lx (alloc=0x%016lx)\n",
41185 @@ -803,51 +548,13 @@ int __devinit pcibios_map_io_space(struc
41186  }
41187  EXPORT_SYMBOL_GPL(pcibios_map_io_space);
41188  
41189 -static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev)
41190 -{
41191 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
41192 -       unsigned long offset;
41193 -
41194 -       if (res->flags & IORESOURCE_IO) {
41195 -               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
41196 -               res->start += offset;
41197 -               res->end += offset;
41198 -       } else if (res->flags & IORESOURCE_MEM) {
41199 -               res->start += hose->pci_mem_offset;
41200 -               res->end += hose->pci_mem_offset;
41201 -       }
41202 -}
41203 -
41204 -void __devinit pcibios_fixup_device_resources(struct pci_dev *dev,
41205 -                                             struct pci_bus *bus)
41206 -{
41207 -       /* Update device resources.  */
41208 -       int i;
41209 -
41210 -       DBG("%s: Fixup resources:\n", pci_name(dev));
41211 -       for (i = 0; i < PCI_NUM_RESOURCES; i++) {
41212 -               struct resource *res = &dev->resource[i];
41213 -               if (!res->flags)
41214 -                       continue;
41215 -
41216 -               DBG("  0x%02x < %08lx:0x%016lx...0x%016lx\n",
41217 -                   i, res->flags, res->start, res->end);
41218 -
41219 -               fixup_resource(res, dev);
41220 -
41221 -               DBG("       > %08lx:0x%016lx...0x%016lx\n",
41222 -                   res->flags, res->start, res->end);
41223 -       }
41224 -}
41225 -EXPORT_SYMBOL(pcibios_fixup_device_resources);
41226 -
41227  void __devinit pcibios_setup_new_device(struct pci_dev *dev)
41228  {
41229         struct dev_archdata *sd = &dev->dev.archdata;
41230  
41231         sd->of_node = pci_device_to_OF_node(dev);
41232  
41233 -       DBG("PCI device %s OF node: %s\n", pci_name(dev),
41234 +       DBG("PCI: device %s OF node: %s\n", pci_name(dev),
41235             sd->of_node ? sd->of_node->full_name : "<none>");
41236  
41237         sd->dma_ops = pci_dma_ops;
41238 @@ -861,7 +568,7 @@ void __devinit pcibios_setup_new_device(
41239  }
41240  EXPORT_SYMBOL(pcibios_setup_new_device);
41241  
41242 -static void __devinit do_bus_setup(struct pci_bus *bus)
41243 +void __devinit pcibios_do_bus_setup(struct pci_bus *bus)
41244  {
41245         struct pci_dev *dev;
41246  
41247 @@ -870,42 +577,7 @@ static void __devinit do_bus_setup(struc
41248  
41249         list_for_each_entry(dev, &bus->devices, bus_list)
41250                 pcibios_setup_new_device(dev);
41251 -
41252 -       /* Read default IRQs and fixup if necessary */
41253 -       list_for_each_entry(dev, &bus->devices, bus_list) {
41254 -               pci_read_irq_line(dev);
41255 -               if (ppc_md.pci_irq_fixup)
41256 -                       ppc_md.pci_irq_fixup(dev);
41257 -       }
41258 -}
41259 -
41260 -void __devinit pcibios_fixup_bus(struct pci_bus *bus)
41261 -{
41262 -       struct pci_dev *dev = bus->self;
41263 -       struct device_node *np;
41264 -
41265 -       np = pci_bus_to_OF_node(bus);
41266 -
41267 -       DBG("pcibios_fixup_bus(%s)\n", np ? np->full_name : "<???>");
41268 -
41269 -       if (dev && pci_probe_only &&
41270 -           (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
41271 -               /* This is a subordinate bridge */
41272 -
41273 -               pci_read_bridge_bases(bus);
41274 -               pcibios_fixup_device_resources(dev, bus);
41275 -       }
41276 -
41277 -       do_bus_setup(bus);
41278 -
41279 -       if (!pci_probe_only)
41280 -               return;
41281 -
41282 -       list_for_each_entry(dev, &bus->devices, bus_list)
41283 -               if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
41284 -                       pcibios_fixup_device_resources(dev, bus);
41285  }
41286 -EXPORT_SYMBOL(pcibios_fixup_bus);
41287  
41288  unsigned long pci_address_to_pio(phys_addr_t address)
41289  {
41290 Index: linux-2.6.24.7/arch/powerpc/kernel/pci_dn.c
41291 ===================================================================
41292 --- linux-2.6.24.7.orig/arch/powerpc/kernel/pci_dn.c
41293 +++ linux-2.6.24.7/arch/powerpc/kernel/pci_dn.c
41294 @@ -56,11 +56,6 @@ static void * __devinit update_dn_pci_in
41295                 pdn->busno = (regs[0] >> 16) & 0xff;
41296                 pdn->devfn = (regs[0] >> 8) & 0xff;
41297         }
41298 -       if (firmware_has_feature(FW_FEATURE_ISERIES)) {
41299 -               const u32 *busp = of_get_property(dn, "linux,subbus", NULL);
41300 -               if (busp)
41301 -                       pdn->bussubno = *busp;
41302 -       }
41303  
41304         pdn->pci_ext_config_space = (type && *type == 1);
41305         return NULL;
41306 @@ -133,7 +128,7 @@ void *traverse_pci_devices(struct device
41307   */
41308  void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb)
41309  {
41310 -       struct device_node * dn = (struct device_node *) phb->arch_data;
41311 +       struct device_node *dn = phb->dn;
41312         struct pci_dn *pdn;
41313  
41314         /* PHB nodes themselves must not match */
41315 Index: linux-2.6.24.7/arch/powerpc/kernel/ppc_ksyms.c
41316 ===================================================================
41317 --- linux-2.6.24.7.orig/arch/powerpc/kernel/ppc_ksyms.c
41318 +++ linux-2.6.24.7/arch/powerpc/kernel/ppc_ksyms.c
41319 @@ -59,6 +59,7 @@ extern void single_step_exception(struct
41320  extern int sys_sigreturn(struct pt_regs *regs);
41321  
41322  EXPORT_SYMBOL(clear_pages);
41323 +EXPORT_SYMBOL(copy_page);
41324  EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
41325  EXPORT_SYMBOL(DMA_MODE_READ);
41326  EXPORT_SYMBOL(DMA_MODE_WRITE);
41327 Index: linux-2.6.24.7/arch/powerpc/kernel/prom.c
41328 ===================================================================
41329 --- linux-2.6.24.7.orig/arch/powerpc/kernel/prom.c
41330 +++ linux-2.6.24.7/arch/powerpc/kernel/prom.c
41331 @@ -583,6 +583,20 @@ static void __init check_cpu_pa_features
41332                       ibm_pa_features, ARRAY_SIZE(ibm_pa_features));
41333  }
41334  
41335 +#ifdef CONFIG_PPC64
41336 +static void __init check_cpu_slb_size(unsigned long node)
41337 +{
41338 +       u32 *slb_size_ptr;
41339 +
41340 +       slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
41341 +       if (slb_size_ptr != NULL) {
41342 +               mmu_slb_size = *slb_size_ptr;
41343 +       }
41344 +}
41345 +#else
41346 +#define check_cpu_slb_size(node) do { } while(0)
41347 +#endif
41348 +
41349  static struct feature_property {
41350         const char *name;
41351         u32 min_value;
41352 @@ -600,6 +614,29 @@ static struct feature_property {
41353  #endif /* CONFIG_PPC64 */
41354  };
41355  
41356 +#if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU)
41357 +static inline void identical_pvr_fixup(unsigned long node)
41358 +{
41359 +       unsigned int pvr;
41360 +       char *model = of_get_flat_dt_prop(node, "model", NULL);
41361 +
41362 +       /*
41363 +        * Since 440GR(x)/440EP(x) processors have the same pvr,
41364 +        * we check the node path and set bit 28 in the cur_cpu_spec
41365 +        * pvr for EP(x) processor version. This bit is always 0 in
41366 +        * the "real" pvr. Then we call identify_cpu again with
41367 +        * the new logical pvr to enable FPU support.
41368 +        */
41369 +       if (model && strstr(model, "440EP")) {
41370 +               pvr = cur_cpu_spec->pvr_value | 0x8;
41371 +               identify_cpu(0, pvr);
41372 +               DBG("Using logical pvr %x for %s\n", pvr, model);
41373 +       }
41374 +}
41375 +#else
41376 +#define identical_pvr_fixup(node) do { } while(0)
41377 +#endif
41378 +
41379  static void __init check_cpu_feature_properties(unsigned long node)
41380  {
41381         unsigned long i;
41382 @@ -697,22 +734,13 @@ static int __init early_init_dt_scan_cpu
41383                 prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
41384                 if (prop && (*prop & 0xff000000) == 0x0f000000)
41385                         identify_cpu(0, *prop);
41386 -#if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU)
41387 -               /*
41388 -                * Since 440GR(x)/440EP(x) processors have the same pvr,
41389 -                * we check the node path and set bit 28 in the cur_cpu_spec
41390 -                * pvr for EP(x) processor version. This bit is always 0 in
41391 -                * the "real" pvr. Then we call identify_cpu again with
41392 -                * the new logical pvr to enable FPU support.
41393 -                */
41394 -               if (strstr(uname, "440EP")) {
41395 -                       identify_cpu(0, cur_cpu_spec->pvr_value | 0x8);
41396 -               }
41397 -#endif
41398 +
41399 +               identical_pvr_fixup(node);
41400         }
41401  
41402         check_cpu_feature_properties(node);
41403         check_cpu_pa_features(node);
41404 +       check_cpu_slb_size(node);
41405  
41406  #ifdef CONFIG_PPC_PSERIES
41407         if (nthreads > 1)
41408 Index: linux-2.6.24.7/arch/powerpc/kernel/prom_parse.c
41409 ===================================================================
41410 --- linux-2.6.24.7.orig/arch/powerpc/kernel/prom_parse.c
41411 +++ linux-2.6.24.7/arch/powerpc/kernel/prom_parse.c
41412 @@ -273,7 +273,7 @@ int of_irq_map_pci(struct pci_dev *pdev,
41413  #else
41414                         struct pci_controller *host;
41415                         host = pci_bus_to_host(pdev->bus);
41416 -                       ppnode = host ? host->arch_data : NULL;
41417 +                       ppnode = host ? host->dn : NULL;
41418  #endif
41419                         /* No node for host bridge ? give up */
41420                         if (ppnode == NULL)
41421 @@ -419,7 +419,7 @@ static struct of_bus *of_match_bus(struc
41422  
41423  static int of_translate_one(struct device_node *parent, struct of_bus *bus,
41424                             struct of_bus *pbus, u32 *addr,
41425 -                           int na, int ns, int pna)
41426 +                           int na, int ns, int pna, const char *rprop)
41427  {
41428         const u32 *ranges;
41429         unsigned int rlen;
41430 @@ -438,7 +438,7 @@ static int of_translate_one(struct devic
41431          * to translate addresses that aren't supposed to be translated in
41432          * the first place. --BenH.
41433          */
41434 -       ranges = of_get_property(parent, "ranges", &rlen);
41435 +       ranges = of_get_property(parent, rprop, &rlen);
41436         if (ranges == NULL || rlen == 0) {
41437                 offset = of_read_number(addr, na);
41438                 memset(addr, 0, pna * 4);
41439 @@ -481,7 +481,8 @@ static int of_translate_one(struct devic
41440   * that can be mapped to a cpu physical address). This is not really specified
41441   * that way, but this is traditionally the way IBM at least do things
41442   */
41443 -u64 of_translate_address(struct device_node *dev, const u32 *in_addr)
41444 +u64 __of_translate_address(struct device_node *dev, const u32 *in_addr,
41445 +                          const char *rprop)
41446  {
41447         struct device_node *parent = NULL;
41448         struct of_bus *bus, *pbus;
41449 @@ -540,7 +541,7 @@ u64 of_translate_address(struct device_n
41450                     pbus->name, pna, pns, parent->full_name);
41451  
41452                 /* Apply bus translation */
41453 -               if (of_translate_one(dev, bus, pbus, addr, na, ns, pna))
41454 +               if (of_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop))
41455                         break;
41456  
41457                 /* Complete the move up one level */
41458 @@ -556,8 +557,19 @@ u64 of_translate_address(struct device_n
41459  
41460         return result;
41461  }
41462 +
41463 +u64 of_translate_address(struct device_node *dev, const u32 *in_addr)
41464 +{
41465 +       return __of_translate_address(dev, in_addr, "ranges");
41466 +}
41467  EXPORT_SYMBOL(of_translate_address);
41468  
41469 +u64 of_translate_dma_address(struct device_node *dev, const u32 *in_addr)
41470 +{
41471 +       return __of_translate_address(dev, in_addr, "dma-ranges");
41472 +}
41473 +EXPORT_SYMBOL(of_translate_dma_address);
41474 +
41475  const u32 *of_get_address(struct device_node *dev, int index, u64 *size,
41476                     unsigned int *flags)
41477  {
41478 Index: linux-2.6.24.7/arch/powerpc/kernel/rio.c
41479 ===================================================================
41480 --- /dev/null
41481 +++ linux-2.6.24.7/arch/powerpc/kernel/rio.c
41482 @@ -0,0 +1,52 @@
41483 +/*
41484 + * RapidIO PPC32 support
41485 + *
41486 + * Copyright 2005 MontaVista Software, Inc.
41487 + * Matt Porter <mporter@kernel.crashing.org>
41488 + *
41489 + * This program is free software; you can redistribute  it and/or modify it
41490 + * under  the terms of  the GNU General  Public License as published by the
41491 + * Free Software Foundation;  either version 2 of the  License, or (at your
41492 + * option) any later version.
41493 + */
41494 +
41495 +#include <linux/init.h>
41496 +#include <linux/kernel.h>
41497 +#include <linux/rio.h>
41498 +
41499 +#include <asm/rio.h>
41500 +
41501 +/**
41502 + * platform_rio_init - Do platform specific RIO init
41503 + *
41504 + * Any platform specific initialization of RapdIO
41505 + * hardware is done here as well as registration
41506 + * of any active master ports in the system.
41507 + */
41508 +void __attribute__ ((weak))
41509 +    platform_rio_init(void)
41510 +{
41511 +       printk(KERN_WARNING "RIO: No platform_rio_init() present\n");
41512 +}
41513 +
41514 +/**
41515 + * ppc_rio_init - Do PPC32 RIO init
41516 + *
41517 + * Calls platform-specific RIO init code and then calls
41518 + * rio_init_mports() to initialize any master ports that
41519 + * have been registered with the RIO subsystem.
41520 + */
41521 +static int __init ppc_rio_init(void)
41522 +{
41523 +       printk(KERN_INFO "RIO: RapidIO init\n");
41524 +
41525 +       /* Platform specific initialization */
41526 +       platform_rio_init();
41527 +
41528 +       /* Enumerate all registered ports */
41529 +       rio_init_mports();
41530 +
41531 +       return 0;
41532 +}
41533 +
41534 +subsys_initcall(ppc_rio_init);
41535 Index: linux-2.6.24.7/arch/powerpc/kernel/rtas_pci.c
41536 ===================================================================
41537 --- linux-2.6.24.7.orig/arch/powerpc/kernel/rtas_pci.c
41538 +++ linux-2.6.24.7/arch/powerpc/kernel/rtas_pci.c
41539 @@ -260,7 +260,7 @@ static int phb_set_bus_ranges(struct dev
41540  
41541  int __devinit rtas_setup_phb(struct pci_controller *phb)
41542  {
41543 -       struct device_node *dev = phb->arch_data;
41544 +       struct device_node *dev = phb->dn;
41545  
41546         if (is_python(dev))
41547                 python_countermeasures(dev);
41548 @@ -280,10 +280,7 @@ void __init find_and_init_phbs(void)
41549         struct pci_controller *phb;
41550         struct device_node *root = of_find_node_by_path("/");
41551  
41552 -       for (node = of_get_next_child(root, NULL);
41553 -            node != NULL;
41554 -            node = of_get_next_child(root, node)) {
41555 -
41556 +       for_each_child_of_node(root, node) {
41557                 if (node->type == NULL || (strcmp(node->type, "pci") != 0 &&
41558                                            strcmp(node->type, "pciex") != 0))
41559                         continue;
41560 @@ -311,10 +308,12 @@ void __init find_and_init_phbs(void)
41561                 if (prop)
41562                         pci_probe_only = *prop;
41563  
41564 +#ifdef CONFIG_PPC32 /* Will be made generic soon */
41565                 prop = of_get_property(of_chosen,
41566                                 "linux,pci-assign-all-buses", NULL);
41567 -               if (prop)
41568 -                       pci_assign_all_buses = *prop;
41569 +               if (prop && *prop)
41570 +                       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
41571 +#endif /* CONFIG_PPC32 */
41572         }
41573  }
41574  
41575 Index: linux-2.6.24.7/arch/powerpc/kernel/setup-common.c
41576 ===================================================================
41577 --- linux-2.6.24.7.orig/arch/powerpc/kernel/setup-common.c
41578 +++ linux-2.6.24.7/arch/powerpc/kernel/setup-common.c
41579 @@ -33,6 +33,7 @@
41580  #include <linux/serial.h>
41581  #include <linux/serial_8250.h>
41582  #include <linux/debugfs.h>
41583 +#include <linux/percpu.h>
41584  #include <asm/io.h>
41585  #include <asm/prom.h>
41586  #include <asm/processor.h>
41587 @@ -57,6 +58,7 @@
41588  #include <asm/mmu.h>
41589  #include <asm/lmb.h>
41590  #include <asm/xmon.h>
41591 +#include <asm/cputhreads.h>
41592  
41593  #include "setup.h"
41594  
41595 @@ -327,6 +329,31 @@ void __init check_for_initrd(void)
41596  
41597  #ifdef CONFIG_SMP
41598  
41599 +int threads_per_core, threads_shift;
41600 +cpumask_t threads_core_mask;
41601 +
41602 +static void __init cpu_init_thread_core_maps(int tpc)
41603 +{
41604 +       int i;
41605 +
41606 +       threads_per_core = tpc;
41607 +       threads_core_mask = CPU_MASK_NONE;
41608 +
41609 +       /* This implementation only supports power of 2 number of threads
41610 +        * for simplicity and performance
41611 +        */
41612 +       threads_shift = ilog2(tpc);
41613 +       BUG_ON(tpc != (1 << threads_shift));
41614 +
41615 +       for (i = 0; i < tpc; i++)
41616 +               cpu_set(i, threads_core_mask);
41617 +
41618 +       printk(KERN_INFO "CPU maps initialized for %d thread%s per core\n",
41619 +              tpc, tpc > 1 ? "s" : "");
41620 +       printk(KERN_DEBUG " (thread shift is %d)\n", threads_shift);
41621 +}
41622 +
41623 +
41624  /**
41625   * setup_cpu_maps - initialize the following cpu maps:
41626   *                  cpu_possible_map
41627 @@ -350,22 +377,32 @@ void __init smp_setup_cpu_maps(void)
41628  {
41629         struct device_node *dn = NULL;
41630         int cpu = 0;
41631 +       int nthreads = 1;
41632 +
41633 +       DBG("smp_setup_cpu_maps()\n");
41634  
41635         while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
41636                 const int *intserv;
41637 -               int j, len = sizeof(u32), nthreads = 1;
41638 +               int j, len;
41639 +
41640 +               DBG("  * %s...\n", dn->full_name);
41641  
41642                 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s",
41643                                 &len);
41644 -               if (intserv)
41645 +               if (intserv) {
41646                         nthreads = len / sizeof(int);
41647 -               else {
41648 +                       DBG("    ibm,ppc-interrupt-server#s -> %d threads\n",
41649 +                           nthreads);
41650 +               } else {
41651 +                       DBG("    no ibm,ppc-interrupt-server#s -> 1 thread\n");
41652                         intserv = of_get_property(dn, "reg", NULL);
41653                         if (!intserv)
41654                                 intserv = &cpu; /* assume logical == phys */
41655                 }
41656  
41657                 for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
41658 +                       DBG("    thread %d -> cpu %d (hard id %d)\n",
41659 +                           j, cpu, intserv[j]);
41660                         cpu_set(cpu, cpu_present_map);
41661                         set_hard_smp_processor_id(cpu, intserv[j]);
41662                         cpu_set(cpu, cpu_possible_map);
41663 @@ -373,6 +410,12 @@ void __init smp_setup_cpu_maps(void)
41664                 }
41665         }
41666  
41667 +       /* If no SMT supported, nthreads is forced to 1 */
41668 +       if (!cpu_has_feature(CPU_FTR_SMT)) {
41669 +               DBG("  SMT disabled ! nthreads forced to 1\n");
41670 +               nthreads = 1;
41671 +       }
41672 +
41673  #ifdef CONFIG_PPC64
41674         /*
41675          * On pSeries LPAR, we need to know how many cpus
41676 @@ -395,7 +438,7 @@ void __init smp_setup_cpu_maps(void)
41677  
41678                 /* Double maxcpus for processors which have SMT capability */
41679                 if (cpu_has_feature(CPU_FTR_SMT))
41680 -                       maxcpus *= 2;
41681 +                       maxcpus *= nthreads;
41682  
41683                 if (maxcpus > NR_CPUS) {
41684                         printk(KERN_WARNING
41685 @@ -412,9 +455,16 @@ void __init smp_setup_cpu_maps(void)
41686         out:
41687                 of_node_put(dn);
41688         }
41689 -
41690         vdso_data->processorCount = num_present_cpus();
41691  #endif /* CONFIG_PPC64 */
41692 +
41693 +        /* Initialize CPU <=> thread mapping/
41694 +        *
41695 +        * WARNING: We assume that the number of threads is the same for
41696 +        * every CPU in the system. If that is not the case, then some code
41697 +        * here will have to be reworked
41698 +        */
41699 +       cpu_init_thread_core_maps(nthreads);
41700  }
41701  
41702  /*
41703 @@ -424,17 +474,19 @@ void __init smp_setup_cpu_maps(void)
41704   */
41705  void __init smp_setup_cpu_sibling_map(void)
41706  {
41707 -#if defined(CONFIG_PPC64)
41708 -       int cpu;
41709 +#ifdef CONFIG_PPC64
41710 +       int i, cpu, base;
41711  
41712 -       /*
41713 -        * Do the sibling map; assume only two threads per processor.
41714 -        */
41715         for_each_possible_cpu(cpu) {
41716 -               cpu_set(cpu, per_cpu(cpu_sibling_map, cpu));
41717 -               if (cpu_has_feature(CPU_FTR_SMT))
41718 -                       cpu_set(cpu ^ 0x1, per_cpu(cpu_sibling_map, cpu));
41719 +               DBG("Sibling map for CPU %d:", cpu);
41720 +               base = cpu_first_thread_in_core(cpu);
41721 +               for (i = 0; i < threads_per_core; i++) {
41722 +                       cpu_set(base + i, per_cpu(cpu_sibling_map, cpu));
41723 +                       DBG(" %d", base + i);
41724 +               }
41725 +               DBG("\n");
41726         }
41727 +
41728  #endif /* CONFIG_PPC64 */
41729  }
41730  #endif /* CONFIG_SMP */
41731 Index: linux-2.6.24.7/arch/powerpc/kernel/signal_32.c
41732 ===================================================================
41733 --- linux-2.6.24.7.orig/arch/powerpc/kernel/signal_32.c
41734 +++ linux-2.6.24.7/arch/powerpc/kernel/signal_32.c
41735 @@ -24,13 +24,12 @@
41736  #include <linux/signal.h>
41737  #include <linux/errno.h>
41738  #include <linux/elf.h>
41739 +#include <linux/ptrace.h>
41740  #ifdef CONFIG_PPC64
41741  #include <linux/syscalls.h>
41742  #include <linux/compat.h>
41743 -#include <linux/ptrace.h>
41744  #else
41745  #include <linux/wait.h>
41746 -#include <linux/ptrace.h>
41747  #include <linux/unistd.h>
41748  #include <linux/stddef.h>
41749  #include <linux/tty.h>
41750 Index: linux-2.6.24.7/arch/powerpc/kernel/smp.c
41751 ===================================================================
41752 --- linux-2.6.24.7.orig/arch/powerpc/kernel/smp.c
41753 +++ linux-2.6.24.7/arch/powerpc/kernel/smp.c
41754 @@ -76,6 +76,8 @@ void smp_call_function_interrupt(void);
41755  
41756  int smt_enabled_at_boot = 1;
41757  
41758 +static int ipi_fail_ok;
41759 +
41760  static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;
41761  
41762  #ifdef CONFIG_PPC64
41763 @@ -181,12 +183,13 @@ static struct call_data_struct {
41764   * <wait> If true, wait (atomically) until function has completed on other CPUs.
41765   * [RETURNS] 0 on success, else a negative status code. Does not return until
41766   * remote CPUs are nearly ready to execute <<func>> or are or have executed.
41767 + * <map> is a cpu map of the cpus to send IPI to.
41768   *
41769   * You must not call this function with disabled interrupts or from a
41770   * hardware interrupt handler or from a bottom half handler.
41771   */
41772 -int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
41773 -                       int wait, cpumask_t map)
41774 +static int __smp_call_function_map(void (*func) (void *info), void *info,
41775 +                                  int nonatomic, int wait, cpumask_t map)
41776  {
41777         struct call_data_struct data;
41778         int ret = -1, num_cpus;
41779 @@ -203,8 +206,6 @@ int smp_call_function_map(void (*func) (
41780         if (wait)
41781                 atomic_set(&data.finished, 0);
41782  
41783 -       spin_lock(&call_lock);
41784 -
41785         /* remove 'self' from the map */
41786         if (cpu_isset(smp_processor_id(), map))
41787                 cpu_clear(smp_processor_id(), map);
41788 @@ -231,7 +232,8 @@ int smp_call_function_map(void (*func) (
41789                         printk("smp_call_function on cpu %d: other cpus not "
41790                                 "responding (%d)\n", smp_processor_id(),
41791                                 atomic_read(&data.started));
41792 -                       debugger(NULL);
41793 +                       if (!ipi_fail_ok)
41794 +                               debugger(NULL);
41795                         goto out;
41796                 }
41797         }
41798 @@ -258,14 +260,18 @@ int smp_call_function_map(void (*func) (
41799   out:
41800         call_data = NULL;
41801         HMT_medium();
41802 -       spin_unlock(&call_lock);
41803         return ret;
41804  }
41805  
41806  static int __smp_call_function(void (*func)(void *info), void *info,
41807                                int nonatomic, int wait)
41808  {
41809 -       return smp_call_function_map(func,info,nonatomic,wait,cpu_online_map);
41810 +       int ret;
41811 +       spin_lock(&call_lock);
41812 +       ret =__smp_call_function_map(func, info, nonatomic, wait,
41813 +                                      cpu_online_map);
41814 +       spin_unlock(&call_lock);
41815 +       return ret;
41816  }
41817  
41818  int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
41819 @@ -278,8 +284,8 @@ int smp_call_function(void (*func) (void
41820  }
41821  EXPORT_SYMBOL(smp_call_function);
41822  
41823 -int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int nonatomic,
41824 -                       int wait)
41825 +int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
41826 +                            int nonatomic, int wait)
41827  {
41828         cpumask_t map = CPU_MASK_NONE;
41829         int ret = 0;
41830 @@ -291,9 +297,11 @@ int smp_call_function_single(int cpu, vo
41831                 return -EINVAL;
41832  
41833         cpu_set(cpu, map);
41834 -       if (cpu != get_cpu())
41835 -               ret = smp_call_function_map(func,info,nonatomic,wait,map);
41836 -       else {
41837 +       if (cpu != get_cpu()) {
41838 +               spin_lock(&call_lock);
41839 +               ret = __smp_call_function_map(func, info, nonatomic, wait, map);
41840 +               spin_unlock(&call_lock);
41841 +       } else {
41842                 local_irq_disable();
41843                 func(info);
41844                 local_irq_enable();
41845 @@ -305,7 +313,22 @@ EXPORT_SYMBOL(smp_call_function_single);
41846  
41847  void smp_send_stop(void)
41848  {
41849 -       __smp_call_function(stop_this_cpu, NULL, 1, 0);
41850 +       int nolock;
41851 +
41852 +       /* It's OK to fail sending the IPI, since the alternative is to
41853 +        * be stuck forever waiting on the other CPU to take the interrupt.
41854 +        *
41855 +        * It's better to at least continue and go through reboot, since this
41856 +        * function is usually called at panic or reboot time in the first
41857 +        * place.
41858 +        */
41859 +       ipi_fail_ok = 1;
41860 +
41861 +       /* Don't deadlock in case we got called through panic */
41862 +       nolock = !spin_trylock(&call_lock);
41863 +       __smp_call_function_map(stop_this_cpu, NULL, 1, 0, cpu_online_map);
41864 +       if (!nolock)
41865 +               spin_unlock(&call_lock);
41866  }
41867  
41868  void smp_call_function_interrupt(void)
41869 Index: linux-2.6.24.7/arch/powerpc/kernel/systbl_chk.c
41870 ===================================================================
41871 --- /dev/null
41872 +++ linux-2.6.24.7/arch/powerpc/kernel/systbl_chk.c
41873 @@ -0,0 +1,58 @@
41874 +/*
41875 + * This file, when run through CPP produces a list of syscall numbers
41876 + * in the order of systbl.h.  That way we can check for gaps and syscalls
41877 + * that are out of order.
41878 + *
41879 + * Unfortunately, we cannot check for the correct ordering of entries
41880 + * using SYSX().
41881 + *
41882 + * Copyright Â© IBM Corporation
41883 + *
41884 + * This program is free software; you can redistribute it and/or
41885 + * modify it under the terms of the GNU General Public License
41886 + * as published by the Free Software Foundation; either version
41887 + * 2 of the License, or (at your option) any later version.
41888 + */
41889 +#include <asm/unistd.h>
41890 +
41891 +#define SYSCALL(func)          __NR_##func
41892 +#define COMPAT_SYS(func)       __NR_##func
41893 +#define PPC_SYS(func)          __NR_##func
41894 +#ifdef CONFIG_PPC64
41895 +#define OLDSYS(func)           -1
41896 +#define SYS32ONLY(func)                -1
41897 +#else
41898 +#define OLDSYS(func)           __NR_old##func
41899 +#define SYS32ONLY(func)                __NR_##func
41900 +#endif
41901 +#define SYSX(f, f3264, f32)    -1
41902 +
41903 +#define SYSCALL_SPU(func)      SYSCALL(func)
41904 +#define COMPAT_SYS_SPU(func)   COMPAT_SYS(func)
41905 +#define PPC_SYS_SPU(func)      PPC_SYS(func)
41906 +#define SYSX_SPU(f, f3264, f32)        SYSX(f, f3264, f32)
41907 +
41908 +/* Just insert a marker for ni_syscalls */
41909 +#define        __NR_ni_syscall         -1
41910 +
41911 +/*
41912 + * These are the known exceptions.
41913 + * Hopefully, there will be no more.
41914 + */
41915 +#define        __NR_llseek             __NR__llseek
41916 +#undef __NR_umount
41917 +#define        __NR_umount             __NR_umount2
41918 +#define        __NR_old_getrlimit      __NR_getrlimit
41919 +#define        __NR_newstat            __NR_stat
41920 +#define        __NR_newlstat           __NR_lstat
41921 +#define        __NR_newfstat           __NR_fstat
41922 +#define        __NR_newuname           __NR_uname
41923 +#define        __NR_sysctl             __NR__sysctl
41924 +#define __NR_olddebug_setcontext       __NR_sys_debug_setcontext
41925 +
41926 +/* We call sys_ugetrlimit for syscall number __NR_getrlimit */
41927 +#define getrlimit              ugetrlimit
41928 +
41929 +START_TABLE
41930 +#include <asm/systbl.h>
41931 +END_TABLE __NR_syscalls
41932 Index: linux-2.6.24.7/arch/powerpc/kernel/systbl_chk.sh
41933 ===================================================================
41934 --- /dev/null
41935 +++ linux-2.6.24.7/arch/powerpc/kernel/systbl_chk.sh
41936 @@ -0,0 +1,33 @@
41937 +#!/bin/sh
41938 +#
41939 +# Just process the CPP output from systbl_chk.c and complain
41940 +# if anything is out of order.
41941 +#
41942 +# Copyright Â© 2008 IBM Corporation
41943 +#
41944 +# This program is free software; you can redistribute it and/or
41945 +# modify it under the terms of the GNU General Public License
41946 +# as published by the Free Software Foundation; either version
41947 +# 2 of the License, or (at your option) any later version.
41948 +
41949 +awk    'BEGIN { num = -1; }    # Ignore the beginning of the file
41950 +       /^#/ { next; }
41951 +       /^[ \t]*$/ { next; }
41952 +       /^START_TABLE/ { num = 0; next; }
41953 +       /^END_TABLE/ {
41954 +               if (num != $2) {
41955 +                       printf "__NR_syscalls (%s) is not one more than the last syscall (%s)\n",
41956 +                               $2, num - 1;
41957 +                       exit(1);
41958 +               }
41959 +               num = -1;       # Ignore the rest of the file
41960 +       }
41961 +       {
41962 +               if (num == -1) next;
41963 +               if (($1 != -1) && ($1 != num)) {
41964 +                       printf "Syscall %s out of order (expected %s)\n",
41965 +                               $1, num;
41966 +                       exit(1);
41967 +               };
41968 +               num++;
41969 +       }' "$1"
41970 Index: linux-2.6.24.7/arch/powerpc/kernel/time.c
41971 ===================================================================
41972 --- linux-2.6.24.7.orig/arch/powerpc/kernel/time.c
41973 +++ linux-2.6.24.7/arch/powerpc/kernel/time.c
41974 @@ -116,9 +116,12 @@ static struct clock_event_device decreme
41975         .features       = CLOCK_EVT_FEAT_ONESHOT,
41976  };
41977  
41978 -static DEFINE_PER_CPU(struct clock_event_device, decrementers);
41979 -void init_decrementer_clockevent(void);
41980 -static DEFINE_PER_CPU(u64, decrementer_next_tb);
41981 +struct decrementer_clock {
41982 +       struct clock_event_device event;
41983 +       u64 next_tb;
41984 +};
41985 +
41986 +static DEFINE_PER_CPU(struct decrementer_clock, decrementers);
41987  
41988  #ifdef CONFIG_PPC_ISERIES
41989  static unsigned long __initdata iSeries_recal_titan;
41990 @@ -216,7 +219,11 @@ static u64 read_purr(void)
41991   */
41992  static u64 read_spurr(u64 purr)
41993  {
41994 -       if (cpu_has_feature(CPU_FTR_SPURR))
41995 +       /*
41996 +        * cpus without PURR won't have a SPURR
41997 +        * We already know the former when we use this, so tell gcc
41998 +        */
41999 +       if (cpu_has_feature(CPU_FTR_PURR) && cpu_has_feature(CPU_FTR_SPURR))
42000                 return mfspr(SPRN_SPURR);
42001         return purr;
42002  }
42003 @@ -227,29 +234,30 @@ static u64 read_spurr(u64 purr)
42004   */
42005  void account_system_vtime(struct task_struct *tsk)
42006  {
42007 -       u64 now, nowscaled, delta, deltascaled;
42008 +       u64 now, nowscaled, delta, deltascaled, sys_time;
42009         unsigned long flags;
42010  
42011         local_irq_save(flags);
42012         now = read_purr();
42013 -       delta = now - get_paca()->startpurr;
42014 -       get_paca()->startpurr = now;
42015         nowscaled = read_spurr(now);
42016 +       delta = now - get_paca()->startpurr;
42017         deltascaled = nowscaled - get_paca()->startspurr;
42018 +       get_paca()->startpurr = now;
42019         get_paca()->startspurr = nowscaled;
42020         if (!in_interrupt()) {
42021                 /* deltascaled includes both user and system time.
42022                  * Hence scale it based on the purr ratio to estimate
42023                  * the system time */
42024 +               sys_time = get_paca()->system_time;
42025                 if (get_paca()->user_time)
42026 -                       deltascaled = deltascaled * get_paca()->system_time /
42027 -                            (get_paca()->system_time + get_paca()->user_time);
42028 -               delta += get_paca()->system_time;
42029 +                       deltascaled = deltascaled * sys_time /
42030 +                            (sys_time + get_paca()->user_time);
42031 +               delta += sys_time;
42032                 get_paca()->system_time = 0;
42033         }
42034         account_system_time(tsk, 0, delta);
42035 -       get_paca()->purrdelta = delta;
42036         account_system_time_scaled(tsk, deltascaled);
42037 +       get_paca()->purrdelta = delta;
42038         get_paca()->spurrdelta = deltascaled;
42039         local_irq_restore(flags);
42040  }
42041 @@ -326,11 +334,9 @@ void calculate_steal_time(void)
42042         s64 stolen;
42043         struct cpu_purr_data *pme;
42044  
42045 -       if (!cpu_has_feature(CPU_FTR_PURR))
42046 -               return;
42047 -       pme = &per_cpu(cpu_purr_data, smp_processor_id());
42048 +       pme = &__get_cpu_var(cpu_purr_data);
42049         if (!pme->initialized)
42050 -               return;         /* this can happen in early boot */
42051 +               return;         /* !CPU_FTR_PURR or early in early boot */
42052         tb = mftb();
42053         purr = mfspr(SPRN_PURR);
42054         stolen = (tb - pme->tb) - (purr - pme->purr);
42055 @@ -353,7 +359,7 @@ static void snapshot_purr(void)
42056         if (!cpu_has_feature(CPU_FTR_PURR))
42057                 return;
42058         local_irq_save(flags);
42059 -       pme = &per_cpu(cpu_purr_data, smp_processor_id());
42060 +       pme = &__get_cpu_var(cpu_purr_data);
42061         pme->tb = mftb();
42062         pme->purr = mfspr(SPRN_PURR);
42063         pme->initialized = 1;
42064 @@ -556,8 +562,8 @@ void __init iSeries_time_init_early(void
42065  void timer_interrupt(struct pt_regs * regs)
42066  {
42067         struct pt_regs *old_regs;
42068 -       int cpu = smp_processor_id();
42069 -       struct clock_event_device *evt = &per_cpu(decrementers, cpu);
42070 +       struct decrementer_clock *decrementer =  &__get_cpu_var(decrementers);
42071 +       struct clock_event_device *evt = &decrementer->event;
42072         u64 now;
42073  
42074         /* Ensure a positive value is written to the decrementer, or else
42075 @@ -570,9 +576,9 @@ void timer_interrupt(struct pt_regs * re
42076  #endif
42077  
42078         now = get_tb_or_rtc();
42079 -       if (now < per_cpu(decrementer_next_tb, cpu)) {
42080 +       if (now < decrementer->next_tb) {
42081                 /* not time for this event yet */
42082 -               now = per_cpu(decrementer_next_tb, cpu) - now;
42083 +               now = decrementer->next_tb - now;
42084                 if (now <= DECREMENTER_MAX)
42085                         set_dec((int)now);
42086                 return;
42087 @@ -623,6 +629,45 @@ void wakeup_decrementer(void)
42088         set_dec(ticks);
42089  }
42090  
42091 +#ifdef CONFIG_SUSPEND
42092 +void generic_suspend_disable_irqs(void)
42093 +{
42094 +       preempt_disable();
42095 +
42096 +       /* Disable the decrementer, so that it doesn't interfere
42097 +        * with suspending.
42098 +        */
42099 +
42100 +       set_dec(0x7fffffff);
42101 +       local_irq_disable();
42102 +       set_dec(0x7fffffff);
42103 +}
42104 +
42105 +void generic_suspend_enable_irqs(void)
42106 +{
42107 +       wakeup_decrementer();
42108 +
42109 +       local_irq_enable();
42110 +       preempt_enable();
42111 +}
42112 +
42113 +/* Overrides the weak version in kernel/power/main.c */
42114 +void arch_suspend_disable_irqs(void)
42115 +{
42116 +       if (ppc_md.suspend_disable_irqs)
42117 +               ppc_md.suspend_disable_irqs();
42118 +       generic_suspend_disable_irqs();
42119 +}
42120 +
42121 +/* Overrides the weak version in kernel/power/main.c */
42122 +void arch_suspend_enable_irqs(void)
42123 +{
42124 +       generic_suspend_enable_irqs();
42125 +       if (ppc_md.suspend_enable_irqs)
42126 +               ppc_md.suspend_enable_irqs();
42127 +}
42128 +#endif
42129 +
42130  #ifdef CONFIG_SMP
42131  void __init smp_space_timers(unsigned int max_cpus)
42132  {
42133 @@ -811,7 +856,7 @@ void __init clocksource_init(void)
42134  static int decrementer_set_next_event(unsigned long evt,
42135                                       struct clock_event_device *dev)
42136  {
42137 -       __get_cpu_var(decrementer_next_tb) = get_tb_or_rtc() + evt;
42138 +       __get_cpu_var(decrementers).next_tb = get_tb_or_rtc() + evt;
42139         set_dec(evt);
42140         return 0;
42141  }
42142 @@ -825,7 +870,7 @@ static void decrementer_set_mode(enum cl
42143  
42144  static void register_decrementer_clockevent(int cpu)
42145  {
42146 -       struct clock_event_device *dec = &per_cpu(decrementers, cpu);
42147 +       struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
42148  
42149         *dec = decrementer_clockevent;
42150         dec->cpumask = cpumask_of_cpu(cpu);
42151 @@ -836,7 +881,7 @@ static void register_decrementer_clockev
42152         clockevents_register_device(dec);
42153  }
42154  
42155 -void init_decrementer_clockevent(void)
42156 +static void __init init_decrementer_clockevent(void)
42157  {
42158         int cpu = smp_processor_id();
42159  
42160 Index: linux-2.6.24.7/arch/powerpc/kernel/traps.c
42161 ===================================================================
42162 --- linux-2.6.24.7.orig/arch/powerpc/kernel/traps.c
42163 +++ linux-2.6.24.7/arch/powerpc/kernel/traps.c
42164 @@ -334,18 +334,25 @@ static inline int check_io_access(struct
42165  #define clear_single_step(regs)        ((regs)->msr &= ~MSR_SE)
42166  #endif
42167  
42168 -static int generic_machine_check_exception(struct pt_regs *regs)
42169 +#if defined(CONFIG_4xx)
42170 +int machine_check_4xx(struct pt_regs *regs)
42171  {
42172         unsigned long reason = get_mc_reason(regs);
42173  
42174 -#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
42175         if (reason & ESR_IMCP) {
42176                 printk("Instruction");
42177                 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
42178         } else
42179                 printk("Data");
42180         printk(" machine check in kernel mode.\n");
42181 -#elif defined(CONFIG_440A)
42182 +
42183 +       return 0;
42184 +}
42185 +
42186 +int machine_check_440A(struct pt_regs *regs)
42187 +{
42188 +       unsigned long reason = get_mc_reason(regs);
42189 +
42190         printk("Machine check in kernel mode.\n");
42191         if (reason & ESR_IMCP){
42192                 printk("Instruction Synchronous Machine Check exception\n");
42193 @@ -375,7 +382,13 @@ static int generic_machine_check_excepti
42194                 /* Clear MCSR */
42195                 mtspr(SPRN_MCSR, mcsr);
42196         }
42197 -#elif defined (CONFIG_E500)
42198 +       return 0;
42199 +}
42200 +#elif defined(CONFIG_E500)
42201 +int machine_check_e500(struct pt_regs *regs)
42202 +{
42203 +       unsigned long reason = get_mc_reason(regs);
42204 +
42205         printk("Machine check in kernel mode.\n");
42206         printk("Caused by (from MCSR=%lx): ", reason);
42207  
42208 @@ -403,7 +416,14 @@ static int generic_machine_check_excepti
42209                 printk("Bus - Instruction Parity Error\n");
42210         if (reason & MCSR_BUS_RPERR)
42211                 printk("Bus - Read Parity Error\n");
42212 -#elif defined (CONFIG_E200)
42213 +
42214 +       return 0;
42215 +}
42216 +#elif defined(CONFIG_E200)
42217 +int machine_check_e200(struct pt_regs *regs)
42218 +{
42219 +       unsigned long reason = get_mc_reason(regs);
42220 +
42221         printk("Machine check in kernel mode.\n");
42222         printk("Caused by (from MCSR=%lx): ", reason);
42223  
42224 @@ -421,7 +441,14 @@ static int generic_machine_check_excepti
42225                 printk("Bus - Read Bus Error on data load\n");
42226         if (reason & MCSR_BUS_WRERR)
42227                 printk("Bus - Write Bus Error on buffered store or cache line push\n");
42228 -#else /* !CONFIG_4xx && !CONFIG_E500 && !CONFIG_E200 */
42229 +
42230 +       return 0;
42231 +}
42232 +#else
42233 +int machine_check_generic(struct pt_regs *regs)
42234 +{
42235 +       unsigned long reason = get_mc_reason(regs);
42236 +
42237         printk("Machine check in kernel mode.\n");
42238         printk("Caused by (from SRR1=%lx): ", reason);
42239         switch (reason & 0x601F0000) {
42240 @@ -451,22 +478,26 @@ static int generic_machine_check_excepti
42241         default:
42242                 printk("Unknown values in msr\n");
42243         }
42244 -#endif /* CONFIG_4xx */
42245 -
42246         return 0;
42247  }
42248 +#endif /* everything else */
42249  
42250  void machine_check_exception(struct pt_regs *regs)
42251  {
42252         int recover = 0;
42253  
42254 -       /* See if any machine dependent calls */
42255 +       /* See if any machine dependent calls. In theory, we would want
42256 +        * to call the CPU first, and call the ppc_md. one if the CPU
42257 +        * one returns a positive number. However there is existing code
42258 +        * that assumes the board gets a first chance, so let's keep it
42259 +        * that way for now and fix things later. --BenH.
42260 +        */
42261         if (ppc_md.machine_check_exception)
42262                 recover = ppc_md.machine_check_exception(regs);
42263 -       else
42264 -               recover = generic_machine_check_exception(regs);
42265 +       else if (cur_cpu_spec->machine_check)
42266 +               recover = cur_cpu_spec->machine_check(regs);
42267  
42268 -       if (recover)
42269 +       if (recover > 0)
42270                 return;
42271  
42272         if (user_mode(regs)) {
42273 @@ -476,7 +507,12 @@ void machine_check_exception(struct pt_r
42274         }
42275  
42276  #if defined(CONFIG_8xx) && defined(CONFIG_PCI)
42277 -       /* the qspan pci read routines can cause machine checks -- Cort */
42278 +       /* the qspan pci read routines can cause machine checks -- Cort
42279 +        *
42280 +        * yuck !!! that totally needs to go away ! There are better ways
42281 +        * to deal with that than having a wart in the mcheck handler.
42282 +        * -- BenH
42283 +        */
42284         bad_page_fault(regs, regs->dar, SIGBUS);
42285         return;
42286  #endif
42287 @@ -622,6 +658,9 @@ static void parse_fpe(struct pt_regs *re
42288  #define INST_POPCNTB           0x7c0000f4
42289  #define INST_POPCNTB_MASK      0xfc0007fe
42290  
42291 +#define INST_ISEL              0x7c00001e
42292 +#define INST_ISEL_MASK         0xfc00003e
42293 +
42294  static int emulate_string_inst(struct pt_regs *regs, u32 instword)
42295  {
42296         u8 rT = (instword >> 21) & 0x1f;
42297 @@ -707,6 +746,23 @@ static int emulate_popcntb_inst(struct p
42298         return 0;
42299  }
42300  
42301 +static int emulate_isel(struct pt_regs *regs, u32 instword)
42302 +{
42303 +       u8 rT = (instword >> 21) & 0x1f;
42304 +       u8 rA = (instword >> 16) & 0x1f;
42305 +       u8 rB = (instword >> 11) & 0x1f;
42306 +       u8 BC = (instword >> 6) & 0x1f;
42307 +       u8 bit;
42308 +       unsigned long tmp;
42309 +
42310 +       tmp = (rA == 0) ? 0 : regs->gpr[rA];
42311 +       bit = (regs->ccr >> (31 - BC)) & 0x1;
42312 +
42313 +       regs->gpr[rT] = bit ? tmp : regs->gpr[rB];
42314 +
42315 +       return 0;
42316 +}
42317 +
42318  static int emulate_instruction(struct pt_regs *regs)
42319  {
42320         u32 instword;
42321 @@ -749,6 +805,11 @@ static int emulate_instruction(struct pt
42322                 return emulate_popcntb_inst(regs, instword);
42323         }
42324  
42325 +       /* Emulate isel (Integer Select) instruction */
42326 +       if ((instword & INST_ISEL_MASK) == INST_ISEL) {
42327 +               return emulate_isel(regs, instword);
42328 +       }
42329 +
42330         return -EINVAL;
42331  }
42332  
42333 Index: linux-2.6.24.7/arch/powerpc/kernel/udbg.c
42334 ===================================================================
42335 --- linux-2.6.24.7.orig/arch/powerpc/kernel/udbg.c
42336 +++ linux-2.6.24.7/arch/powerpc/kernel/udbg.c
42337 @@ -54,9 +54,16 @@ void __init udbg_early_init(void)
42338  #elif defined(CONFIG_PPC_EARLY_DEBUG_44x)
42339         /* PPC44x debug */
42340         udbg_init_44x_as1();
42341 +#elif defined(CONFIG_PPC_EARLY_DEBUG_40x)
42342 +       /* PPC40x debug */
42343 +       udbg_init_40x_realmode();
42344  #elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)
42345         udbg_init_cpm();
42346  #endif
42347 +
42348 +#ifdef CONFIG_PPC_EARLY_DEBUG
42349 +       console_loglevel = 10;
42350 +#endif
42351  }
42352  
42353  /* udbg library, used by xmon et al */
42354 Index: linux-2.6.24.7/arch/powerpc/kernel/udbg_16550.c
42355 ===================================================================
42356 --- linux-2.6.24.7.orig/arch/powerpc/kernel/udbg_16550.c
42357 +++ linux-2.6.24.7/arch/powerpc/kernel/udbg_16550.c
42358 @@ -46,7 +46,7 @@ struct NS16550 {
42359  
42360  #define LCR_DLAB 0x80
42361  
42362 -static volatile struct NS16550 __iomem *udbg_comport;
42363 +static struct NS16550 __iomem *udbg_comport;
42364  
42365  static void udbg_550_putc(char c)
42366  {
42367 @@ -117,7 +117,7 @@ unsigned int udbg_probe_uart_speed(void 
42368  {
42369         unsigned int dll, dlm, divisor, prescaler, speed;
42370         u8 old_lcr;
42371 -       volatile struct NS16550 __iomem *port = comport;
42372 +       struct NS16550 __iomem *port = comport;
42373  
42374         old_lcr = in_8(&port->lcr);
42375  
42376 @@ -162,7 +162,7 @@ void udbg_maple_real_putc(char c)
42377  
42378  void __init udbg_init_maple_realmode(void)
42379  {
42380 -       udbg_comport = (volatile struct NS16550 __iomem *)0xf40003f8;
42381 +       udbg_comport = (struct NS16550 __iomem *)0xf40003f8;
42382  
42383         udbg_putc = udbg_maple_real_putc;
42384         udbg_getc = NULL;
42385 @@ -184,7 +184,7 @@ void udbg_pas_real_putc(char c)
42386  
42387  void udbg_init_pas_realmode(void)
42388  {
42389 -       udbg_comport = (volatile struct NS16550 __iomem *)0xfcff03f8UL;
42390 +       udbg_comport = (struct NS16550 __iomem *)0xfcff03f8UL;
42391  
42392         udbg_putc = udbg_pas_real_putc;
42393         udbg_getc = NULL;
42394 @@ -219,9 +219,42 @@ static int udbg_44x_as1_getc(void)
42395  void __init udbg_init_44x_as1(void)
42396  {
42397         udbg_comport =
42398 -               (volatile struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR;
42399 +               (struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR;
42400  
42401         udbg_putc = udbg_44x_as1_putc;
42402         udbg_getc = udbg_44x_as1_getc;
42403  }
42404  #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
42405 +
42406 +#ifdef CONFIG_PPC_EARLY_DEBUG_40x
42407 +static void udbg_40x_real_putc(char c)
42408 +{
42409 +       if (udbg_comport) {
42410 +               while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
42411 +                       /* wait for idle */;
42412 +               real_writeb(c, &udbg_comport->thr); eieio();
42413 +               if (c == '\n')
42414 +                       udbg_40x_real_putc('\r');
42415 +       }
42416 +}
42417 +
42418 +static int udbg_40x_real_getc(void)
42419 +{
42420 +       if (udbg_comport) {
42421 +               while ((real_readb(&udbg_comport->lsr) & LSR_DR) == 0)
42422 +                       ; /* wait for char */
42423 +               return real_readb(&udbg_comport->rbr);
42424 +       }
42425 +       return -1;
42426 +}
42427 +
42428 +void __init udbg_init_40x_realmode(void)
42429 +{
42430 +       udbg_comport = (struct NS16550 __iomem *)
42431 +               CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR;
42432 +
42433 +       udbg_putc = udbg_40x_real_putc;
42434 +       udbg_getc = udbg_40x_real_getc;
42435 +       udbg_getc_poll = NULL;
42436 +}
42437 +#endif /* CONFIG_PPC_EARLY_DEBUG_40x */
42438 Index: linux-2.6.24.7/arch/powerpc/math-emu/op-4.h
42439 ===================================================================
42440 --- linux-2.6.24.7.orig/arch/powerpc/math-emu/op-4.h
42441 +++ linux-2.6.24.7/arch/powerpc/math-emu/op-4.h
42442 @@ -194,19 +194,39 @@
42443    (X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0)
42444  
42445  #ifndef __FP_FRAC_ADD_4
42446 -#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)           \
42447 -  (r0 = x0 + y0,                                                       \
42448 -   r1 = x1 + y1 + (r0 < x0),                                           \
42449 -   r2 = x2 + y2 + (r1 < x1),                                           \
42450 -   r3 = x3 + y3 + (r2 < x2))
42451 +#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)   \
42452 +  do {                                                         \
42453 +    int _c1, _c2, _c3;                                         \
42454 +    r0 = x0 + y0;                                              \
42455 +    _c1 = r0 < x0;                                             \
42456 +    r1 = x1 + y1;                                              \
42457 +    _c2 = r1 < x1;                                             \
42458 +    r1 += _c1;                                                 \
42459 +    _c2 |= r1 < _c1;                                           \
42460 +    r2 = x2 + y2;                                              \
42461 +    _c3 = r2 < x2;                                             \
42462 +    r2 += _c2;                                                 \
42463 +    _c3 |= r2 < _c2;                                           \
42464 +    r3 = x3 + y3 + _c3;                                                \
42465 +  } while (0)
42466  #endif
42467  
42468  #ifndef __FP_FRAC_SUB_4
42469 -#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)           \
42470 -  (r0 = x0 - y0,                                                        \
42471 -   r1 = x1 - y1 - (r0 > x0),                                            \
42472 -   r2 = x2 - y2 - (r1 > x1),                                            \
42473 -   r3 = x3 - y3 - (r2 > x2))
42474 +#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)   \
42475 +  do {                                                         \
42476 +    int _c1, _c2, _c3;                                         \
42477 +    r0 = x0 - y0;                                              \
42478 +    _c1 = r0 > x0;                                             \
42479 +    r1 = x1 - y1;                                              \
42480 +    _c2 = r1 > x1;                                             \
42481 +    r1 -= _c1;                                                 \
42482 +    _c2 |= r1 > _c1;                                           \
42483 +    r2 = x2 - y2;                                              \
42484 +    _c3 = r2 > x2;                                             \
42485 +    r2 -= _c2;                                                 \
42486 +    _c3 |= r2 > _c2;                                           \
42487 +    r3 = x3 - y3 - _c3;                                                \
42488 +  } while (0)
42489  #endif
42490  
42491  #ifndef __FP_FRAC_ADDI_4
42492 Index: linux-2.6.24.7/arch/powerpc/mm/fault.c
42493 ===================================================================
42494 --- linux-2.6.24.7.orig/arch/powerpc/mm/fault.c
42495 +++ linux-2.6.24.7/arch/powerpc/mm/fault.c
42496 @@ -167,10 +167,8 @@ int __kprobes do_page_fault(struct pt_re
42497         if (notify_page_fault(regs))
42498                 return 0;
42499  
42500 -       if (trap == 0x300) {
42501 -               if (debugger_fault_handler(regs))
42502 -                       return 0;
42503 -       }
42504 +       if (unlikely(debugger_fault_handler(regs)))
42505 +               return 0;
42506  
42507         /* On a kernel SLB miss we can only check for a valid exception entry */
42508         if (!user_mode(regs) && (address >= TASK_SIZE))
42509 @@ -189,7 +187,7 @@ int __kprobes do_page_fault(struct pt_re
42510                         return SIGSEGV;
42511                 /* in_atomic() in user mode is really bad,
42512                    as is current->mm == NULL. */
42513 -               printk(KERN_EMERG "Page fault in user mode with"
42514 +               printk(KERN_EMERG "Page fault in user mode with "
42515                        "in_atomic() = %d mm = %p\n", in_atomic(), mm);
42516                 printk(KERN_EMERG "NIP = %lx  MSR = %lx\n",
42517                        regs->nip, regs->msr);
42518 Index: linux-2.6.24.7/arch/powerpc/mm/fsl_booke_mmu.c
42519 ===================================================================
42520 --- linux-2.6.24.7.orig/arch/powerpc/mm/fsl_booke_mmu.c
42521 +++ linux-2.6.24.7/arch/powerpc/mm/fsl_booke_mmu.c
42522 @@ -165,15 +165,15 @@ void invalidate_tlbcam_entry(int index)
42523  void __init cam_mapin_ram(unsigned long cam0, unsigned long cam1,
42524                 unsigned long cam2)
42525  {
42526 -       settlbcam(0, KERNELBASE, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
42527 +       settlbcam(0, PAGE_OFFSET, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
42528         tlbcam_index++;
42529         if (cam1) {
42530                 tlbcam_index++;
42531 -               settlbcam(1, KERNELBASE+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
42532 +               settlbcam(1, PAGE_OFFSET+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
42533         }
42534         if (cam2) {
42535                 tlbcam_index++;
42536 -               settlbcam(2, KERNELBASE+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
42537 +               settlbcam(2, PAGE_OFFSET+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
42538         }
42539  }
42540  
42541 Index: linux-2.6.24.7/arch/powerpc/mm/hash_utils_64.c
42542 ===================================================================
42543 --- linux-2.6.24.7.orig/arch/powerpc/mm/hash_utils_64.c
42544 +++ linux-2.6.24.7/arch/powerpc/mm/hash_utils_64.c
42545 @@ -96,6 +96,7 @@ int mmu_vmalloc_psize = MMU_PAGE_4K;
42546  int mmu_io_psize = MMU_PAGE_4K;
42547  int mmu_kernel_ssize = MMU_SEGSIZE_256M;
42548  int mmu_highuser_ssize = MMU_SEGSIZE_256M;
42549 +u16 mmu_slb_size = 64;
42550  #ifdef CONFIG_HUGETLB_PAGE
42551  int mmu_huge_psize = MMU_PAGE_16M;
42552  unsigned int HPAGE_SHIFT;
42553 @@ -368,18 +369,11 @@ static void __init htab_init_page_sizes(
42554          * on what is available
42555          */
42556         if (mmu_psize_defs[MMU_PAGE_16M].shift)
42557 -               mmu_huge_psize = MMU_PAGE_16M;
42558 +               set_huge_psize(MMU_PAGE_16M);
42559         /* With 4k/4level pagetables, we can't (for now) cope with a
42560          * huge page size < PMD_SIZE */
42561         else if (mmu_psize_defs[MMU_PAGE_1M].shift)
42562 -               mmu_huge_psize = MMU_PAGE_1M;
42563 -
42564 -       /* Calculate HPAGE_SHIFT and sanity check it */
42565 -       if (mmu_psize_defs[mmu_huge_psize].shift > MIN_HUGEPTE_SHIFT &&
42566 -           mmu_psize_defs[mmu_huge_psize].shift < SID_SHIFT)
42567 -               HPAGE_SHIFT = mmu_psize_defs[mmu_huge_psize].shift;
42568 -       else
42569 -               HPAGE_SHIFT = 0; /* No huge pages dude ! */
42570 +               set_huge_psize(MMU_PAGE_1M);
42571  #endif /* CONFIG_HUGETLB_PAGE */
42572  }
42573  
42574 Index: linux-2.6.24.7/arch/powerpc/mm/hugetlbpage.c
42575 ===================================================================
42576 --- linux-2.6.24.7.orig/arch/powerpc/mm/hugetlbpage.c
42577 +++ linux-2.6.24.7/arch/powerpc/mm/hugetlbpage.c
42578 @@ -24,18 +24,17 @@
42579  #include <asm/cputable.h>
42580  #include <asm/spu.h>
42581  
42582 +#define HPAGE_SHIFT_64K        16
42583 +#define HPAGE_SHIFT_16M        24
42584 +
42585  #define NUM_LOW_AREAS  (0x100000000UL >> SID_SHIFT)
42586  #define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT)
42587  
42588 -#ifdef CONFIG_PPC_64K_PAGES
42589 -#define HUGEPTE_INDEX_SIZE     (PMD_SHIFT-HPAGE_SHIFT)
42590 -#else
42591 -#define HUGEPTE_INDEX_SIZE     (PUD_SHIFT-HPAGE_SHIFT)
42592 -#endif
42593 -#define PTRS_PER_HUGEPTE       (1 << HUGEPTE_INDEX_SIZE)
42594 -#define HUGEPTE_TABLE_SIZE     (sizeof(pte_t) << HUGEPTE_INDEX_SIZE)
42595 +unsigned int hugepte_shift;
42596 +#define PTRS_PER_HUGEPTE       (1 << hugepte_shift)
42597 +#define HUGEPTE_TABLE_SIZE     (sizeof(pte_t) << hugepte_shift)
42598  
42599 -#define HUGEPD_SHIFT           (HPAGE_SHIFT + HUGEPTE_INDEX_SIZE)
42600 +#define HUGEPD_SHIFT           (HPAGE_SHIFT + hugepte_shift)
42601  #define HUGEPD_SIZE            (1UL << HUGEPD_SHIFT)
42602  #define HUGEPD_MASK            (~(HUGEPD_SIZE-1))
42603  
42604 @@ -82,11 +81,35 @@ static int __hugepte_alloc(struct mm_str
42605         return 0;
42606  }
42607  
42608 +/* Base page size affects how we walk hugetlb page tables */
42609 +#ifdef CONFIG_PPC_64K_PAGES
42610 +#define hpmd_offset(pud, addr)         pmd_offset(pud, addr)
42611 +#define hpmd_alloc(mm, pud, addr)      pmd_alloc(mm, pud, addr)
42612 +#else
42613 +static inline
42614 +pmd_t *hpmd_offset(pud_t *pud, unsigned long addr)
42615 +{
42616 +       if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
42617 +               return pmd_offset(pud, addr);
42618 +       else
42619 +               return (pmd_t *) pud;
42620 +}
42621 +static inline
42622 +pmd_t *hpmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long addr)
42623 +{
42624 +       if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
42625 +               return pmd_alloc(mm, pud, addr);
42626 +       else
42627 +               return (pmd_t *) pud;
42628 +}
42629 +#endif
42630 +
42631  /* Modelled after find_linux_pte() */
42632  pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
42633  {
42634         pgd_t *pg;
42635         pud_t *pu;
42636 +       pmd_t *pm;
42637  
42638         BUG_ON(get_slice_psize(mm, addr) != mmu_huge_psize);
42639  
42640 @@ -96,14 +119,9 @@ pte_t *huge_pte_offset(struct mm_struct 
42641         if (!pgd_none(*pg)) {
42642                 pu = pud_offset(pg, addr);
42643                 if (!pud_none(*pu)) {
42644 -#ifdef CONFIG_PPC_64K_PAGES
42645 -                       pmd_t *pm;
42646 -                       pm = pmd_offset(pu, addr);
42647 +                       pm = hpmd_offset(pu, addr);
42648                         if (!pmd_none(*pm))
42649                                 return hugepte_offset((hugepd_t *)pm, addr);
42650 -#else
42651 -                       return hugepte_offset((hugepd_t *)pu, addr);
42652 -#endif
42653                 }
42654         }
42655  
42656 @@ -114,6 +132,7 @@ pte_t *huge_pte_alloc(struct mm_struct *
42657  {
42658         pgd_t *pg;
42659         pud_t *pu;
42660 +       pmd_t *pm;
42661         hugepd_t *hpdp = NULL;
42662  
42663         BUG_ON(get_slice_psize(mm, addr) != mmu_huge_psize);
42664 @@ -124,14 +143,9 @@ pte_t *huge_pte_alloc(struct mm_struct *
42665         pu = pud_alloc(mm, pg, addr);
42666  
42667         if (pu) {
42668 -#ifdef CONFIG_PPC_64K_PAGES
42669 -               pmd_t *pm;
42670 -               pm = pmd_alloc(mm, pu, addr);
42671 +               pm = hpmd_alloc(mm, pu, addr);
42672                 if (pm)
42673                         hpdp = (hugepd_t *)pm;
42674 -#else
42675 -               hpdp = (hugepd_t *)pu;
42676 -#endif
42677         }
42678  
42679         if (! hpdp)
42680 @@ -158,7 +172,6 @@ static void free_hugepte_range(struct mm
42681                                                  PGF_CACHENUM_MASK));
42682  }
42683  
42684 -#ifdef CONFIG_PPC_64K_PAGES
42685  static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
42686                                    unsigned long addr, unsigned long end,
42687                                    unsigned long floor, unsigned long ceiling)
42688 @@ -191,7 +204,6 @@ static void hugetlb_free_pmd_range(struc
42689         pud_clear(pud);
42690         pmd_free_tlb(tlb, pmd);
42691  }
42692 -#endif
42693  
42694  static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
42695                                    unsigned long addr, unsigned long end,
42696 @@ -210,9 +222,15 @@ static void hugetlb_free_pud_range(struc
42697                         continue;
42698                 hugetlb_free_pmd_range(tlb, pud, addr, next, floor, ceiling);
42699  #else
42700 -               if (pud_none(*pud))
42701 -                       continue;
42702 -               free_hugepte_range(tlb, (hugepd_t *)pud);
42703 +               if (HPAGE_SHIFT == HPAGE_SHIFT_64K) {
42704 +                       if (pud_none_or_clear_bad(pud))
42705 +                               continue;
42706 +                       hugetlb_free_pmd_range(tlb, pud, addr, next, floor, ceiling);
42707 +               } else {
42708 +                       if (pud_none(*pud))
42709 +                               continue;
42710 +                       free_hugepte_range(tlb, (hugepd_t *)pud);
42711 +               }
42712  #endif
42713         } while (pud++, addr = next, addr != end);
42714  
42715 @@ -526,6 +544,57 @@ repeat:
42716         return err;
42717  }
42718  
42719 +void set_huge_psize(int psize)
42720 +{
42721 +       /* Check that it is a page size supported by the hardware and
42722 +        * that it fits within pagetable limits. */
42723 +       if (mmu_psize_defs[psize].shift && mmu_psize_defs[psize].shift < SID_SHIFT &&
42724 +               (mmu_psize_defs[psize].shift > MIN_HUGEPTE_SHIFT ||
42725 +                       mmu_psize_defs[psize].shift == HPAGE_SHIFT_64K)) {
42726 +               HPAGE_SHIFT = mmu_psize_defs[psize].shift;
42727 +               mmu_huge_psize = psize;
42728 +#ifdef CONFIG_PPC_64K_PAGES
42729 +               hugepte_shift = (PMD_SHIFT-HPAGE_SHIFT);
42730 +#else
42731 +               if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
42732 +                       hugepte_shift = (PMD_SHIFT-HPAGE_SHIFT);
42733 +               else
42734 +                       hugepte_shift = (PUD_SHIFT-HPAGE_SHIFT);
42735 +#endif
42736 +
42737 +       } else
42738 +               HPAGE_SHIFT = 0;
42739 +}
42740 +
42741 +static int __init hugepage_setup_sz(char *str)
42742 +{
42743 +       unsigned long long size;
42744 +       int mmu_psize = -1;
42745 +       int shift;
42746 +
42747 +       size = memparse(str, &str);
42748 +
42749 +       shift = __ffs(size);
42750 +       switch (shift) {
42751 +#ifndef CONFIG_PPC_64K_PAGES
42752 +       case HPAGE_SHIFT_64K:
42753 +               mmu_psize = MMU_PAGE_64K;
42754 +               break;
42755 +#endif
42756 +       case HPAGE_SHIFT_16M:
42757 +               mmu_psize = MMU_PAGE_16M;
42758 +               break;
42759 +       }
42760 +
42761 +       if (mmu_psize >=0 && mmu_psize_defs[mmu_psize].shift)
42762 +               set_huge_psize(mmu_psize);
42763 +       else
42764 +               printk(KERN_WARNING "Invalid huge page size specified(%llu)\n", size);
42765 +
42766 +       return 1;
42767 +}
42768 +__setup("hugepagesz=", hugepage_setup_sz);
42769 +
42770  static void zero_ctor(struct kmem_cache *cache, void *addr)
42771  {
42772         memset(addr, 0, kmem_cache_size(cache));
42773 Index: linux-2.6.24.7/arch/powerpc/mm/lmb.c
42774 ===================================================================
42775 --- linux-2.6.24.7.orig/arch/powerpc/mm/lmb.c
42776 +++ linux-2.6.24.7/arch/powerpc/mm/lmb.c
42777 @@ -342,3 +342,16 @@ void __init lmb_enforce_memory_limit(uns
42778                 }
42779         }
42780  }
42781 +
42782 +int __init lmb_is_reserved(unsigned long addr)
42783 +{
42784 +       int i;
42785 +
42786 +       for (i = 0; i < lmb.reserved.cnt; i++) {
42787 +               unsigned long upper = lmb.reserved.region[i].base +
42788 +                                     lmb.reserved.region[i].size - 1;
42789 +               if ((addr >= lmb.reserved.region[i].base) && (addr <= upper))
42790 +                       return 1;
42791 +       }
42792 +       return 0;
42793 +}
42794 Index: linux-2.6.24.7/arch/powerpc/mm/mem.c
42795 ===================================================================
42796 --- linux-2.6.24.7.orig/arch/powerpc/mm/mem.c
42797 +++ linux-2.6.24.7/arch/powerpc/mm/mem.c
42798 @@ -213,15 +213,30 @@ void __init do_init_bootmem(void)
42799          */
42800  #ifdef CONFIG_HIGHMEM
42801         free_bootmem_with_active_regions(0, total_lowmem >> PAGE_SHIFT);
42802 +
42803 +       /* reserve the sections we're already using */
42804 +       for (i = 0; i < lmb.reserved.cnt; i++) {
42805 +               unsigned long addr = lmb.reserved.region[i].base +
42806 +                                    lmb_size_bytes(&lmb.reserved, i) - 1;
42807 +               if (addr < total_lowmem)
42808 +                       reserve_bootmem(lmb.reserved.region[i].base,
42809 +                                       lmb_size_bytes(&lmb.reserved, i));
42810 +               else if (lmb.reserved.region[i].base < total_lowmem) {
42811 +                       unsigned long adjusted_size = total_lowmem -
42812 +                                     lmb.reserved.region[i].base;
42813 +                       reserve_bootmem(lmb.reserved.region[i].base,
42814 +                                       adjusted_size);
42815 +               }
42816 +       }
42817  #else
42818         free_bootmem_with_active_regions(0, max_pfn);
42819 -#endif
42820  
42821         /* reserve the sections we're already using */
42822         for (i = 0; i < lmb.reserved.cnt; i++)
42823                 reserve_bootmem(lmb.reserved.region[i].base,
42824                                 lmb_size_bytes(&lmb.reserved, i));
42825  
42826 +#endif
42827         /* XXX need to clip this if using highmem? */
42828         sparse_memory_present_with_active_regions(0);
42829  
42830 @@ -334,11 +349,13 @@ void __init mem_init(void)
42831                 highmem_mapnr = total_lowmem >> PAGE_SHIFT;
42832                 for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) {
42833                         struct page *page = pfn_to_page(pfn);
42834 -
42835 +                       if (lmb_is_reserved(pfn << PAGE_SHIFT))
42836 +                               continue;
42837                         ClearPageReserved(page);
42838                         init_page_count(page);
42839                         __free_page(page);
42840                         totalhigh_pages++;
42841 +                       reservedpages--;
42842                 }
42843                 totalram_pages += totalhigh_pages;
42844                 printk(KERN_DEBUG "High memory: %luk\n",
42845 Index: linux-2.6.24.7/arch/powerpc/mm/slb.c
42846 ===================================================================
42847 --- linux-2.6.24.7.orig/arch/powerpc/mm/slb.c
42848 +++ linux-2.6.24.7/arch/powerpc/mm/slb.c
42849 @@ -256,6 +256,7 @@ void slb_initialize(void)
42850         static int slb_encoding_inited;
42851         extern unsigned int *slb_miss_kernel_load_linear;
42852         extern unsigned int *slb_miss_kernel_load_io;
42853 +       extern unsigned int *slb_compare_rr_to_size;
42854  
42855         /* Prepare our SLB miss handler based on our page size */
42856         linear_llp = mmu_psize_defs[mmu_linear_psize].sllp;
42857 @@ -269,6 +270,8 @@ void slb_initialize(void)
42858                                    SLB_VSID_KERNEL | linear_llp);
42859                 patch_slb_encoding(slb_miss_kernel_load_io,
42860                                    SLB_VSID_KERNEL | io_llp);
42861 +               patch_slb_encoding(slb_compare_rr_to_size,
42862 +                                  mmu_slb_size);
42863  
42864                 DBG("SLB: linear  LLP = %04x\n", linear_llp);
42865                 DBG("SLB: io      LLP = %04x\n", io_llp);
42866 Index: linux-2.6.24.7/arch/powerpc/mm/slb_low.S
42867 ===================================================================
42868 --- linux-2.6.24.7.orig/arch/powerpc/mm/slb_low.S
42869 +++ linux-2.6.24.7/arch/powerpc/mm/slb_low.S
42870 @@ -227,8 +227,9 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISER
42871  
42872  7:     ld      r10,PACASTABRR(r13)
42873         addi    r10,r10,1
42874 -       /* use a cpu feature mask if we ever change our slb size */
42875 -       cmpldi  r10,SLB_NUM_ENTRIES
42876 +       /* This gets soft patched on boot. */
42877 +_GLOBAL(slb_compare_rr_to_size)
42878 +       cmpldi  r10,0
42879  
42880         blt+    4f
42881         li      r10,SLB_NUM_BOLTED
42882 Index: linux-2.6.24.7/arch/powerpc/oprofile/op_model_cell.c
42883 ===================================================================
42884 --- linux-2.6.24.7.orig/arch/powerpc/oprofile/op_model_cell.c
42885 +++ linux-2.6.24.7/arch/powerpc/oprofile/op_model_cell.c
42886 @@ -61,7 +61,7 @@ static unsigned int spu_cycle_reset;
42887  #define NUM_THREADS 2         /* number of physical threads in
42888                                * physical processor
42889                                */
42890 -#define NUM_TRACE_BUS_WORDS 4
42891 +#define NUM_DEBUG_BUS_WORDS 4
42892  #define NUM_INPUT_BUS_WORDS 2
42893  
42894  #define MAX_SPU_COUNT 0xFFFFFF /* maximum 24 bit LFSR value */
42895 @@ -169,7 +169,6 @@ static DEFINE_SPINLOCK(virt_cntr_lock);
42896  
42897  static u32 ctr_enabled;
42898  
42899 -static unsigned char trace_bus[NUM_TRACE_BUS_WORDS];
42900  static unsigned char input_bus[NUM_INPUT_BUS_WORDS];
42901  
42902  /*
42903 @@ -298,7 +297,7 @@ static void set_pm_event(u32 ctr, int ev
42904  
42905         p->signal_group = event / 100;
42906         p->bus_word = bus_word;
42907 -       p->sub_unit = (unit_mask & 0x0000f000) >> 12;
42908 +       p->sub_unit = GET_SUB_UNIT(unit_mask);
42909  
42910         pm_regs.pm07_cntrl[ctr] = 0;
42911         pm_regs.pm07_cntrl[ctr] |= PM07_CTR_COUNT_CYCLES(count_cycles);
42912 @@ -334,16 +333,16 @@ static void set_pm_event(u32 ctr, int ev
42913                 p->bit = signal_bit;
42914         }
42915  
42916 -       for (i = 0; i < NUM_TRACE_BUS_WORDS; i++) {
42917 +       for (i = 0; i < NUM_DEBUG_BUS_WORDS; i++) {
42918                 if (bus_word & (1 << i)) {
42919                         pm_regs.debug_bus_control |=
42920 -                           (bus_type << (31 - (2 * i) + 1));
42921 +                           (bus_type << (30 - (2 * i)));
42922  
42923                         for (j = 0; j < NUM_INPUT_BUS_WORDS; j++) {
42924                                 if (input_bus[j] == 0xff) {
42925                                         input_bus[j] = i;
42926                                         pm_regs.group_control |=
42927 -                                           (i << (31 - i));
42928 +                                           (i << (30 - (2 * j)));
42929  
42930                                         break;
42931                                 }
42932 @@ -450,6 +449,12 @@ static void cell_virtual_cntr(unsigned l
42933         hdw_thread = 1 ^ hdw_thread;
42934         next_hdw_thread = hdw_thread;
42935  
42936 +       pm_regs.group_control = 0;
42937 +       pm_regs.debug_bus_control = 0;
42938 +
42939 +       for (i = 0; i < NUM_INPUT_BUS_WORDS; i++)
42940 +               input_bus[i] = 0xff;
42941 +
42942         /*
42943          * There are some per thread events.  Must do the
42944          * set event, for the thread that is being started
42945 @@ -619,9 +624,6 @@ static int cell_reg_setup(struct op_coun
42946                 pmc_cntrl[1][i].vcntr = i;
42947         }
42948  
42949 -       for (i = 0; i < NUM_TRACE_BUS_WORDS; i++)
42950 -               trace_bus[i] = 0xff;
42951 -
42952         for (i = 0; i < NUM_INPUT_BUS_WORDS; i++)
42953                 input_bus[i] = 0xff;
42954  
42955 Index: linux-2.6.24.7/arch/powerpc/platforms/40x/Kconfig
42956 ===================================================================
42957 --- linux-2.6.24.7.orig/arch/powerpc/platforms/40x/Kconfig
42958 +++ linux-2.6.24.7/arch/powerpc/platforms/40x/Kconfig
42959 @@ -14,28 +14,34 @@
42960  #      help
42961  #        This option enables support for the CPCI405 board.
42962  
42963 -#config EP405
42964 -#      bool "EP405/EP405PC"
42965 -#      depends on 40x
42966 -#      default n
42967 -#      select 405GP
42968 -#      help
42969 -#        This option enables support for the EP405/EP405PC boards.
42970 -
42971 -#config EP405PC
42972 -#      bool "EP405PC Support"
42973 -#      depends on EP405
42974 -#      default y
42975 -#      help
42976 -#        This option enables support for the extra features of the EP405PC board.
42977 +config EP405
42978 +       bool "EP405/EP405PC"
42979 +       depends on 40x
42980 +       default n
42981 +       select 405GP
42982 +       select PCI
42983 +       help
42984 +         This option enables support for the EP405/EP405PC boards.
42985  
42986  config KILAUEA
42987         bool "Kilauea"
42988         depends on 40x
42989         default n
42990 +       select 405EX
42991 +       select PPC4xx_PCI_EXPRESS
42992         help
42993           This option enables support for the AMCC PPC405EX evaluation board.
42994  
42995 +config MAKALU
42996 +       bool "Makalu"
42997 +       depends on 40x
42998 +       default n
42999 +       select 405EX
43000 +       select PCI
43001 +       select PPC4xx_PCI_EXPRESS
43002 +       help
43003 +         This option enables support for the AMCC PPC405EX board.
43004 +
43005  #config REDWOOD_5
43006  #      bool "Redwood-5"
43007  #      depends on 40x
43008 @@ -65,6 +71,7 @@ config WALNUT
43009         depends on 40x
43010         default y
43011         select 405GP
43012 +       select PCI
43013         help
43014           This option enables support for the IBM PPC405GP evaluation board.
43015  
43016 @@ -105,6 +112,11 @@ config 405GP
43017  config 405EP
43018         bool
43019  
43020 +config 405EX
43021 +       bool
43022 +       select IBM_NEW_EMAC_EMAC4
43023 +       select IBM_NEW_EMAC_RGMII
43024 +
43025  config 405GPR
43026         bool
43027  
43028 Index: linux-2.6.24.7/arch/powerpc/platforms/40x/Makefile
43029 ===================================================================
43030 --- linux-2.6.24.7.orig/arch/powerpc/platforms/40x/Makefile
43031 +++ linux-2.6.24.7/arch/powerpc/platforms/40x/Makefile
43032 @@ -1,3 +1,5 @@
43033  obj-$(CONFIG_KILAUEA)                          += kilauea.o
43034 +obj-$(CONFIG_MAKALU)                           += makalu.o
43035  obj-$(CONFIG_WALNUT)                           += walnut.o
43036  obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD)      += virtex.o
43037 +obj-$(CONFIG_EP405)                            += ep405.o
43038 Index: linux-2.6.24.7/arch/powerpc/platforms/40x/ep405.c
43039 ===================================================================
43040 --- /dev/null
43041 +++ linux-2.6.24.7/arch/powerpc/platforms/40x/ep405.c
43042 @@ -0,0 +1,123 @@
43043 +/*
43044 + * Architecture- / platform-specific boot-time initialization code for
43045 + * IBM PowerPC 4xx based boards. Adapted from original
43046 + * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
43047 + * <dan@net4x.com>.
43048 + *
43049 + * Copyright(c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
43050 + *
43051 + * Rewritten and ported to the merged powerpc tree:
43052 + * Copyright 2007 IBM Corporation
43053 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
43054 + *
43055 + * Adapted to EP405 by Ben. Herrenschmidt <benh@kernel.crashing.org>
43056 + *
43057 + * TODO: Wire up the PCI IRQ mux and the southbridge interrupts
43058 + *
43059 + * 2002 (c) MontaVista, Software, Inc.  This file is licensed under
43060 + * the terms of the GNU General Public License version 2.  This program
43061 + * is licensed "as is" without any warranty of any kind, whether express
43062 + * or implied.
43063 + */
43064 +
43065 +#include <linux/init.h>
43066 +#include <linux/of_platform.h>
43067 +
43068 +#include <asm/machdep.h>
43069 +#include <asm/prom.h>
43070 +#include <asm/udbg.h>
43071 +#include <asm/time.h>
43072 +#include <asm/uic.h>
43073 +#include <asm/pci-bridge.h>
43074 +
43075 +static struct device_node *bcsr_node;
43076 +static void __iomem *bcsr_regs;
43077 +
43078 +/* BCSR registers  */
43079 +#define BCSR_ID                        0
43080 +#define BCSR_PCI_CTRL          1
43081 +#define BCSR_FLASH_NV_POR_CTRL 2
43082 +#define BCSR_FENET_UART_CTRL   3
43083 +#define BCSR_PCI_IRQ           4
43084 +#define BCSR_XIRQ_SELECT       5
43085 +#define BCSR_XIRQ_ROUTING      6
43086 +#define BCSR_XIRQ_STATUS       7
43087 +#define BCSR_XIRQ_STATUS2      8
43088 +#define BCSR_SW_STAT_LED_CTRL  9
43089 +#define BCSR_GPIO_IRQ_PAR_CTRL 10
43090 +/* there's more, can't be bothered typing them tho */
43091 +
43092 +
43093 +static __initdata struct of_device_id ep405_of_bus[] = {
43094 +       { .compatible = "ibm,plb3", },
43095 +       { .compatible = "ibm,opb", },
43096 +       { .compatible = "ibm,ebc", },
43097 +       {},
43098 +};
43099 +
43100 +static int __init ep405_device_probe(void)
43101 +{
43102 +       of_platform_bus_probe(NULL, ep405_of_bus, NULL);
43103 +
43104 +       return 0;
43105 +}
43106 +machine_device_initcall(ep405, ep405_device_probe);
43107 +
43108 +static void __init ep405_init_bcsr(void)
43109 +{
43110 +       const u8 *irq_routing;
43111 +       int i;
43112 +
43113 +       /* Find the bloody thing & map it */
43114 +       bcsr_node = of_find_compatible_node(NULL, NULL, "ep405-bcsr");
43115 +       if (bcsr_node == NULL) {
43116 +               printk(KERN_ERR "EP405 BCSR not found !\n");
43117 +               return;
43118 +       }
43119 +       bcsr_regs = of_iomap(bcsr_node, 0);
43120 +       if (bcsr_regs == NULL) {
43121 +               printk(KERN_ERR "EP405 BCSR failed to map !\n");
43122 +               return;
43123 +       }
43124 +
43125 +       /* Get the irq-routing property and apply the routing to the CPLD */
43126 +       irq_routing = of_get_property(bcsr_node, "irq-routing", NULL);
43127 +       if (irq_routing == NULL)
43128 +               return;
43129 +       for (i = 0; i < 16; i++) {
43130 +               u8 irq = irq_routing[i];
43131 +               out_8(bcsr_regs + BCSR_XIRQ_SELECT, i);
43132 +               out_8(bcsr_regs + BCSR_XIRQ_ROUTING, irq);
43133 +       }
43134 +       in_8(bcsr_regs + BCSR_XIRQ_SELECT);
43135 +       mb();
43136 +       out_8(bcsr_regs + BCSR_GPIO_IRQ_PAR_CTRL, 0xfe);
43137 +}
43138 +
43139 +static void __init ep405_setup_arch(void)
43140 +{
43141 +       /* Find & init the BCSR CPLD */
43142 +       ep405_init_bcsr();
43143 +
43144 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43145 +}
43146 +
43147 +static int __init ep405_probe(void)
43148 +{
43149 +       unsigned long root = of_get_flat_dt_root();
43150 +
43151 +       if (!of_flat_dt_is_compatible(root, "ep405"))
43152 +               return 0;
43153 +
43154 +       return 1;
43155 +}
43156 +
43157 +define_machine(ep405) {
43158 +       .name                   = "EP405",
43159 +       .probe                  = ep405_probe,
43160 +       .setup_arch             = ep405_setup_arch,
43161 +       .progress               = udbg_progress,
43162 +       .init_IRQ               = uic_init_tree,
43163 +       .get_irq                = uic_get_irq,
43164 +       .calibrate_decr         = generic_calibrate_decr,
43165 +};
43166 Index: linux-2.6.24.7/arch/powerpc/platforms/40x/kilauea.c
43167 ===================================================================
43168 --- linux-2.6.24.7.orig/arch/powerpc/platforms/40x/kilauea.c
43169 +++ linux-2.6.24.7/arch/powerpc/platforms/40x/kilauea.c
43170 @@ -19,8 +19,9 @@
43171  #include <asm/udbg.h>
43172  #include <asm/time.h>
43173  #include <asm/uic.h>
43174 +#include <asm/pci-bridge.h>
43175  
43176 -static struct of_device_id kilauea_of_bus[] = {
43177 +static __initdata struct of_device_id kilauea_of_bus[] = {
43178         { .compatible = "ibm,plb4", },
43179         { .compatible = "ibm,opb", },
43180         { .compatible = "ibm,ebc", },
43181 @@ -29,14 +30,11 @@ static struct of_device_id kilauea_of_bu
43182  
43183  static int __init kilauea_device_probe(void)
43184  {
43185 -       if (!machine_is(kilauea))
43186 -               return 0;
43187 -
43188         of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
43189  
43190         return 0;
43191  }
43192 -device_initcall(kilauea_device_probe);
43193 +machine_device_initcall(kilauea, kilauea_device_probe);
43194  
43195  static int __init kilauea_probe(void)
43196  {
43197 @@ -45,6 +43,8 @@ static int __init kilauea_probe(void)
43198         if (!of_flat_dt_is_compatible(root, "amcc,kilauea"))
43199                 return 0;
43200  
43201 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43202 +
43203         return 1;
43204  }
43205  
43206 Index: linux-2.6.24.7/arch/powerpc/platforms/40x/makalu.c
43207 ===================================================================
43208 --- /dev/null
43209 +++ linux-2.6.24.7/arch/powerpc/platforms/40x/makalu.c
43210 @@ -0,0 +1,58 @@
43211 +/*
43212 + * Makalu board specific routines
43213 + *
43214 + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
43215 + *
43216 + * Based on the Walnut code by
43217 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
43218 + * Copyright 2007 IBM Corporation
43219 + *
43220 + * This program is free software; you can redistribute  it and/or modify it
43221 + * under  the terms of  the GNU General  Public License as published by the
43222 + * Free Software Foundation;  either version 2 of the  License, or (at your
43223 + * option) any later version.
43224 + */
43225 +#include <linux/init.h>
43226 +#include <linux/of_platform.h>
43227 +#include <asm/machdep.h>
43228 +#include <asm/prom.h>
43229 +#include <asm/udbg.h>
43230 +#include <asm/time.h>
43231 +#include <asm/uic.h>
43232 +#include <asm/pci-bridge.h>
43233 +
43234 +static __initdata struct of_device_id makalu_of_bus[] = {
43235 +       { .compatible = "ibm,plb4", },
43236 +       { .compatible = "ibm,opb", },
43237 +       { .compatible = "ibm,ebc", },
43238 +       {},
43239 +};
43240 +
43241 +static int __init makalu_device_probe(void)
43242 +{
43243 +       of_platform_bus_probe(NULL, makalu_of_bus, NULL);
43244 +
43245 +       return 0;
43246 +}
43247 +machine_device_initcall(makalu, makalu_device_probe);
43248 +
43249 +static int __init makalu_probe(void)
43250 +{
43251 +       unsigned long root = of_get_flat_dt_root();
43252 +
43253 +       if (!of_flat_dt_is_compatible(root, "amcc,makalu"))
43254 +               return 0;
43255 +
43256 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43257 +
43258 +       return 1;
43259 +}
43260 +
43261 +define_machine(makalu) {
43262 +       .name                           = "Makalu",
43263 +       .probe                          = makalu_probe,
43264 +       .progress                       = udbg_progress,
43265 +       .init_IRQ                       = uic_init_tree,
43266 +       .get_irq                        = uic_get_irq,
43267 +       .calibrate_decr                 = generic_calibrate_decr,
43268 +};
43269 Index: linux-2.6.24.7/arch/powerpc/platforms/40x/virtex.c
43270 ===================================================================
43271 --- linux-2.6.24.7.orig/arch/powerpc/platforms/40x/virtex.c
43272 +++ linux-2.6.24.7/arch/powerpc/platforms/40x/virtex.c
43273 @@ -15,16 +15,23 @@
43274  #include <asm/time.h>
43275  #include <asm/xilinx_intc.h>
43276  
43277 +static struct of_device_id xilinx_of_bus_ids[] __initdata = {
43278 +       { .compatible = "xlnx,plb-v46-1.00.a", },
43279 +       { .compatible = "xlnx,plb-v34-1.01.a", },
43280 +       { .compatible = "xlnx,plb-v34-1.02.a", },
43281 +       { .compatible = "xlnx,opb-v20-1.10.c", },
43282 +       { .compatible = "xlnx,dcr-v29-1.00.a", },
43283 +       { .compatible = "xlnx,compound", },
43284 +       {}
43285 +};
43286 +
43287  static int __init virtex_device_probe(void)
43288  {
43289 -       if (!machine_is(virtex))
43290 -               return 0;
43291 -
43292 -       of_platform_bus_probe(NULL, NULL, NULL);
43293 +       of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
43294  
43295         return 0;
43296  }
43297 -device_initcall(virtex_device_probe);
43298 +machine_device_initcall(virtex, virtex_device_probe);
43299  
43300  static int __init virtex_probe(void)
43301  {
43302 Index: linux-2.6.24.7/arch/powerpc/platforms/40x/walnut.c
43303 ===================================================================
43304 --- linux-2.6.24.7.orig/arch/powerpc/platforms/40x/walnut.c
43305 +++ linux-2.6.24.7/arch/powerpc/platforms/40x/walnut.c
43306 @@ -24,8 +24,9 @@
43307  #include <asm/udbg.h>
43308  #include <asm/time.h>
43309  #include <asm/uic.h>
43310 +#include <asm/pci-bridge.h>
43311  
43312 -static struct of_device_id walnut_of_bus[] = {
43313 +static __initdata struct of_device_id walnut_of_bus[] = {
43314         { .compatible = "ibm,plb3", },
43315         { .compatible = "ibm,opb", },
43316         { .compatible = "ibm,ebc", },
43317 @@ -34,15 +35,12 @@ static struct of_device_id walnut_of_bus
43318  
43319  static int __init walnut_device_probe(void)
43320  {
43321 -       if (!machine_is(walnut))
43322 -               return 0;
43323 -
43324 -       /* FIXME: do bus probe here */
43325         of_platform_bus_probe(NULL, walnut_of_bus, NULL);
43326 +       of_instantiate_rtc();
43327  
43328         return 0;
43329  }
43330 -device_initcall(walnut_device_probe);
43331 +machine_device_initcall(walnut, walnut_device_probe);
43332  
43333  static int __init walnut_probe(void)
43334  {
43335 @@ -51,6 +49,8 @@ static int __init walnut_probe(void)
43336         if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
43337                 return 0;
43338  
43339 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43340 +
43341         return 1;
43342  }
43343  
43344 Index: linux-2.6.24.7/arch/powerpc/platforms/44x/Kconfig
43345 ===================================================================
43346 --- linux-2.6.24.7.orig/arch/powerpc/platforms/44x/Kconfig
43347 +++ linux-2.6.24.7/arch/powerpc/platforms/44x/Kconfig
43348 @@ -3,6 +3,7 @@ config BAMBOO
43349         depends on 44x
43350         default n
43351         select 440EP
43352 +       select PCI
43353         help
43354           This option enables support for the IBM PPC440EP evaluation board.
43355  
43356 @@ -11,6 +12,8 @@ config EBONY
43357         depends on 44x
43358         default y
43359         select 440GP
43360 +       select PCI
43361 +       select OF_RTC
43362         help
43363           This option enables support for the IBM PPC440GP evaluation board.
43364  
43365 @@ -22,6 +25,48 @@ config SEQUOIA
43366         help
43367           This option enables support for the AMCC PPC440EPX evaluation board.
43368  
43369 +config TAISHAN
43370 +       bool "Taishan"
43371 +       depends on 44x
43372 +       default n
43373 +       select 440GX
43374 +       select PCI
43375 +       help
43376 +         This option enables support for the AMCC PPC440GX "Taishan"
43377 +         evaluation board.
43378 +
43379 +config KATMAI
43380 +       bool "Katmai"
43381 +       depends on 44x
43382 +       default n
43383 +       select 440SPe
43384 +       select PCI
43385 +       select PPC4xx_PCI_EXPRESS
43386 +       help
43387 +         This option enables support for the AMCC PPC440SPe evaluation board.
43388 +
43389 +config RAINIER
43390 +       bool "Rainier"
43391 +       depends on 44x
43392 +       default n
43393 +       select 440GRX
43394 +       select PCI
43395 +       help
43396 +         This option enables support for the AMCC PPC440GRX evaluation board.
43397 +
43398 +config WARP
43399 +       bool "PIKA Warp"
43400 +       depends on 44x
43401 +       default n
43402 +       select 440EP
43403 +       help
43404 +         This option enables support for the PIKA Warp(tm) Appliance. The Warp
43405 +          is a small computer replacement with up to 9 ports of FXO/FXS plus VOIP
43406 +         stations and trunks.
43407 +
43408 +         See http://www.pikatechnologies.com/ and follow the "PIKA for Computer
43409 +         Telephony Developers" link for more information.
43410 +
43411  #config LUAN
43412  #      bool "Luan"
43413  #      depends on 44x
43414 @@ -44,6 +89,7 @@ config 440EP
43415         select PPC_FPU
43416         select IBM440EP_ERR42
43417         select IBM_NEW_EMAC_ZMII
43418 +       select USB_ARCH_HAS_OHCI
43419  
43420  config 440EPX
43421         bool
43422 @@ -52,20 +98,29 @@ config 440EPX
43423         select IBM_NEW_EMAC_RGMII
43424         select IBM_NEW_EMAC_ZMII
43425  
43426 +config 440GRX
43427 +       bool
43428 +       select IBM_NEW_EMAC_EMAC4
43429 +       select IBM_NEW_EMAC_RGMII
43430 +       select IBM_NEW_EMAC_ZMII
43431 +
43432  config 440GP
43433         bool
43434         select IBM_NEW_EMAC_ZMII
43435  
43436  config 440GX
43437         bool
43438 +        select IBM_NEW_EMAC_EMAC4
43439 +       select IBM_NEW_EMAC_RGMII
43440 +        select IBM_NEW_EMAC_ZMII #test only
43441 +        select IBM_NEW_EMAC_TAH  #test only
43442  
43443  config 440SP
43444         bool
43445  
43446 -config 440A
43447 +config 440SPe
43448 +        select IBM_NEW_EMAC_EMAC4
43449         bool
43450 -       depends on 440GX || 440EPX
43451 -       default y
43452  
43453  # 44x errata/workaround config symbols, selected by the CPU models above
43454  config IBM440EP_ERR42
43455 Index: linux-2.6.24.7/arch/powerpc/platforms/44x/Makefile
43456 ===================================================================
43457 --- linux-2.6.24.7.orig/arch/powerpc/platforms/44x/Makefile
43458 +++ linux-2.6.24.7/arch/powerpc/platforms/44x/Makefile
43459 @@ -1,4 +1,9 @@
43460  obj-$(CONFIG_44x)      := misc_44x.o
43461  obj-$(CONFIG_EBONY)    += ebony.o
43462 -obj-$(CONFIG_BAMBOO) += bamboo.o
43463 +obj-$(CONFIG_TAISHAN)  += taishan.o
43464 +obj-$(CONFIG_BAMBOO)   += bamboo.o
43465  obj-$(CONFIG_SEQUOIA)  += sequoia.o
43466 +obj-$(CONFIG_KATMAI)   += katmai.o
43467 +obj-$(CONFIG_RAINIER)  += rainier.o
43468 +obj-$(CONFIG_WARP)     += warp.o
43469 +obj-$(CONFIG_WARP)     += warp-nand.o
43470 Index: linux-2.6.24.7/arch/powerpc/platforms/44x/bamboo.c
43471 ===================================================================
43472 --- linux-2.6.24.7.orig/arch/powerpc/platforms/44x/bamboo.c
43473 +++ linux-2.6.24.7/arch/powerpc/platforms/44x/bamboo.c
43474 @@ -21,9 +21,11 @@
43475  #include <asm/udbg.h>
43476  #include <asm/time.h>
43477  #include <asm/uic.h>
43478 +#include <asm/pci-bridge.h>
43479 +
43480  #include "44x.h"
43481  
43482 -static struct of_device_id bamboo_of_bus[] = {
43483 +static __initdata struct of_device_id bamboo_of_bus[] = {
43484         { .compatible = "ibm,plb4", },
43485         { .compatible = "ibm,opb", },
43486         { .compatible = "ibm,ebc", },
43487 @@ -32,14 +34,11 @@ static struct of_device_id bamboo_of_bus
43488  
43489  static int __init bamboo_device_probe(void)
43490  {
43491 -       if (!machine_is(bamboo))
43492 -               return 0;
43493 -
43494         of_platform_bus_probe(NULL, bamboo_of_bus, NULL);
43495  
43496         return 0;
43497  }
43498 -device_initcall(bamboo_device_probe);
43499 +machine_device_initcall(bamboo, bamboo_device_probe);
43500  
43501  static int __init bamboo_probe(void)
43502  {
43503 @@ -48,6 +47,8 @@ static int __init bamboo_probe(void)
43504         if (!of_flat_dt_is_compatible(root, "amcc,bamboo"))
43505                 return 0;
43506  
43507 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43508 +
43509         return 1;
43510  }
43511  
43512 Index: linux-2.6.24.7/arch/powerpc/platforms/44x/ebony.c
43513 ===================================================================
43514 --- linux-2.6.24.7.orig/arch/powerpc/platforms/44x/ebony.c
43515 +++ linux-2.6.24.7/arch/powerpc/platforms/44x/ebony.c
43516 @@ -18,16 +18,18 @@
43517  
43518  #include <linux/init.h>
43519  #include <linux/of_platform.h>
43520 +#include <linux/rtc.h>
43521  
43522  #include <asm/machdep.h>
43523  #include <asm/prom.h>
43524  #include <asm/udbg.h>
43525  #include <asm/time.h>
43526  #include <asm/uic.h>
43527 +#include <asm/pci-bridge.h>
43528  
43529  #include "44x.h"
43530  
43531 -static struct of_device_id ebony_of_bus[] = {
43532 +static __initdata struct of_device_id ebony_of_bus[] = {
43533         { .compatible = "ibm,plb4", },
43534         { .compatible = "ibm,opb", },
43535         { .compatible = "ibm,ebc", },
43536 @@ -36,14 +38,12 @@ static struct of_device_id ebony_of_bus[
43537  
43538  static int __init ebony_device_probe(void)
43539  {
43540 -       if (!machine_is(ebony))
43541 -               return 0;
43542 -
43543         of_platform_bus_probe(NULL, ebony_of_bus, NULL);
43544 +       of_instantiate_rtc();
43545  
43546         return 0;
43547  }
43548 -device_initcall(ebony_device_probe);
43549 +machine_device_initcall(ebony, ebony_device_probe);
43550  
43551  /*
43552   * Called very early, MMU is off, device-tree isn't unflattened
43553 @@ -55,6 +55,8 @@ static int __init ebony_probe(void)
43554         if (!of_flat_dt_is_compatible(root, "ibm,ebony"))
43555                 return 0;
43556  
43557 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43558 +
43559         return 1;
43560  }
43561  
43562 Index: linux-2.6.24.7/arch/powerpc/platforms/44x/katmai.c
43563 ===================================================================
43564 --- /dev/null
43565 +++ linux-2.6.24.7/arch/powerpc/platforms/44x/katmai.c
43566 @@ -0,0 +1,63 @@
43567 +/*
43568 + * Katmai board specific routines
43569 + *
43570 + * Benjamin Herrenschmidt <benh@kernel.crashing.org>
43571 + * Copyright 2007 IBM Corp.
43572 + *
43573 + * Based on the Bamboo code by
43574 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
43575 + * Copyright 2007 IBM Corporation
43576 + *
43577 + * This program is free software; you can redistribute  it and/or modify it
43578 + * under  the terms of  the GNU General  Public License as published by the
43579 + * Free Software Foundation;  either version 2 of the  License, or (at your
43580 + * option) any later version.
43581 + */
43582 +#include <linux/init.h>
43583 +#include <linux/of_platform.h>
43584 +
43585 +#include <asm/machdep.h>
43586 +#include <asm/prom.h>
43587 +#include <asm/udbg.h>
43588 +#include <asm/time.h>
43589 +#include <asm/uic.h>
43590 +#include <asm/pci-bridge.h>
43591 +
43592 +#include "44x.h"
43593 +
43594 +static __initdata struct of_device_id katmai_of_bus[] = {
43595 +       { .compatible = "ibm,plb4", },
43596 +       { .compatible = "ibm,opb", },
43597 +       { .compatible = "ibm,ebc", },
43598 +       {},
43599 +};
43600 +
43601 +static int __init katmai_device_probe(void)
43602 +{
43603 +       of_platform_bus_probe(NULL, katmai_of_bus, NULL);
43604 +
43605 +       return 0;
43606 +}
43607 +machine_device_initcall(katmai, katmai_device_probe);
43608 +
43609 +static int __init katmai_probe(void)
43610 +{
43611 +       unsigned long root = of_get_flat_dt_root();
43612 +
43613 +       if (!of_flat_dt_is_compatible(root, "amcc,katmai"))
43614 +               return 0;
43615 +
43616 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43617 +
43618 +       return 1;
43619 +}
43620 +
43621 +define_machine(katmai) {
43622 +       .name                           = "Katmai",
43623 +       .probe                          = katmai_probe,
43624 +       .progress                       = udbg_progress,
43625 +       .init_IRQ                       = uic_init_tree,
43626 +       .get_irq                        = uic_get_irq,
43627 +       .restart                        = ppc44x_reset_system,
43628 +       .calibrate_decr                 = generic_calibrate_decr,
43629 +};
43630 Index: linux-2.6.24.7/arch/powerpc/platforms/44x/rainier.c
43631 ===================================================================
43632 --- /dev/null
43633 +++ linux-2.6.24.7/arch/powerpc/platforms/44x/rainier.c
43634 @@ -0,0 +1,62 @@
43635 +/*
43636 + * Rainier board specific routines
43637 + *
43638 + * Valentine Barshak <vbarshak@ru.mvista.com>
43639 + * Copyright 2007 MontaVista Software Inc.
43640 + *
43641 + * Based on the Bamboo code by
43642 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
43643 + * Copyright 2007 IBM Corporation
43644 + *
43645 + * This program is free software; you can redistribute  it and/or modify it
43646 + * under  the terms of  the GNU General  Public License as published by the
43647 + * Free Software Foundation;  either version 2 of the  License, or (at your
43648 + * option) any later version.
43649 + */
43650 +#include <linux/init.h>
43651 +#include <linux/of_platform.h>
43652 +
43653 +#include <asm/machdep.h>
43654 +#include <asm/prom.h>
43655 +#include <asm/udbg.h>
43656 +#include <asm/time.h>
43657 +#include <asm/uic.h>
43658 +#include <asm/pci-bridge.h>
43659 +#include "44x.h"
43660 +
43661 +static __initdata struct of_device_id rainier_of_bus[] = {
43662 +       { .compatible = "ibm,plb4", },
43663 +       { .compatible = "ibm,opb", },
43664 +       { .compatible = "ibm,ebc", },
43665 +       {},
43666 +};
43667 +
43668 +static int __init rainier_device_probe(void)
43669 +{
43670 +       of_platform_bus_probe(NULL, rainier_of_bus, NULL);
43671 +
43672 +       return 0;
43673 +}
43674 +machine_device_initcall(rainier, rainier_device_probe);
43675 +
43676 +static int __init rainier_probe(void)
43677 +{
43678 +       unsigned long root = of_get_flat_dt_root();
43679 +
43680 +       if (!of_flat_dt_is_compatible(root, "amcc,rainier"))
43681 +               return 0;
43682 +
43683 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43684 +
43685 +       return 1;
43686 +}
43687 +
43688 +define_machine(rainier) {
43689 +       .name                           = "Rainier",
43690 +       .probe                          = rainier_probe,
43691 +       .progress                       = udbg_progress,
43692 +       .init_IRQ                       = uic_init_tree,
43693 +       .get_irq                        = uic_get_irq,
43694 +       .restart                        = ppc44x_reset_system,
43695 +       .calibrate_decr                 = generic_calibrate_decr,
43696 +};
43697 Index: linux-2.6.24.7/arch/powerpc/platforms/44x/sequoia.c
43698 ===================================================================
43699 --- linux-2.6.24.7.orig/arch/powerpc/platforms/44x/sequoia.c
43700 +++ linux-2.6.24.7/arch/powerpc/platforms/44x/sequoia.c
43701 @@ -21,9 +21,11 @@
43702  #include <asm/udbg.h>
43703  #include <asm/time.h>
43704  #include <asm/uic.h>
43705 +#include <asm/pci-bridge.h>
43706 +
43707  #include "44x.h"
43708  
43709 -static struct of_device_id sequoia_of_bus[] = {
43710 +static __initdata struct of_device_id sequoia_of_bus[] = {
43711         { .compatible = "ibm,plb4", },
43712         { .compatible = "ibm,opb", },
43713         { .compatible = "ibm,ebc", },
43714 @@ -32,14 +34,11 @@ static struct of_device_id sequoia_of_bu
43715  
43716  static int __init sequoia_device_probe(void)
43717  {
43718 -       if (!machine_is(sequoia))
43719 -               return 0;
43720 -
43721         of_platform_bus_probe(NULL, sequoia_of_bus, NULL);
43722  
43723         return 0;
43724  }
43725 -device_initcall(sequoia_device_probe);
43726 +machine_device_initcall(sequoia, sequoia_device_probe);
43727  
43728  static int __init sequoia_probe(void)
43729  {
43730 @@ -48,6 +47,8 @@ static int __init sequoia_probe(void)
43731         if (!of_flat_dt_is_compatible(root, "amcc,sequoia"))
43732                 return 0;
43733  
43734 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43735 +
43736         return 1;
43737  }
43738  
43739 Index: linux-2.6.24.7/arch/powerpc/platforms/44x/taishan.c
43740 ===================================================================
43741 --- /dev/null
43742 +++ linux-2.6.24.7/arch/powerpc/platforms/44x/taishan.c
43743 @@ -0,0 +1,73 @@
43744 +/*
43745 + * Taishan board specific routines based off ebony.c code
43746 + * original copyrights below
43747 + *
43748 + * Matt Porter <mporter@kernel.crashing.org>
43749 + * Copyright 2002-2005 MontaVista Software Inc.
43750 + *
43751 + * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
43752 + * Copyright (c) 2003-2005 Zultys Technologies
43753 + *
43754 + * Rewritten and ported to the merged powerpc tree:
43755 + * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
43756 + *
43757 + * Modified from ebony.c for taishan:
43758 + * Copyright 2007 Hugh Blemings <hugh@au.ibm.com>, IBM Corporation.
43759 + *
43760 + * This program is free software; you can redistribute  it and/or modify it
43761 + * under  the terms of  the GNU General  Public License as published by the
43762 + * Free Software Foundation;  either version 2 of the  License, or (at your
43763 + * option) any later version.
43764 + */
43765 +
43766 +#include <linux/init.h>
43767 +#include <linux/of_platform.h>
43768 +
43769 +#include <asm/machdep.h>
43770 +#include <asm/prom.h>
43771 +#include <asm/udbg.h>
43772 +#include <asm/time.h>
43773 +#include <asm/uic.h>
43774 +#include <asm/pci-bridge.h>
43775 +
43776 +#include "44x.h"
43777 +
43778 +static __initdata struct of_device_id taishan_of_bus[] = {
43779 +       { .compatible = "ibm,plb4", },
43780 +       { .compatible = "ibm,opb", },
43781 +       { .compatible = "ibm,ebc", },
43782 +       {},
43783 +};
43784 +
43785 +static int __init taishan_device_probe(void)
43786 +{
43787 +       of_platform_bus_probe(NULL, taishan_of_bus, NULL);
43788 +
43789 +       return 0;
43790 +}
43791 +machine_device_initcall(taishan, taishan_device_probe);
43792 +
43793 +/*
43794 + * Called very early, MMU is off, device-tree isn't unflattened
43795 + */
43796 +static int __init taishan_probe(void)
43797 +{
43798 +       unsigned long root = of_get_flat_dt_root();
43799 +
43800 +       if (!of_flat_dt_is_compatible(root, "amcc,taishan"))
43801 +               return 0;
43802 +
43803 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43804 +
43805 +       return 1;
43806 +}
43807 +
43808 +define_machine(taishan) {
43809 +       .name                   = "Taishan",
43810 +       .probe                  = taishan_probe,
43811 +       .progress               = udbg_progress,
43812 +       .init_IRQ               = uic_init_tree,
43813 +       .get_irq                = uic_get_irq,
43814 +       .restart                = ppc44x_reset_system,
43815 +       .calibrate_decr         = generic_calibrate_decr,
43816 +};
43817 Index: linux-2.6.24.7/arch/powerpc/platforms/44x/warp-nand.c
43818 ===================================================================
43819 --- /dev/null
43820 +++ linux-2.6.24.7/arch/powerpc/platforms/44x/warp-nand.c
43821 @@ -0,0 +1,105 @@
43822 +/*
43823 + * PIKA Warp(tm) NAND flash specific routines
43824 + *
43825 + * Copyright (c) 2008 PIKA Technologies
43826 + *   Sean MacLennan <smaclennan@pikatech.com>
43827 + */
43828 +
43829 +#include <linux/platform_device.h>
43830 +#include <linux/mtd/mtd.h>
43831 +#include <linux/mtd/map.h>
43832 +#include <linux/mtd/partitions.h>
43833 +#include <linux/mtd/nand.h>
43834 +#include <linux/mtd/ndfc.h>
43835 +
43836 +#ifdef CONFIG_MTD_NAND_NDFC
43837 +
43838 +#define CS_NAND_0      1       /* use chip select 1 for NAND device 0 */
43839 +
43840 +#define WARP_NAND_FLASH_REG_ADDR       0xD0000000UL
43841 +#define WARP_NAND_FLASH_REG_SIZE       0x2000
43842 +
43843 +static struct resource warp_ndfc = {
43844 +       .start = WARP_NAND_FLASH_REG_ADDR,
43845 +       .end   = WARP_NAND_FLASH_REG_ADDR + WARP_NAND_FLASH_REG_SIZE,
43846 +       .flags = IORESOURCE_MEM,
43847 +};
43848 +
43849 +static struct mtd_partition nand_parts[] = {
43850 +       {
43851 +               .name   = "kernel",
43852 +               .offset = 0,
43853 +               .size   = 0x0200000
43854 +       },
43855 +       {
43856 +               .name   = "root",
43857 +               .offset = 0x0200000,
43858 +               .size   = 0x3400000
43859 +       },
43860 +       {
43861 +               .name   = "user",
43862 +               .offset = 0x3600000,
43863 +               .size   = 0x0A00000
43864 +       },
43865 +};
43866 +
43867 +struct ndfc_controller_settings warp_ndfc_settings = {
43868 +       .ccr_settings = (NDFC_CCR_BS(CS_NAND_0) | NDFC_CCR_ARAC1),
43869 +       .ndfc_erpn = 0,
43870 +};
43871 +
43872 +static struct ndfc_chip_settings warp_chip0_settings = {
43873 +       .bank_settings = 0x80002222,
43874 +};
43875 +
43876 +struct platform_nand_ctrl warp_nand_ctrl = {
43877 +       .priv = &warp_ndfc_settings,
43878 +};
43879 +
43880 +static struct platform_device warp_ndfc_device = {
43881 +       .name = "ndfc-nand",
43882 +       .id = 0,
43883 +       .dev = {
43884 +               .platform_data = &warp_nand_ctrl,
43885 +       },
43886 +       .num_resources = 1,
43887 +       .resource = &warp_ndfc,
43888 +};
43889 +
43890 +static struct nand_ecclayout nand_oob_16 = {
43891 +       .eccbytes = 3,
43892 +       .eccpos = { 0, 1, 2, 3, 6, 7 },
43893 +       .oobfree = { {.offset = 8, .length = 16} }
43894 +};
43895 +
43896 +static struct platform_nand_chip warp_nand_chip0 = {
43897 +       .nr_chips = 1,
43898 +       .chip_offset = CS_NAND_0,
43899 +       .nr_partitions = ARRAY_SIZE(nand_parts),
43900 +       .partitions = nand_parts,
43901 +       .chip_delay = 50,
43902 +       .ecclayout = &nand_oob_16,
43903 +       .priv = &warp_chip0_settings,
43904 +};
43905 +
43906 +static struct platform_device warp_nand_device = {
43907 +       .name = "ndfc-chip",
43908 +       .id = 0,
43909 +       .num_resources = 1,
43910 +       .resource = &warp_ndfc,
43911 +       .dev = {
43912 +               .platform_data = &warp_nand_chip0,
43913 +               .parent = &warp_ndfc_device.dev,
43914 +       }
43915 +};
43916 +
43917 +static int warp_setup_nand_flash(void)
43918 +{
43919 +       platform_device_register(&warp_ndfc_device);
43920 +       platform_device_register(&warp_nand_device);
43921 +
43922 +       return 0;
43923 +}
43924 +device_initcall(warp_setup_nand_flash);
43925 +
43926 +#endif
43927 Index: linux-2.6.24.7/arch/powerpc/platforms/44x/warp.c
43928 ===================================================================
43929 --- /dev/null
43930 +++ linux-2.6.24.7/arch/powerpc/platforms/44x/warp.c
43931 @@ -0,0 +1,153 @@
43932 +/*
43933 + * PIKA Warp(tm) board specific routines
43934 + *
43935 + * Copyright (c) 2008 PIKA Technologies
43936 + *   Sean MacLennan <smaclennan@pikatech.com>
43937 + *
43938 + * This program is free software; you can redistribute  it and/or modify it
43939 + * under  the terms of  the GNU General  Public License as published by the
43940 + * Free Software Foundation;  either version 2 of the  License, or (at your
43941 + * option) any later version.
43942 + */
43943 +#include <linux/init.h>
43944 +#include <linux/of_platform.h>
43945 +#include <linux/kthread.h>
43946 +
43947 +#include <asm/machdep.h>
43948 +#include <asm/prom.h>
43949 +#include <asm/udbg.h>
43950 +#include <asm/time.h>
43951 +#include <asm/uic.h>
43952 +
43953 +#include "44x.h"
43954 +
43955 +
43956 +static __initdata struct of_device_id warp_of_bus[] = {
43957 +       { .compatible = "ibm,plb4", },
43958 +       { .compatible = "ibm,opb", },
43959 +       { .compatible = "ibm,ebc", },
43960 +       {},
43961 +};
43962 +
43963 +static int __init warp_device_probe(void)
43964 +{
43965 +       of_platform_bus_probe(NULL, warp_of_bus, NULL);
43966 +       return 0;
43967 +}
43968 +machine_device_initcall(warp, warp_device_probe);
43969 +
43970 +static int __init warp_probe(void)
43971 +{
43972 +       unsigned long root = of_get_flat_dt_root();
43973 +
43974 +       return of_flat_dt_is_compatible(root, "pika,warp");
43975 +}
43976 +
43977 +define_machine(warp) {
43978 +       .name           = "Warp",
43979 +       .probe          = warp_probe,
43980 +       .progress       = udbg_progress,
43981 +       .init_IRQ       = uic_init_tree,
43982 +       .get_irq        = uic_get_irq,
43983 +       .restart        = ppc44x_reset_system,
43984 +       .calibrate_decr = generic_calibrate_decr,
43985 +};
43986 +
43987 +
43988 +#define LED_GREEN (0x80000000 >> 0)
43989 +#define LED_RED   (0x80000000 >> 1)
43990 +
43991 +
43992 +/* This is for the power LEDs 1 = on, 0 = off, -1 = leave alone */
43993 +void warp_set_power_leds(int green, int red)
43994 +{
43995 +       static void __iomem *gpio_base = NULL;
43996 +       unsigned leds;
43997 +
43998 +       if (gpio_base == NULL) {
43999 +               struct device_node *np;
44000 +
44001 +               /* Power LEDS are on the second GPIO controller */
44002 +               np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP");
44003 +               if (np)
44004 +                       np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP");
44005 +               if (np == NULL) {
44006 +                       printk(KERN_ERR __FILE__ ": Unable to find gpio\n");
44007 +                       return;
44008 +               }
44009 +
44010 +               gpio_base = of_iomap(np, 0);
44011 +               of_node_put(np);
44012 +               if (gpio_base == NULL) {
44013 +                       printk(KERN_ERR __FILE__ ": Unable to map gpio");
44014 +                       return;
44015 +               }
44016 +       }
44017 +
44018 +       leds = in_be32(gpio_base);
44019 +
44020 +       switch (green) {
44021 +       case 0: leds &= ~LED_GREEN; break;
44022 +       case 1: leds |=  LED_GREEN; break;
44023 +       }
44024 +       switch (red) {
44025 +       case 0: leds &= ~LED_RED; break;
44026 +       case 1: leds |=  LED_RED; break;
44027 +       }
44028 +
44029 +       out_be32(gpio_base, leds);
44030 +}
44031 +EXPORT_SYMBOL(warp_set_power_leds);
44032 +
44033 +
44034 +#ifdef CONFIG_SENSORS_AD7414
44035 +static int pika_dtm_thread(void __iomem *fpga)
44036 +{
44037 +       extern int ad7414_get_temp(int index);
44038 +
44039 +       while (!kthread_should_stop()) {
44040 +               int temp = ad7414_get_temp(0);
44041 +
44042 +               out_be32(fpga, temp);
44043 +
44044 +               set_current_state(TASK_INTERRUPTIBLE);
44045 +               schedule_timeout(HZ);
44046 +       }
44047 +
44048 +       return 0;
44049 +}
44050 +
44051 +static int __init pika_dtm_start(void)
44052 +{
44053 +       struct task_struct *dtm_thread;
44054 +       struct device_node *np;
44055 +       struct resource res;
44056 +       void __iomem *fpga;
44057 +
44058 +       np = of_find_compatible_node(NULL, NULL, "pika,fpga");
44059 +       if (np == NULL)
44060 +               return -ENOENT;
44061 +
44062 +       /* We do not call of_iomap here since it would map in the entire
44063 +        * fpga space, which is over 8k.
44064 +        */
44065 +       if (of_address_to_resource(np, 0, &res)) {
44066 +               of_node_put(np);
44067 +               return -ENOENT;
44068 +       }
44069 +       of_node_put(np);
44070 +
44071 +       fpga = ioremap(res.start + 0x20, 4);
44072 +       if (fpga == NULL)
44073 +               return -ENOENT;
44074 +
44075 +       dtm_thread = kthread_run(pika_dtm_thread, fpga + 0x20, "pika-dtm");
44076 +       if (IS_ERR(dtm_thread)) {
44077 +               iounmap(fpga);
44078 +               return PTR_ERR(dtm_thread);
44079 +       }
44080 +
44081 +       return 0;
44082 +}
44083 +device_initcall(pika_dtm_start);
44084 +#endif
44085 Index: linux-2.6.24.7/arch/powerpc/platforms/52xx/Kconfig
44086 ===================================================================
44087 --- linux-2.6.24.7.orig/arch/powerpc/platforms/52xx/Kconfig
44088 +++ linux-2.6.24.7/arch/powerpc/platforms/52xx/Kconfig
44089 @@ -19,6 +19,28 @@ config PPC_MPC5200_BUGFIX
44090  
44091           It is safe to say 'Y' here
44092  
44093 +config PPC_MPC5200_SIMPLE
44094 +       bool "Generic support for simple MPC5200 based boards"
44095 +       depends on PPC_MULTIPLATFORM && PPC32
44096 +       select PPC_MPC5200
44097 +       select DEFAULT_UIMAGE
44098 +       select WANT_DEVICE_TREE
44099 +       default n
44100 +       help
44101 +         This option enables support for a simple MPC52xx based boards which
44102 +         do not need a custom platform specific setup. Such boards are
44103 +         supported assuming the following:
44104 +
44105 +         - GPIO pins are configured by the firmware,
44106 +         - CDM configuration (clocking) is setup correctly by firmware,
44107 +         - if the 'fsl,has-wdt' property is present in one of the
44108 +           gpt nodes, then it is safe to use such gpt to reset the board,
44109 +         - PCI is supported if enabled in the kernel configuration
44110 +           and if there is a PCI bus node defined in the device tree.
44111 +
44112 +         Boards that are compatible with this generic platform support
44113 +         are: 'tqc,tqm5200', 'promess,motionpro', 'schindler,cm5200'.
44114 +
44115  config PPC_EFIKA
44116         bool "bPlan Efika 5k2. MPC5200B based computer"
44117         depends on PPC_MULTIPLATFORM && PPC32
44118 @@ -31,8 +53,7 @@ config PPC_EFIKA
44119  config PPC_LITE5200
44120         bool "Freescale Lite5200 Eval Board"
44121         depends on PPC_MULTIPLATFORM && PPC32
44122 -       select WANT_DEVICE_TREE
44123         select PPC_MPC5200
44124 +       select DEFAULT_UIMAGE
44125 +       select WANT_DEVICE_TREE
44126         default n
44127 -
44128 -
44129 Index: linux-2.6.24.7/arch/powerpc/platforms/52xx/Makefile
44130 ===================================================================
44131 --- linux-2.6.24.7.orig/arch/powerpc/platforms/52xx/Makefile
44132 +++ linux-2.6.24.7/arch/powerpc/platforms/52xx/Makefile
44133 @@ -6,6 +6,7 @@ obj-y                           += mpc52xx_pic.o mpc52xx_common
44134  obj-$(CONFIG_PCI)              += mpc52xx_pci.o
44135  endif
44136  
44137 +obj-$(CONFIG_PPC_MPC5200_SIMPLE) += mpc5200_simple.o
44138  obj-$(CONFIG_PPC_EFIKA)                += efika.o
44139  obj-$(CONFIG_PPC_LITE5200)     += lite5200.o
44140  
44141 Index: linux-2.6.24.7/arch/powerpc/platforms/52xx/lite5200.c
44142 ===================================================================
44143 --- linux-2.6.24.7.orig/arch/powerpc/platforms/52xx/lite5200.c
44144 +++ linux-2.6.24.7/arch/powerpc/platforms/52xx/lite5200.c
44145 @@ -42,10 +42,13 @@
44146  static void __init
44147  lite5200_fix_clock_config(void)
44148  {
44149 +       struct device_node *np;
44150         struct mpc52xx_cdm  __iomem *cdm;
44151  
44152         /* Map zones */
44153 -       cdm = mpc52xx_find_and_map("mpc5200-cdm");
44154 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-cdm");
44155 +       cdm = of_iomap(np, 0);
44156 +       of_node_put(np);
44157         if (!cdm) {
44158                 printk(KERN_ERR "%s() failed; expect abnormal behaviour\n",
44159                        __FUNCTION__);
44160 @@ -74,10 +77,13 @@ lite5200_fix_clock_config(void)
44161  static void __init
44162  lite5200_fix_port_config(void)
44163  {
44164 +       struct device_node *np;
44165         struct mpc52xx_gpio __iomem *gpio;
44166         u32 port_config;
44167  
44168 -       gpio = mpc52xx_find_and_map("mpc5200-gpio");
44169 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-gpio");
44170 +       gpio = of_iomap(np, 0);
44171 +       of_node_put(np);
44172         if (!gpio) {
44173                 printk(KERN_ERR "%s() failed. expect abnormal behavior\n",
44174                        __FUNCTION__);
44175 @@ -131,10 +137,6 @@ static void lite5200_resume_finish(void 
44176  
44177  static void __init lite5200_setup_arch(void)
44178  {
44179 -#ifdef CONFIG_PCI
44180 -       struct device_node *np;
44181 -#endif
44182 -
44183         if (ppc_md.progress)
44184                 ppc_md.progress("lite5200_setup_arch()", 0);
44185  
44186 @@ -154,13 +156,7 @@ static void __init lite5200_setup_arch(v
44187         lite5200_pm_init();
44188  #endif
44189  
44190 -#ifdef CONFIG_PCI
44191 -       np = of_find_node_by_type(NULL, "pci");
44192 -       if (np) {
44193 -               mpc52xx_add_bridge(np);
44194 -               of_node_put(np);
44195 -       }
44196 -#endif
44197 +       mpc52xx_setup_pci();
44198  }
44199  
44200  /*
44201 Index: linux-2.6.24.7/arch/powerpc/platforms/52xx/lite5200_pm.c
44202 ===================================================================
44203 --- linux-2.6.24.7.orig/arch/powerpc/platforms/52xx/lite5200_pm.c
44204 +++ linux-2.6.24.7/arch/powerpc/platforms/52xx/lite5200_pm.c
44205 @@ -42,6 +42,8 @@ static int lite5200_pm_set_target(suspen
44206  
44207  static int lite5200_pm_prepare(void)
44208  {
44209 +       struct device_node *np;
44210 +
44211         /* deep sleep? let mpc52xx code handle that */
44212         if (lite5200_pm_target_state == PM_SUSPEND_STANDBY)
44213                 return mpc52xx_pm_prepare();
44214 @@ -50,7 +52,9 @@ static int lite5200_pm_prepare(void)
44215                 return -EINVAL;
44216  
44217         /* map registers */
44218 -       mbar = mpc52xx_find_and_map("mpc5200");
44219 +       np = of_find_compatible_node(NULL, NULL, "mpc5200");
44220 +       mbar = of_iomap(np, 0);
44221 +       of_node_put(np);
44222         if (!mbar) {
44223                 printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__);
44224                 return -ENOSYS;
44225 Index: linux-2.6.24.7/arch/powerpc/platforms/52xx/mpc5200_simple.c
44226 ===================================================================
44227 --- /dev/null
44228 +++ linux-2.6.24.7/arch/powerpc/platforms/52xx/mpc5200_simple.c
44229 @@ -0,0 +1,85 @@
44230 +/*
44231 + * Support for 'mpc5200-simple-platform' compatible boards.
44232 + *
44233 + * Written by Marian Balakowicz <m8@semihalf.com>
44234 + * Copyright (C) 2007 Semihalf
44235 + *
44236 + * This program is free software; you can redistribute  it and/or modify it
44237 + * under  the terms of  the GNU General  Public License as published by the
44238 + * Free Software Foundation;  either version 2 of the  License, or (at your
44239 + * option) any later version.
44240 + *
44241 + * Description:
44242 + * This code implements support for a simple MPC52xx based boards which
44243 + * do not need a custom platform specific setup. Such boards are
44244 + * supported assuming the following:
44245 + *
44246 + * - GPIO pins are configured by the firmware,
44247 + * - CDM configuration (clocking) is setup correctly by firmware,
44248 + * - if the 'fsl,has-wdt' property is present in one of the
44249 + *   gpt nodes, then it is safe to use such gpt to reset the board,
44250 + * - PCI is supported if enabled in the kernel configuration
44251 + *   and if there is a PCI bus node defined in the device tree.
44252 + *
44253 + * Boards that are compatible with this generic platform support
44254 + * are listed in a 'board' table.
44255 + */
44256 +
44257 +#undef DEBUG
44258 +#include <asm/time.h>
44259 +#include <asm/prom.h>
44260 +#include <asm/machdep.h>
44261 +#include <asm/mpc52xx.h>
44262 +
44263 +/*
44264 + * Setup the architecture
44265 + */
44266 +static void __init mpc5200_simple_setup_arch(void)
44267 +{
44268 +       if (ppc_md.progress)
44269 +               ppc_md.progress("mpc5200_simple_setup_arch()", 0);
44270 +
44271 +       /* Some mpc5200 & mpc5200b related configuration */
44272 +       mpc5200_setup_xlb_arbiter();
44273 +
44274 +       /* Map wdt for mpc52xx_restart() */
44275 +       mpc52xx_map_wdt();
44276 +
44277 +       mpc52xx_setup_pci();
44278 +}
44279 +
44280 +/* list of the supported boards */
44281 +static char *board[] __initdata = {
44282 +       "promess,motionpro",
44283 +       "schindler,cm5200",
44284 +       "tqc,tqm5200",
44285 +       NULL
44286 +};
44287 +
44288 +/*
44289 + * Called very early, MMU is off, device-tree isn't unflattened
44290 + */
44291 +static int __init mpc5200_simple_probe(void)
44292 +{
44293 +       unsigned long node = of_get_flat_dt_root();
44294 +       int i = 0;
44295 +
44296 +       while (board[i]) {
44297 +               if (of_flat_dt_is_compatible(node, board[i]))
44298 +                       break;
44299 +               i++;
44300 +       }
44301 +       
44302 +       return (board[i] != NULL);
44303 +}
44304 +
44305 +define_machine(mpc5200_simple_platform) {
44306 +       .name           = "mpc5200-simple-platform",
44307 +       .probe          = mpc5200_simple_probe,
44308 +       .setup_arch     = mpc5200_simple_setup_arch,
44309 +       .init           = mpc52xx_declare_of_platform_devices,
44310 +       .init_IRQ       = mpc52xx_init_irq,
44311 +       .get_irq        = mpc52xx_get_irq,
44312 +       .restart        = mpc52xx_restart,
44313 +       .calibrate_decr = generic_calibrate_decr,
44314 +};
44315 Index: linux-2.6.24.7/arch/powerpc/platforms/52xx/mpc52xx_common.c
44316 ===================================================================
44317 --- linux-2.6.24.7.orig/arch/powerpc/platforms/52xx/mpc52xx_common.c
44318 +++ linux-2.6.24.7/arch/powerpc/platforms/52xx/mpc52xx_common.c
44319 @@ -26,45 +26,6 @@
44320   */
44321  static volatile struct mpc52xx_gpt *mpc52xx_wdt = NULL;
44322  
44323 -static void __iomem *
44324 -mpc52xx_map_node(struct device_node *ofn)
44325 -{
44326 -       const u32 *regaddr_p;
44327 -       u64 regaddr64, size64;
44328 -
44329 -       if (!ofn)
44330 -               return NULL;
44331 -
44332 -       regaddr_p = of_get_address(ofn, 0, &size64, NULL);
44333 -       if (!regaddr_p) {
44334 -               of_node_put(ofn);
44335 -               return NULL;
44336 -       }
44337 -
44338 -       regaddr64 = of_translate_address(ofn, regaddr_p);
44339 -
44340 -       of_node_put(ofn);
44341 -
44342 -       return ioremap((u32)regaddr64, (u32)size64);
44343 -}
44344 -
44345 -void __iomem *
44346 -mpc52xx_find_and_map(const char *compatible)
44347 -{
44348 -       return mpc52xx_map_node(
44349 -               of_find_compatible_node(NULL, NULL, compatible));
44350 -}
44351 -
44352 -EXPORT_SYMBOL(mpc52xx_find_and_map);
44353 -
44354 -void __iomem *
44355 -mpc52xx_find_and_map_path(const char *path)
44356 -{
44357 -       return mpc52xx_map_node(of_find_node_by_path(path));
44358 -}
44359 -
44360 -EXPORT_SYMBOL(mpc52xx_find_and_map_path);
44361 -
44362  /**
44363   *     mpc52xx_find_ipb_freq - Find the IPB bus frequency for a device
44364   *     @node:  device node
44365 @@ -101,9 +62,12 @@ EXPORT_SYMBOL(mpc52xx_find_ipb_freq);
44366  void __init
44367  mpc5200_setup_xlb_arbiter(void)
44368  {
44369 +       struct device_node *np;
44370         struct mpc52xx_xlb  __iomem *xlb;
44371  
44372 -       xlb = mpc52xx_find_and_map("mpc5200-xlb");
44373 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-xlb");
44374 +       xlb = of_iomap(np, 0);
44375 +       of_node_put(np);
44376         if (!xlb) {
44377                 printk(KERN_ERR __FILE__ ": "
44378                         "Error mapping XLB in mpc52xx_setup_cpu().  "
44379 @@ -124,11 +88,21 @@ mpc5200_setup_xlb_arbiter(void)
44380         iounmap(xlb);
44381  }
44382  
44383 +static struct of_device_id mpc52xx_bus_ids[] __initdata= {
44384 +       { .compatible = "fsl,mpc5200-immr", },
44385 +       { .compatible = "fsl,lpb", },
44386 +
44387 +       /* depreciated matches; shouldn't be used in new device trees */
44388 +       { .type = "builtin", .compatible = "mpc5200", }, /* efika */
44389 +       { .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
44390 +       {},
44391 +};
44392 +
44393  void __init
44394  mpc52xx_declare_of_platform_devices(void)
44395  {
44396         /* Find every child of the SOC node and add it to of_platform */
44397 -       if (of_platform_bus_probe(NULL, NULL, NULL))
44398 +       if (of_platform_bus_probe(NULL, mpc52xx_bus_ids, NULL))
44399                 printk(KERN_ERR __FILE__ ": "
44400                         "Error while probing of_platform bus\n");
44401  }
44402 @@ -146,16 +120,19 @@ mpc52xx_map_wdt(void)
44403         for_each_compatible_node(np, NULL, "fsl,mpc5200-gpt") {
44404                 has_wdt = of_get_property(np, "fsl,has-wdt", NULL);
44405                 if (has_wdt) {
44406 -                       mpc52xx_wdt = mpc52xx_map_node(np);
44407 +                       mpc52xx_wdt = of_iomap(np, 0);
44408 +                       of_node_put(np);
44409                         return;
44410                 }
44411         }
44412         for_each_compatible_node(np, NULL, "mpc5200-gpt") {
44413                 has_wdt = of_get_property(np, "has-wdt", NULL);
44414                 if (has_wdt) {
44415 -                       mpc52xx_wdt = mpc52xx_map_node(np);
44416 +                       mpc52xx_wdt = of_iomap(np, 0);
44417 +                       of_node_put(np);
44418                         return;
44419                 }
44420 +
44421         }
44422  }
44423  
44424 Index: linux-2.6.24.7/arch/powerpc/platforms/52xx/mpc52xx_pci.c
44425 ===================================================================
44426 --- linux-2.6.24.7.orig/arch/powerpc/platforms/52xx/mpc52xx_pci.c
44427 +++ linux-2.6.24.7/arch/powerpc/platforms/52xx/mpc52xx_pci.c
44428 @@ -363,7 +363,7 @@ mpc52xx_add_bridge(struct device_node *n
44429  
44430         pr_debug("Adding MPC52xx PCI host bridge %s\n", node->full_name);
44431  
44432 -       pci_assign_all_buses = 1;
44433 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
44434  
44435         if (of_address_to_resource(node, 0, &rsrc) != 0) {
44436                 printk(KERN_ERR "Can't get %s resources\n", node->full_name);
44437 @@ -406,3 +406,17 @@ mpc52xx_add_bridge(struct device_node *n
44438  
44439         return 0;
44440  }
44441 +
44442 +void __init mpc52xx_setup_pci(void)
44443 +{
44444 +       struct device_node *pci;
44445 +
44446 +       pci = of_find_compatible_node(NULL, NULL, "fsl,mpc5200-pci");
44447 +       if (!pci)
44448 +               pci = of_find_compatible_node(NULL, NULL, "mpc5200-pci");
44449 +       if (!pci)
44450 +               return;
44451 +
44452 +       mpc52xx_add_bridge(pci);
44453 +       of_node_put(pci);
44454 +}
44455 Index: linux-2.6.24.7/arch/powerpc/platforms/52xx/mpc52xx_pic.c
44456 ===================================================================
44457 --- linux-2.6.24.7.orig/arch/powerpc/platforms/52xx/mpc52xx_pic.c
44458 +++ linux-2.6.24.7/arch/powerpc/platforms/52xx/mpc52xx_pic.c
44459 @@ -364,16 +364,18 @@ void __init mpc52xx_init_irq(void)
44460  {
44461         u32 intr_ctrl;
44462         struct device_node *picnode;
44463 +       struct device_node *np;
44464  
44465         /* Remap the necessary zones */
44466         picnode = of_find_compatible_node(NULL, NULL, "mpc5200-pic");
44467 -
44468 -       intr = mpc52xx_find_and_map("mpc5200-pic");
44469 +       intr = of_iomap(picnode, 0);
44470         if (!intr)
44471                 panic(__FILE__  ": find_and_map failed on 'mpc5200-pic'. "
44472                                 "Check node !");
44473  
44474 -       sdma = mpc52xx_find_and_map("mpc5200-bestcomm");
44475 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-bestcomm");
44476 +       sdma = of_iomap(np, 0);
44477 +       of_node_put(np);
44478         if (!sdma)
44479                 panic(__FILE__  ": find_and_map failed on 'mpc5200-bestcomm'. "
44480                                 "Check node !");
44481 Index: linux-2.6.24.7/arch/powerpc/platforms/52xx/mpc52xx_pm.c
44482 ===================================================================
44483 --- linux-2.6.24.7.orig/arch/powerpc/platforms/52xx/mpc52xx_pm.c
44484 +++ linux-2.6.24.7/arch/powerpc/platforms/52xx/mpc52xx_pm.c
44485 @@ -59,10 +59,14 @@ int mpc52xx_set_wakeup_gpio(u8 pin, u8 l
44486  
44487  int mpc52xx_pm_prepare(void)
44488  {
44489 +       struct device_node *np;
44490 +
44491         /* map the whole register space */
44492 -       mbar = mpc52xx_find_and_map("mpc5200");
44493 +       np = of_find_compatible_node(NULL, NULL, "mpc5200");
44494 +       mbar = of_iomap(np, 0);
44495 +       of_node_put(np);
44496         if (!mbar) {
44497 -               printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__);
44498 +               pr_err("mpc52xx_pm_prepare(): could not map registers\n");
44499                 return -ENOSYS;
44500         }
44501         /* these offsets are from mpc5200 users manual */
44502 Index: linux-2.6.24.7/arch/powerpc/platforms/82xx/Kconfig
44503 ===================================================================
44504 --- linux-2.6.24.7.orig/arch/powerpc/platforms/82xx/Kconfig
44505 +++ linux-2.6.24.7/arch/powerpc/platforms/82xx/Kconfig
44506 @@ -26,6 +26,19 @@ config PQ2FADS
44507         help
44508           This option enables support for the PQ2FADS board
44509  
44510 +config EP8248E
44511 +       bool "Embedded Planet EP8248E (a.k.a. CWH-PPC-8248N-VE)"
44512 +       select 8272
44513 +       select 8260
44514 +       select FSL_SOC
44515 +       select PPC_CPM_NEW_BINDING
44516 +       select MDIO_BITBANG
44517 +       help
44518 +         This enables support for the Embedded Planet EP8248E board.
44519 +
44520 +         This board is also resold by Freescale as the QUICCStart
44521 +         MPC8248 Evaluation System and/or the CWH-PPC-8248N-VE.
44522 +
44523  endchoice
44524  
44525  config PQ2ADS
44526 Index: linux-2.6.24.7/arch/powerpc/platforms/82xx/Makefile
44527 ===================================================================
44528 --- linux-2.6.24.7.orig/arch/powerpc/platforms/82xx/Makefile
44529 +++ linux-2.6.24.7/arch/powerpc/platforms/82xx/Makefile
44530 @@ -5,3 +5,4 @@ obj-$(CONFIG_MPC8272_ADS) += mpc8272_ads
44531  obj-$(CONFIG_CPM2) += pq2.o
44532  obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o
44533  obj-$(CONFIG_PQ2FADS) += pq2fads.o
44534 +obj-$(CONFIG_EP8248E) += ep8248e.o
44535 Index: linux-2.6.24.7/arch/powerpc/platforms/82xx/ep8248e.c
44536 ===================================================================
44537 --- /dev/null
44538 +++ linux-2.6.24.7/arch/powerpc/platforms/82xx/ep8248e.c
44539 @@ -0,0 +1,324 @@
44540 +/*
44541 + * Embedded Planet EP8248E support
44542 + *
44543 + * Copyright 2007 Freescale Semiconductor, Inc.
44544 + * Author: Scott Wood <scottwood@freescale.com>
44545 + *
44546 + * This program is free software; you can redistribute  it and/or modify it
44547 + * under  the terms of  the GNU General  Public License as published by the
44548 + * Free Software Foundation;  either version 2 of the  License, or (at your
44549 + * option) any later version.
44550 + */
44551 +
44552 +#include <linux/init.h>
44553 +#include <linux/interrupt.h>
44554 +#include <linux/fsl_devices.h>
44555 +#include <linux/mdio-bitbang.h>
44556 +#include <linux/of_platform.h>
44557 +
44558 +#include <asm/io.h>
44559 +#include <asm/cpm2.h>
44560 +#include <asm/udbg.h>
44561 +#include <asm/machdep.h>
44562 +#include <asm/time.h>
44563 +#include <asm/mpc8260.h>
44564 +#include <asm/prom.h>
44565 +
44566 +#include <sysdev/fsl_soc.h>
44567 +#include <sysdev/cpm2_pic.h>
44568 +
44569 +#include "pq2.h"
44570 +
44571 +static u8 __iomem *ep8248e_bcsr;
44572 +static struct device_node *ep8248e_bcsr_node;
44573 +
44574 +#define BCSR7_SCC2_ENABLE 0x10
44575 +
44576 +#define BCSR8_PHY1_ENABLE 0x80
44577 +#define BCSR8_PHY1_POWER  0x40
44578 +#define BCSR8_PHY2_ENABLE 0x20
44579 +#define BCSR8_PHY2_POWER  0x10
44580 +#define BCSR8_MDIO_READ   0x04
44581 +#define BCSR8_MDIO_CLOCK  0x02
44582 +#define BCSR8_MDIO_DATA   0x01
44583 +
44584 +#define BCSR9_USB_ENABLE  0x80
44585 +#define BCSR9_USB_POWER   0x40
44586 +#define BCSR9_USB_HOST    0x20
44587 +#define BCSR9_USB_FULL_SPEED_TARGET 0x10
44588 +
44589 +static void __init ep8248e_pic_init(void)
44590 +{
44591 +       struct device_node *np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic");
44592 +       if (!np) {
44593 +               printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
44594 +               return;
44595 +       }
44596 +
44597 +       cpm2_pic_init(np);
44598 +       of_node_put(np);
44599 +}
44600 +
44601 +static void ep8248e_set_mdc(struct mdiobb_ctrl *ctrl, int level)
44602 +{
44603 +       if (level)
44604 +               setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_CLOCK);
44605 +       else
44606 +               clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_CLOCK);
44607 +
44608 +       /* Read back to flush the write. */
44609 +       in_8(&ep8248e_bcsr[8]);
44610 +}
44611 +
44612 +static void ep8248e_set_mdio_dir(struct mdiobb_ctrl *ctrl, int output)
44613 +{
44614 +       if (output)
44615 +               clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_READ);
44616 +       else
44617 +               setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_READ);
44618 +
44619 +       /* Read back to flush the write. */
44620 +       in_8(&ep8248e_bcsr[8]);
44621 +}
44622 +
44623 +static void ep8248e_set_mdio_data(struct mdiobb_ctrl *ctrl, int data)
44624 +{
44625 +       if (data)
44626 +               setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_DATA);
44627 +       else
44628 +               clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_DATA);
44629 +
44630 +       /* Read back to flush the write. */
44631 +       in_8(&ep8248e_bcsr[8]);
44632 +}
44633 +
44634 +static int ep8248e_get_mdio_data(struct mdiobb_ctrl *ctrl)
44635 +{
44636 +       return in_8(&ep8248e_bcsr[8]) & BCSR8_MDIO_DATA;
44637 +}
44638 +
44639 +static const struct mdiobb_ops ep8248e_mdio_ops = {
44640 +       .set_mdc = ep8248e_set_mdc,
44641 +       .set_mdio_dir = ep8248e_set_mdio_dir,
44642 +       .set_mdio_data = ep8248e_set_mdio_data,
44643 +       .get_mdio_data = ep8248e_get_mdio_data,
44644 +       .owner = THIS_MODULE,
44645 +};
44646 +
44647 +static struct mdiobb_ctrl ep8248e_mdio_ctrl = {
44648 +       .ops = &ep8248e_mdio_ops,
44649 +};
44650 +
44651 +static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
44652 +                                        const struct of_device_id *match)
44653 +{
44654 +       struct mii_bus *bus;
44655 +       struct resource res;
44656 +       struct device_node *node;
44657 +       int ret, i;
44658 +
44659 +       node = of_get_parent(ofdev->node);
44660 +       of_node_put(node);
44661 +       if (node != ep8248e_bcsr_node)
44662 +               return -ENODEV;
44663 +
44664 +       ret = of_address_to_resource(ofdev->node, 0, &res);
44665 +       if (ret)
44666 +               return ret;
44667 +
44668 +       bus = alloc_mdio_bitbang(&ep8248e_mdio_ctrl);
44669 +       if (!bus)
44670 +               return -ENOMEM;
44671 +
44672 +       bus->phy_mask = 0;
44673 +       bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
44674 +
44675 +       for (i = 0; i < PHY_MAX_ADDR; i++)
44676 +               bus->irq[i] = -1;
44677 +
44678 +       bus->name = "ep8248e-mdio-bitbang";
44679 +       bus->dev = &ofdev->dev;
44680 +       bus->id = res.start;
44681 +
44682 +       return mdiobus_register(bus);
44683 +}
44684 +
44685 +static int ep8248e_mdio_remove(struct of_device *ofdev)
44686 +{
44687 +       BUG();
44688 +       return 0;
44689 +}
44690 +
44691 +static const struct of_device_id ep8248e_mdio_match[] = {
44692 +       {
44693 +               .compatible = "fsl,ep8248e-mdio-bitbang",
44694 +       },
44695 +       {},
44696 +};
44697 +
44698 +static struct of_platform_driver ep8248e_mdio_driver = {
44699 +       .driver = {
44700 +               .name = "ep8248e-mdio-bitbang",
44701 +       },
44702 +       .match_table = ep8248e_mdio_match,
44703 +       .probe = ep8248e_mdio_probe,
44704 +       .remove = ep8248e_mdio_remove,
44705 +};
44706 +
44707 +struct cpm_pin {
44708 +       int port, pin, flags;
44709 +};
44710 +
44711 +static __initdata struct cpm_pin ep8248e_pins[] = {
44712 +       /* SMC1 */
44713 +       {2, 4, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44714 +       {2, 5, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44715 +
44716 +       /* SCC1 */
44717 +       {2, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44718 +       {2, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44719 +       {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44720 +       {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44721 +       {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44722 +
44723 +       /* FCC1 */
44724 +       {0, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44725 +       {0, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44726 +       {0, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44727 +       {0, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44728 +       {0, 18, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44729 +       {0, 19, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44730 +       {0, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44731 +       {0, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44732 +       {0, 26, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44733 +       {0, 27, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44734 +       {0, 28, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44735 +       {0, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44736 +       {0, 30, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44737 +       {0, 31, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44738 +       {2, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44739 +       {2, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44740 +
44741 +       /* FCC2 */
44742 +       {1, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44743 +       {1, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44744 +       {1, 20, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44745 +       {1, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44746 +       {1, 22, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44747 +       {1, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44748 +       {1, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44749 +       {1, 25, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44750 +       {1, 26, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44751 +       {1, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44752 +       {1, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44753 +       {1, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44754 +       {1, 30, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44755 +       {1, 31, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44756 +       {2, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44757 +       {2, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44758 +
44759 +       /* I2C */
44760 +       {4, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44761 +       {4, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44762 +
44763 +       /* USB */
44764 +       {2, 10, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44765 +       {2, 11, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44766 +       {2, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44767 +       {2, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44768 +       {3, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44769 +       {3, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44770 +       {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44771 +};
44772 +
44773 +static void __init init_ioports(void)
44774 +{
44775 +       int i;
44776 +
44777 +       for (i = 0; i < ARRAY_SIZE(ep8248e_pins); i++) {
44778 +               const struct cpm_pin *pin = &ep8248e_pins[i];
44779 +               cpm2_set_pin(pin->port, pin->pin, pin->flags);
44780 +       }
44781 +
44782 +       cpm2_smc_clk_setup(CPM_CLK_SMC1, CPM_BRG7);
44783 +       cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX);
44784 +       cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX);
44785 +       cpm2_clk_setup(CPM_CLK_SCC3, CPM_CLK8, CPM_CLK_TX); /* USB */
44786 +       cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK11, CPM_CLK_RX);
44787 +       cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_TX);
44788 +       cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX);
44789 +       cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX);
44790 +}
44791 +
44792 +static void __init ep8248e_setup_arch(void)
44793 +{
44794 +       if (ppc_md.progress)
44795 +               ppc_md.progress("ep8248e_setup_arch()", 0);
44796 +
44797 +       cpm2_reset();
44798 +
44799 +       /* When this is set, snooping CPM DMA from RAM causes
44800 +        * machine checks.  See erratum SIU18.
44801 +        */
44802 +       clrbits32(&cpm2_immr->im_siu_conf.siu_82xx.sc_bcr, MPC82XX_BCR_PLDP);
44803 +
44804 +       ep8248e_bcsr_node =
44805 +               of_find_compatible_node(NULL, NULL, "fsl,ep8248e-bcsr");
44806 +       if (!ep8248e_bcsr_node) {
44807 +               printk(KERN_ERR "No bcsr in device tree\n");
44808 +               return;
44809 +       }
44810 +
44811 +       ep8248e_bcsr = of_iomap(ep8248e_bcsr_node, 0);
44812 +       if (!ep8248e_bcsr) {
44813 +               printk(KERN_ERR "Cannot map BCSR registers\n");
44814 +               of_node_put(ep8248e_bcsr_node);
44815 +               ep8248e_bcsr_node = NULL;
44816 +               return;
44817 +       }
44818 +
44819 +       setbits8(&ep8248e_bcsr[7], BCSR7_SCC2_ENABLE);
44820 +       setbits8(&ep8248e_bcsr[8], BCSR8_PHY1_ENABLE | BCSR8_PHY1_POWER |
44821 +                                  BCSR8_PHY2_ENABLE | BCSR8_PHY2_POWER);
44822 +
44823 +       init_ioports();
44824 +
44825 +       if (ppc_md.progress)
44826 +               ppc_md.progress("ep8248e_setup_arch(), finish", 0);
44827 +}
44828 +
44829 +static  __initdata struct of_device_id of_bus_ids[] = {
44830 +       { .compatible = "simple-bus", },
44831 +       { .compatible = "fsl,ep8248e-bcsr", },
44832 +       {},
44833 +};
44834 +
44835 +static int __init declare_of_platform_devices(void)
44836 +{
44837 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
44838 +       of_register_platform_driver(&ep8248e_mdio_driver);
44839 +
44840 +       return 0;
44841 +}
44842 +machine_device_initcall(ep8248e, declare_of_platform_devices);
44843 +
44844 +/*
44845 + * Called very early, device-tree isn't unflattened
44846 + */
44847 +static int __init ep8248e_probe(void)
44848 +{
44849 +       unsigned long root = of_get_flat_dt_root();
44850 +       return of_flat_dt_is_compatible(root, "fsl,ep8248e");
44851 +}
44852 +
44853 +define_machine(ep8248e)
44854 +{
44855 +       .name = "Embedded Planet EP8248E",
44856 +       .probe = ep8248e_probe,
44857 +       .setup_arch = ep8248e_setup_arch,
44858 +       .init_IRQ = ep8248e_pic_init,
44859 +       .get_irq = cpm2_get_irq,
44860 +       .calibrate_decr = generic_calibrate_decr,
44861 +       .restart = pq2_restart,
44862 +       .progress = udbg_progress,
44863 +};
44864 Index: linux-2.6.24.7/arch/powerpc/platforms/82xx/pq2.c
44865 ===================================================================
44866 --- linux-2.6.24.7.orig/arch/powerpc/platforms/82xx/pq2.c
44867 +++ linux-2.6.24.7/arch/powerpc/platforms/82xx/pq2.c
44868 @@ -53,13 +53,13 @@ static void __init pq2_pci_add_bridge(st
44869         if (of_address_to_resource(np, 0, &r) || r.end - r.start < 0x10b)
44870                 goto err;
44871  
44872 -       pci_assign_all_buses = 1;
44873 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
44874  
44875         hose = pcibios_alloc_controller(np);
44876         if (!hose)
44877                 return;
44878  
44879 -       hose->arch_data = np;
44880 +       hose->dn = np;
44881  
44882         setup_indirect_pci(hose, r.start + 0x100, r.start + 0x104, 0);
44883         pci_process_bridge_OF_ranges(hose, np, 1);
44884 Index: linux-2.6.24.7/arch/powerpc/platforms/82xx/pq2fads.c
44885 ===================================================================
44886 --- linux-2.6.24.7.orig/arch/powerpc/platforms/82xx/pq2fads.c
44887 +++ linux-2.6.24.7/arch/powerpc/platforms/82xx/pq2fads.c
44888 @@ -15,12 +15,12 @@
44889  #include <linux/init.h>
44890  #include <linux/interrupt.h>
44891  #include <linux/fsl_devices.h>
44892 +#include <linux/of_platform.h>
44893  
44894  #include <asm/io.h>
44895  #include <asm/cpm2.h>
44896  #include <asm/udbg.h>
44897  #include <asm/machdep.h>
44898 -#include <asm/of_platform.h>
44899  #include <asm/time.h>
44900  
44901  #include <sysdev/fsl_soc.h>
44902 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/Kconfig
44903 ===================================================================
44904 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/Kconfig
44905 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/Kconfig
44906 @@ -50,6 +50,11 @@ config MPC836x_MDS
44907         help
44908           This option enables support for the MPC836x MDS Processor Board.
44909  
44910 +config MPC837x_MDS
44911 +       bool "Freescale MPC837x MDS"
44912 +       select DEFAULT_UIMAGE
44913 +       help
44914 +         This option enables support for the MPC837x MDS Processor Board.
44915  endchoice
44916  
44917  config PPC_MPC831x
44918 @@ -75,3 +80,9 @@ config PPC_MPC836x
44919         select PPC_UDBG_16550
44920         select PPC_INDIRECT_PCI
44921         default y if MPC836x_MDS
44922 +
44923 +config PPC_MPC837x
44924 +       bool
44925 +       select PPC_UDBG_16550
44926 +       select PPC_INDIRECT_PCI
44927 +       default y if MPC837x_MDS
44928 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/Makefile
44929 ===================================================================
44930 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/Makefile
44931 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/Makefile
44932 @@ -9,3 +9,4 @@ obj-$(CONFIG_MPC834x_MDS)       += mpc834x_mds
44933  obj-$(CONFIG_MPC834x_ITX)      += mpc834x_itx.o
44934  obj-$(CONFIG_MPC836x_MDS)      += mpc836x_mds.o
44935  obj-$(CONFIG_MPC832x_MDS)      += mpc832x_mds.o
44936 +obj-$(CONFIG_MPC837x_MDS)      += mpc837x_mds.o
44937 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc8313_rdb.c
44938 ===================================================================
44939 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/mpc8313_rdb.c
44940 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc8313_rdb.c
44941 @@ -14,6 +14,7 @@
44942   */
44943  
44944  #include <linux/pci.h>
44945 +#include <linux/of_platform.h>
44946  
44947  #include <asm/time.h>
44948  #include <asm/ipic.h>
44949 @@ -70,11 +71,23 @@ void __init mpc8313_rdb_init_IRQ(void)
44950   */
44951  static int __init mpc8313_rdb_probe(void)
44952  {
44953 -        unsigned long root = of_get_flat_dt_root();
44954 +       unsigned long root = of_get_flat_dt_root();
44955  
44956 -        return of_flat_dt_is_compatible(root, "MPC8313ERDB");
44957 +       return of_flat_dt_is_compatible(root, "MPC8313ERDB");
44958  }
44959  
44960 +static struct of_device_id __initdata of_bus_ids[] = {
44961 +       { .compatible = "simple-bus" },
44962 +       {},
44963 +};
44964 +
44965 +static int __init declare_of_platform_devices(void)
44966 +{
44967 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
44968 +       return 0;
44969 +}
44970 +machine_device_initcall(mpc8313_rdb, declare_of_platform_devices);
44971 +
44972  define_machine(mpc8313_rdb) {
44973         .name                   = "MPC8313 RDB",
44974         .probe                  = mpc8313_rdb_probe,
44975 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc832x_mds.c
44976 ===================================================================
44977 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/mpc832x_mds.c
44978 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc832x_mds.c
44979 @@ -23,9 +23,9 @@
44980  #include <linux/seq_file.h>
44981  #include <linux/root_dev.h>
44982  #include <linux/initrd.h>
44983 +#include <linux/of_platform.h>
44984 +#include <linux/of_device.h>
44985  
44986 -#include <asm/of_device.h>
44987 -#include <asm/of_platform.h>
44988  #include <asm/system.h>
44989  #include <asm/atomic.h>
44990  #include <asm/time.h>
44991 @@ -110,15 +110,12 @@ static struct of_device_id mpc832x_ids[]
44992  
44993  static int __init mpc832x_declare_of_platform_devices(void)
44994  {
44995 -       if (!machine_is(mpc832x_mds))
44996 -               return 0;
44997 -
44998         /* Publish the QE devices */
44999         of_platform_bus_probe(NULL, mpc832x_ids, NULL);
45000  
45001         return 0;
45002  }
45003 -device_initcall(mpc832x_declare_of_platform_devices);
45004 +machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
45005  
45006  static void __init mpc832x_sys_init_IRQ(void)
45007  {
45008 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc832x_rdb.c
45009 ===================================================================
45010 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/mpc832x_rdb.c
45011 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc832x_rdb.c
45012 @@ -19,8 +19,8 @@
45013  #include <linux/spi/spi.h>
45014  #include <linux/spi/mmc_spi.h>
45015  #include <linux/mmc/host.h>
45016 +#include <linux/of_platform.h>
45017  
45018 -#include <asm/of_platform.h>
45019  #include <asm/time.h>
45020  #include <asm/ipic.h>
45021  #include <asm/udbg.h>
45022 @@ -63,9 +63,6 @@ static struct spi_board_info mpc832x_spi
45023  
45024  static int __init mpc832x_spi_init(void)
45025  {
45026 -       if (!machine_is(mpc832x_rdb))
45027 -               return 0;
45028 -
45029         par_io_config_pin(3,  0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
45030         par_io_config_pin(3,  1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
45031         par_io_config_pin(3,  2, 3, 0, 1, 0); /* SPI1 CLK,  I/O */
45032 @@ -80,7 +77,7 @@ static int __init mpc832x_spi_init(void)
45033                             mpc83xx_spi_deactivate_cs);
45034  }
45035  
45036 -device_initcall(mpc832x_spi_init);
45037 +machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
45038  
45039  /* ************************************************************************
45040   *
45041 @@ -123,15 +120,12 @@ static struct of_device_id mpc832x_ids[]
45042  
45043  static int __init mpc832x_declare_of_platform_devices(void)
45044  {
45045 -       if (!machine_is(mpc832x_rdb))
45046 -               return 0;
45047 -
45048         /* Publish the QE devices */
45049         of_platform_bus_probe(NULL, mpc832x_ids, NULL);
45050  
45051         return 0;
45052  }
45053 -device_initcall(mpc832x_declare_of_platform_devices);
45054 +machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
45055  
45056  void __init mpc832x_rdb_init_IRQ(void)
45057  {
45058 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc834x_itx.c
45059 ===================================================================
45060 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/mpc834x_itx.c
45061 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc834x_itx.c
45062 @@ -23,6 +23,7 @@
45063  #include <linux/delay.h>
45064  #include <linux/seq_file.h>
45065  #include <linux/root_dev.h>
45066 +#include <linux/of_platform.h>
45067  
45068  #include <asm/system.h>
45069  #include <asm/atomic.h>
45070 @@ -37,6 +38,17 @@
45071  
45072  #include "mpc83xx.h"
45073  
45074 +static struct of_device_id __initdata mpc834x_itx_ids[] = {
45075 +       { .compatible = "fsl,pq2pro-localbus", },
45076 +       {},
45077 +};
45078 +
45079 +static int __init mpc834x_itx_declare_of_platform_devices(void)
45080 +{
45081 +       return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
45082 +}
45083 +machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
45084 +
45085  /* ************************************************************************
45086   *
45087   * Setup the architecture
45088 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc834x_mds.c
45089 ===================================================================
45090 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/mpc834x_mds.c
45091 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc834x_mds.c
45092 @@ -23,6 +23,7 @@
45093  #include <linux/delay.h>
45094  #include <linux/seq_file.h>
45095  #include <linux/root_dev.h>
45096 +#include <linux/of_platform.h>
45097  
45098  #include <asm/system.h>
45099  #include <asm/atomic.h>
45100 @@ -106,14 +107,27 @@ static void __init mpc834x_mds_init_IRQ(
45101         ipic_set_default_priority();
45102  }
45103  
45104 +static struct of_device_id mpc834x_ids[] = {
45105 +       { .type = "soc", },
45106 +       { .compatible = "soc", },
45107 +       {},
45108 +};
45109 +
45110 +static int __init mpc834x_declare_of_platform_devices(void)
45111 +{
45112 +       of_platform_bus_probe(NULL, mpc834x_ids, NULL);
45113 +       return 0;
45114 +}
45115 +machine_device_initcall(mpc834x_mds, mpc834x_declare_of_platform_devices);
45116 +
45117  /*
45118   * Called very early, MMU is off, device-tree isn't unflattened
45119   */
45120  static int __init mpc834x_mds_probe(void)
45121  {
45122 -        unsigned long root = of_get_flat_dt_root();
45123 +       unsigned long root = of_get_flat_dt_root();
45124  
45125 -        return of_flat_dt_is_compatible(root, "MPC834xMDS");
45126 +       return of_flat_dt_is_compatible(root, "MPC834xMDS");
45127  }
45128  
45129  define_machine(mpc834x_mds) {
45130 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc836x_mds.c
45131 ===================================================================
45132 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/mpc836x_mds.c
45133 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc836x_mds.c
45134 @@ -29,9 +29,9 @@
45135  #include <linux/seq_file.h>
45136  #include <linux/root_dev.h>
45137  #include <linux/initrd.h>
45138 +#include <linux/of_platform.h>
45139 +#include <linux/of_device.h>
45140  
45141 -#include <asm/of_device.h>
45142 -#include <asm/of_platform.h>
45143  #include <asm/system.h>
45144  #include <asm/atomic.h>
45145  #include <asm/time.h>
45146 @@ -141,15 +141,12 @@ static struct of_device_id mpc836x_ids[]
45147  
45148  static int __init mpc836x_declare_of_platform_devices(void)
45149  {
45150 -       if (!machine_is(mpc836x_mds))
45151 -               return 0;
45152 -
45153         /* Publish the QE devices */
45154         of_platform_bus_probe(NULL, mpc836x_ids, NULL);
45155  
45156         return 0;
45157  }
45158 -device_initcall(mpc836x_declare_of_platform_devices);
45159 +machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
45160  
45161  static void __init mpc836x_mds_init_IRQ(void)
45162  {
45163 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc837x_mds.c
45164 ===================================================================
45165 --- /dev/null
45166 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc837x_mds.c
45167 @@ -0,0 +1,147 @@
45168 +/*
45169 + * arch/powerpc/platforms/83xx/mpc837x_mds.c
45170 + *
45171 + * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
45172 + *
45173 + * MPC837x MDS board specific routines
45174 + *
45175 + * This program is free software; you can redistribute it and/or modify it
45176 + * under the terms of the GNU General Public License as published by the
45177 + * Free Software Foundation;  either version 2 of the License, or (at your
45178 + * option) any later version.
45179 + */
45180 +
45181 +#include <linux/pci.h>
45182 +#include <linux/of.h>
45183 +#include <linux/of_platform.h>
45184 +
45185 +#include <asm/time.h>
45186 +#include <asm/ipic.h>
45187 +#include <asm/udbg.h>
45188 +#include <asm/prom.h>
45189 +
45190 +#include "mpc83xx.h"
45191 +
45192 +#define BCSR12_USB_SER_MASK    0x8a
45193 +#define BCSR12_USB_SER_PIN     0x80
45194 +#define BCSR12_USB_SER_DEVICE  0x02
45195 +extern int mpc837x_usb_cfg(void);
45196 +
45197 +static int mpc837xmds_usb_cfg(void)
45198 +{
45199 +       struct device_node *np;
45200 +       const void *phy_type, *mode;
45201 +       void __iomem *bcsr_regs = NULL;
45202 +       u8 bcsr12;
45203 +       int ret;
45204 +
45205 +       ret = mpc837x_usb_cfg();
45206 +       if (ret)
45207 +               return ret;
45208 +       /* Map BCSR area */
45209 +       np = of_find_node_by_name(NULL, "bcsr");
45210 +       if (np) {
45211 +               struct resource res;
45212 +
45213 +               of_address_to_resource(np, 0, &res);
45214 +               bcsr_regs = ioremap(res.start, res.end - res.start + 1);
45215 +               of_node_put(np);
45216 +       }
45217 +       if (!bcsr_regs)
45218 +               return -1;
45219 +
45220 +       np = of_find_node_by_name(NULL, "usb");
45221 +       if (!np)
45222 +               return -ENODEV;
45223 +       phy_type = of_get_property(np, "phy_type", NULL);
45224 +       if (phy_type && !strcmp(phy_type, "ulpi")) {
45225 +               clrbits8(bcsr_regs + 12, BCSR12_USB_SER_PIN);
45226 +       } else if (phy_type && !strcmp(phy_type, "serial")) {
45227 +               mode = of_get_property(np, "dr_mode", NULL);
45228 +               bcsr12 = in_8(bcsr_regs + 12) & ~BCSR12_USB_SER_MASK;
45229 +               bcsr12 |= BCSR12_USB_SER_PIN;
45230 +               if (mode && !strcmp(mode, "peripheral"))
45231 +                       bcsr12 |= BCSR12_USB_SER_DEVICE;
45232 +               out_8(bcsr_regs + 12, bcsr12);
45233 +       } else {
45234 +               printk(KERN_ERR "USB DR: unsupported PHY\n");
45235 +       }
45236 +
45237 +       of_node_put(np);
45238 +       iounmap(bcsr_regs);
45239 +       return 0;
45240 +}
45241 +
45242 +/* ************************************************************************
45243 + *
45244 + * Setup the architecture
45245 + *
45246 + */
45247 +static void __init mpc837x_mds_setup_arch(void)
45248 +{
45249 +#ifdef CONFIG_PCI
45250 +       struct device_node *np;
45251 +#endif
45252 +
45253 +       if (ppc_md.progress)
45254 +               ppc_md.progress("mpc837x_mds_setup_arch()", 0);
45255 +
45256 +#ifdef CONFIG_PCI
45257 +       for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
45258 +               mpc83xx_add_bridge(np);
45259 +#endif
45260 +       mpc837xmds_usb_cfg();
45261 +}
45262 +
45263 +static struct of_device_id mpc837x_ids[] = {
45264 +       { .type = "soc", },
45265 +       { .compatible = "soc", },
45266 +       {},
45267 +};
45268 +
45269 +static int __init mpc837x_declare_of_platform_devices(void)
45270 +{
45271 +       /* Publish of_device */
45272 +       of_platform_bus_probe(NULL, mpc837x_ids, NULL);
45273 +
45274 +       return 0;
45275 +}
45276 +machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
45277 +
45278 +static void __init mpc837x_mds_init_IRQ(void)
45279 +{
45280 +       struct device_node *np;
45281 +
45282 +       np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
45283 +       if (!np)
45284 +               return;
45285 +
45286 +       ipic_init(np, 0);
45287 +
45288 +       /* Initialize the default interrupt mapping priorities,
45289 +        * in case the boot rom changed something on us.
45290 +        */
45291 +       ipic_set_default_priority();
45292 +}
45293 +
45294 +/*
45295 + * Called very early, MMU is off, device-tree isn't unflattened
45296 + */
45297 +static int __init mpc837x_mds_probe(void)
45298 +{
45299 +        unsigned long root = of_get_flat_dt_root();
45300 +
45301 +        return of_flat_dt_is_compatible(root, "fsl,mpc837xmds");
45302 +}
45303 +
45304 +define_machine(mpc837x_mds) {
45305 +       .name                   = "MPC837x MDS",
45306 +       .probe                  = mpc837x_mds_probe,
45307 +       .setup_arch             = mpc837x_mds_setup_arch,
45308 +       .init_IRQ               = mpc837x_mds_init_IRQ,
45309 +       .get_irq                = ipic_get_irq,
45310 +       .restart                = mpc83xx_restart,
45311 +       .time_init              = mpc83xx_time_init,
45312 +       .calibrate_decr         = generic_calibrate_decr,
45313 +       .progress               = udbg_progress,
45314 +};
45315 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc83xx.h
45316 ===================================================================
45317 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/mpc83xx.h
45318 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/mpc83xx.h
45319 @@ -14,6 +14,7 @@
45320  #define MPC83XX_SCCR_USB_DRCM_11   0x00300000
45321  #define MPC83XX_SCCR_USB_DRCM_01   0x00100000
45322  #define MPC83XX_SCCR_USB_DRCM_10   0x00200000
45323 +#define MPC837X_SCCR_USB_DRCM_11   0x00c00000
45324  
45325  /* system i/o configuration register low */
45326  #define MPC83XX_SICRL_OFFS         0x114
45327 @@ -22,6 +23,8 @@
45328  #define MPC834X_SICRL_USB1         0x20000000
45329  #define MPC831X_SICRL_USB_MASK     0x00000c00
45330  #define MPC831X_SICRL_USB_ULPI     0x00000800
45331 +#define MPC837X_SICRL_USB_MASK     0xf0000000
45332 +#define MPC837X_SICRL_USB_ULPI     0x50000000
45333  
45334  /* system i/o configuration register high */
45335  #define MPC83XX_SICRH_OFFS         0x118
45336 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/pci.c
45337 ===================================================================
45338 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/pci.c
45339 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/pci.c
45340 @@ -54,7 +54,7 @@ int __init mpc83xx_add_bridge(struct dev
45341                        " bus 0\n", dev->full_name);
45342         }
45343  
45344 -       pci_assign_all_buses = 1;
45345 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
45346         hose = pcibios_alloc_controller(dev);
45347         if (!hose)
45348                 return -ENOMEM;
45349 Index: linux-2.6.24.7/arch/powerpc/platforms/83xx/usb.c
45350 ===================================================================
45351 --- linux-2.6.24.7.orig/arch/powerpc/platforms/83xx/usb.c
45352 +++ linux-2.6.24.7/arch/powerpc/platforms/83xx/usb.c
45353 @@ -41,7 +41,7 @@ int mpc834x_usb_cfg(void)
45354         sicrl = in_be32(immap + MPC83XX_SICRL_OFFS) & ~MPC834X_SICRL_USB_MASK;
45355         sicrh = in_be32(immap + MPC83XX_SICRH_OFFS) & ~MPC834X_SICRH_USB_UTMI;
45356  
45357 -       np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr");
45358 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
45359         if (np) {
45360                 sccr |= MPC83XX_SCCR_USB_DRCM_11;  /* 1:3 */
45361  
45362 @@ -67,7 +67,7 @@ int mpc834x_usb_cfg(void)
45363                 port0_is_dr = 1;
45364                 of_node_put(np);
45365         }
45366 -       np = of_find_compatible_node(NULL, "usb", "fsl-usb2-mph");
45367 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-mph");
45368         if (np) {
45369                 sccr |= MPC83XX_SCCR_USB_MPHCM_11; /* 1:3 */
45370  
45371 @@ -111,7 +111,7 @@ int mpc831x_usb_cfg(void)
45372         const void *dr_mode;
45373  #endif
45374  
45375 -       np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr");
45376 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
45377         if (!np)
45378                 return -ENODEV;
45379         prop = of_get_property(np, "phy_type", NULL);
45380 @@ -179,3 +179,43 @@ int mpc831x_usb_cfg(void)
45381         return ret;
45382  }
45383  #endif /* CONFIG_PPC_MPC831x */
45384 +
45385 +#ifdef CONFIG_PPC_MPC837x
45386 +int mpc837x_usb_cfg(void)
45387 +{
45388 +       void __iomem *immap;
45389 +       struct device_node *np = NULL;
45390 +       const void *prop;
45391 +       int ret = 0;
45392 +
45393 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
45394 +       if (!np)
45395 +               return -ENODEV;
45396 +       prop = of_get_property(np, "phy_type", NULL);
45397 +
45398 +       if (!prop || (strcmp(prop, "ulpi") && strcmp(prop, "serial"))) {
45399 +               printk(KERN_WARNING "837x USB PHY type not supported\n");
45400 +               of_node_put(np);
45401 +               return -EINVAL;
45402 +       }
45403 +
45404 +       /* Map IMMR space for pin and clock settings */
45405 +       immap = ioremap(get_immrbase(), 0x1000);
45406 +       if (!immap) {
45407 +               of_node_put(np);
45408 +               return -ENOMEM;
45409 +       }
45410 +
45411 +       /* Configure clock */
45412 +       clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, MPC837X_SCCR_USB_DRCM_11,
45413 +                       MPC837X_SCCR_USB_DRCM_11);
45414 +
45415 +       /* Configure pin mux for ULPI/serial */
45416 +       clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USB_MASK,
45417 +                       MPC837X_SICRL_USB_ULPI);
45418 +
45419 +       iounmap(immap);
45420 +       of_node_put(np);
45421 +       return ret;
45422 +}
45423 +#endif /* CONFIG_PPC_MPC837x */
45424 Index: linux-2.6.24.7/arch/powerpc/platforms/85xx/mpc85xx_ads.c
45425 ===================================================================
45426 --- linux-2.6.24.7.orig/arch/powerpc/platforms/85xx/mpc85xx_ads.c
45427 +++ linux-2.6.24.7/arch/powerpc/platforms/85xx/mpc85xx_ads.c
45428 @@ -52,9 +52,9 @@ static void cpm2_cascade(unsigned int ir
45429  {
45430         int cascade_irq;
45431  
45432 -       while ((cascade_irq = cpm2_get_irq()) >= 0) {
45433 +       while ((cascade_irq = cpm2_get_irq()) >= 0)
45434                 generic_handle_irq(cascade_irq);
45435 -       }
45436 +
45437         desc->chip->eoi(irq);
45438  }
45439  
45440 @@ -70,13 +70,12 @@ static void __init mpc85xx_ads_pic_init(
45441  #endif
45442  
45443         np = of_find_node_by_type(np, "open-pic");
45444 -
45445 -       if (np == NULL) {
45446 +       if (!np) {
45447                 printk(KERN_ERR "Could not find open-pic node\n");
45448                 return;
45449         }
45450  
45451 -       if(of_address_to_resource(np, 0, &r)) {
45452 +       if (of_address_to_resource(np, 0, &r)) {
45453                 printk(KERN_ERR "Could not map mpic register space\n");
45454                 of_node_put(np);
45455                 return;
45456 @@ -100,6 +99,7 @@ static void __init mpc85xx_ads_pic_init(
45457         irq = irq_of_parse_and_map(np, 0);
45458  
45459         cpm2_pic_init(np);
45460 +       of_node_put(np);
45461         set_irq_chained_handler(irq, cpm2_cascade);
45462  #endif
45463  }
45464 @@ -112,7 +112,7 @@ struct cpm_pin {
45465         int port, pin, flags;
45466  };
45467  
45468 -static struct cpm_pin mpc8560_ads_pins[] = {
45469 +static const struct cpm_pin mpc8560_ads_pins[] = {
45470         /* SCC1 */
45471         {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
45472         {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45473 @@ -233,13 +233,11 @@ static struct of_device_id __initdata of
45474  
45475  static int __init declare_of_platform_devices(void)
45476  {
45477 -       if (!machine_is(mpc85xx_ads))
45478 -               return 0;
45479 -
45480         of_platform_bus_probe(NULL, of_bus_ids, NULL);
45481 +
45482         return 0;
45483  }
45484 -device_initcall(declare_of_platform_devices);
45485 +machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
45486  
45487  /*
45488   * Called very early, device-tree isn't unflattened
45489 Index: linux-2.6.24.7/arch/powerpc/platforms/85xx/mpc85xx_cds.c
45490 ===================================================================
45491 --- linux-2.6.24.7.orig/arch/powerpc/platforms/85xx/mpc85xx_cds.c
45492 +++ linux-2.6.24.7/arch/powerpc/platforms/85xx/mpc85xx_cds.c
45493 @@ -222,9 +222,6 @@ static int mpc85xx_cds_8259_attach(void)
45494         struct device_node *cascade_node = NULL;
45495         int cascade_irq;
45496  
45497 -       if (!machine_is(mpc85xx_cds))
45498 -               return 0;
45499 -
45500         /* Initialize the i8259 controller */
45501         for_each_node_by_type(np, "interrupt-controller")
45502                 if (of_device_is_compatible(np, "chrp,iic")) {
45503 @@ -262,8 +259,7 @@ static int mpc85xx_cds_8259_attach(void)
45504  
45505         return 0;
45506  }
45507 -
45508 -device_initcall(mpc85xx_cds_8259_attach);
45509 +machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
45510  
45511  #endif /* CONFIG_PPC_I8259 */
45512  
45513 Index: linux-2.6.24.7/arch/powerpc/platforms/85xx/mpc85xx_ds.c
45514 ===================================================================
45515 --- linux-2.6.24.7.orig/arch/powerpc/platforms/85xx/mpc85xx_ds.c
45516 +++ linux-2.6.24.7/arch/powerpc/platforms/85xx/mpc85xx_ds.c
45517 @@ -123,7 +123,7 @@ static int mpc85xx_exclude_device(struct
45518         struct device_node* node;
45519         struct resource rsrc;
45520  
45521 -       node = (struct device_node *)hose->arch_data;
45522 +       node = hose->dn;
45523         of_address_to_resource(node, 0, &rsrc);
45524  
45525         if ((rsrc.start & 0xfffff) == primary_phb_addr) {
45526 Index: linux-2.6.24.7/arch/powerpc/platforms/85xx/mpc85xx_mds.c
45527 ===================================================================
45528 --- linux-2.6.24.7.orig/arch/powerpc/platforms/85xx/mpc85xx_mds.c
45529 +++ linux-2.6.24.7/arch/powerpc/platforms/85xx/mpc85xx_mds.c
45530 @@ -30,9 +30,9 @@
45531  #include <linux/initrd.h>
45532  #include <linux/module.h>
45533  #include <linux/fsl_devices.h>
45534 +#include <linux/of_platform.h>
45535 +#include <linux/of_device.h>
45536  
45537 -#include <asm/of_device.h>
45538 -#include <asm/of_platform.h>
45539  #include <asm/system.h>
45540  #include <asm/atomic.h>
45541  #include <asm/time.h>
45542 @@ -144,15 +144,12 @@ static struct of_device_id mpc85xx_ids[]
45543  
45544  static int __init mpc85xx_publish_devices(void)
45545  {
45546 -       if (!machine_is(mpc85xx_mds))
45547 -               return 0;
45548 -
45549         /* Publish the QE devices */
45550 -       of_platform_bus_probe(NULL,mpc85xx_ids,NULL);
45551 +       of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
45552  
45553         return 0;
45554  }
45555 -device_initcall(mpc85xx_publish_devices);
45556 +machine_device_initcall(mpc85xx_mds, mpc85xx_publish_devices);
45557  
45558  static void __init mpc85xx_mds_pic_init(void)
45559  {
45560 Index: linux-2.6.24.7/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
45561 ===================================================================
45562 --- linux-2.6.24.7.orig/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
45563 +++ linux-2.6.24.7/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
45564 @@ -34,9 +34,24 @@
45565  
45566  #include <asm/mpic.h>
45567  
45568 +#include <linux/of_platform.h>
45569  #include <sysdev/fsl_pci.h>
45570  #include <sysdev/fsl_soc.h>
45571  
45572 +static struct of_device_id __initdata mpc8610_ids[] = {
45573 +       { .compatible = "fsl,mpc8610-immr", },
45574 +       {}
45575 +};
45576 +
45577 +static int __init mpc8610_declare_of_platform_devices(void)
45578 +{
45579 +       /* Without this call, the SSI device driver won't get probed. */
45580 +       of_platform_bus_probe(NULL, mpc8610_ids, NULL);
45581 +
45582 +       return 0;
45583 +}
45584 +machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
45585 +
45586  void __init
45587  mpc86xx_hpcd_init_irq(void)
45588  {
45589 @@ -124,7 +139,7 @@ static void __devinit quirk_uli5229(stru
45590  static void __devinit final_uli5288(struct pci_dev *dev)
45591  {
45592         struct pci_controller *hose = pci_bus_to_host(dev->bus);
45593 -       struct device_node *hosenode = hose ? hose->arch_data : NULL;
45594 +       struct device_node *hosenode = hose ? hose->dn : NULL;
45595         struct of_irq oirq;
45596         int virq, pin = 2;
45597         u32 laddr[3];
45598 Index: linux-2.6.24.7/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
45599 ===================================================================
45600 --- linux-2.6.24.7.orig/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
45601 +++ linux-2.6.24.7/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
45602 @@ -18,6 +18,7 @@
45603  #include <linux/kdev_t.h>
45604  #include <linux/delay.h>
45605  #include <linux/seq_file.h>
45606 +#include <linux/of_platform.h>
45607  
45608  #include <asm/system.h>
45609  #include <asm/time.h>
45610 @@ -116,7 +117,7 @@ static int mpc86xx_exclude_device(struct
45611         struct device_node* node;       
45612         struct resource rsrc;
45613  
45614 -       node = (struct device_node *)hose->arch_data;
45615 +       node = hose->dn;
45616         of_address_to_resource(node, 0, &rsrc);
45617  
45618         if ((rsrc.start & 0xfffff) == 0x8000) {
45619 @@ -212,6 +213,19 @@ mpc86xx_time_init(void)
45620         return 0;
45621  }
45622  
45623 +static __initdata struct of_device_id of_bus_ids[] = {
45624 +       { .compatible = "simple-bus", },
45625 +       {},
45626 +};
45627 +
45628 +static int __init declare_of_platform_devices(void)
45629 +{
45630 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45631 +
45632 +       return 0;
45633 +}
45634 +machine_device_initcall(mpc86xx_hpcn, declare_of_platform_devices);
45635 +
45636  define_machine(mpc86xx_hpcn) {
45637         .name                   = "MPC86xx HPCN",
45638         .probe                  = mpc86xx_hpcn_probe,
45639 Index: linux-2.6.24.7/arch/powerpc/platforms/8xx/Kconfig
45640 ===================================================================
45641 --- linux-2.6.24.7.orig/arch/powerpc/platforms/8xx/Kconfig
45642 +++ linux-2.6.24.7/arch/powerpc/platforms/8xx/Kconfig
45643 @@ -18,6 +18,7 @@ config MPC8XXFADS
45644  config MPC86XADS
45645         bool "MPC86XADS"
45646         select CPM1
45647 +       select PPC_CPM_NEW_BINDING
45648         help
45649           MPC86x Application Development System by Freescale Semiconductor.
45650           The MPC86xADS is meant to serve as a platform for s/w and h/w
45651 @@ -43,6 +44,15 @@ config PPC_EP88XC
45652           This board is also resold by Freescale as the QUICCStart
45653           MPC885 Evaluation System and/or the CWH-PPC-885XN-VE.
45654  
45655 +config PPC_ADDER875
45656 +       bool "Analogue & Micro Adder 875"
45657 +       select CPM1
45658 +       select PPC_CPM_NEW_BINDING
45659 +       select REDBOOT
45660 +       help
45661 +         This enables support for the Analogue & Micro Adder 875
45662 +         board.
45663 +
45664  endchoice
45665  
45666  menu "Freescale Ethernet driver platform-specific options"
45667 Index: linux-2.6.24.7/arch/powerpc/platforms/8xx/Makefile
45668 ===================================================================
45669 --- linux-2.6.24.7.orig/arch/powerpc/platforms/8xx/Makefile
45670 +++ linux-2.6.24.7/arch/powerpc/platforms/8xx/Makefile
45671 @@ -5,3 +5,4 @@ obj-$(CONFIG_PPC_8xx)     += m8xx_setup.o
45672  obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
45673  obj-$(CONFIG_MPC86XADS)   += mpc86xads_setup.o
45674  obj-$(CONFIG_PPC_EP88XC)  += ep88xc.o
45675 +obj-$(CONFIG_PPC_ADDER875) += adder875.o
45676 Index: linux-2.6.24.7/arch/powerpc/platforms/8xx/adder875.c
45677 ===================================================================
45678 --- /dev/null
45679 +++ linux-2.6.24.7/arch/powerpc/platforms/8xx/adder875.c
45680 @@ -0,0 +1,118 @@
45681 +/* Analogue & Micro Adder MPC875 board support
45682 + *
45683 + * Author: Scott Wood <scottwood@freescale.com>
45684 + *
45685 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
45686 + *
45687 + * This program is free software; you can redistribute  it and/or modify
45688 + * it under the terms of the GNU General Public License, version 2, as
45689 + * published by the Free Software Foundation.
45690 + */
45691 +
45692 +#include <linux/init.h>
45693 +#include <linux/fs_enet_pd.h>
45694 +#include <linux/of_platform.h>
45695 +
45696 +#include <asm/time.h>
45697 +#include <asm/machdep.h>
45698 +#include <asm/commproc.h>
45699 +#include <asm/fs_pd.h>
45700 +#include <asm/udbg.h>
45701 +#include <asm/prom.h>
45702 +
45703 +#include <sysdev/commproc.h>
45704 +
45705 +struct cpm_pin {
45706 +       int port, pin, flags;
45707 +};
45708 +
45709 +static __initdata struct cpm_pin adder875_pins[] = {
45710 +       /* SMC1 */
45711 +       {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
45712 +       {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
45713 +
45714 +       /* MII1 */
45715 +       {CPM_PORTA, 0, CPM_PIN_INPUT},
45716 +       {CPM_PORTA, 1, CPM_PIN_INPUT},
45717 +       {CPM_PORTA, 2, CPM_PIN_INPUT},
45718 +       {CPM_PORTA, 3, CPM_PIN_INPUT},
45719 +       {CPM_PORTA, 4, CPM_PIN_OUTPUT},
45720 +       {CPM_PORTA, 10, CPM_PIN_OUTPUT},
45721 +       {CPM_PORTA, 11, CPM_PIN_OUTPUT},
45722 +       {CPM_PORTB, 19, CPM_PIN_INPUT},
45723 +       {CPM_PORTB, 31, CPM_PIN_INPUT},
45724 +       {CPM_PORTC, 12, CPM_PIN_INPUT},
45725 +       {CPM_PORTC, 13, CPM_PIN_INPUT},
45726 +       {CPM_PORTE, 30, CPM_PIN_OUTPUT},
45727 +       {CPM_PORTE, 31, CPM_PIN_OUTPUT},
45728 +
45729 +       /* MII2 */
45730 +       {CPM_PORTE, 14, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45731 +       {CPM_PORTE, 15, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45732 +       {CPM_PORTE, 16, CPM_PIN_OUTPUT},
45733 +       {CPM_PORTE, 17, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45734 +       {CPM_PORTE, 18, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45735 +       {CPM_PORTE, 19, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45736 +       {CPM_PORTE, 20, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45737 +       {CPM_PORTE, 21, CPM_PIN_OUTPUT},
45738 +       {CPM_PORTE, 22, CPM_PIN_OUTPUT},
45739 +       {CPM_PORTE, 23, CPM_PIN_OUTPUT},
45740 +       {CPM_PORTE, 24, CPM_PIN_OUTPUT},
45741 +       {CPM_PORTE, 25, CPM_PIN_OUTPUT},
45742 +       {CPM_PORTE, 26, CPM_PIN_OUTPUT},
45743 +       {CPM_PORTE, 27, CPM_PIN_OUTPUT},
45744 +       {CPM_PORTE, 28, CPM_PIN_OUTPUT},
45745 +       {CPM_PORTE, 29, CPM_PIN_OUTPUT},
45746 +};
45747 +
45748 +static void __init init_ioports(void)
45749 +{
45750 +       int i;
45751 +
45752 +       for (i = 0; i < ARRAY_SIZE(adder875_pins); i++) {
45753 +               const struct cpm_pin *pin = &adder875_pins[i];
45754 +               cpm1_set_pin(pin->port, pin->pin, pin->flags);
45755 +       }
45756 +
45757 +       cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
45758 +
45759 +       /* Set FEC1 and FEC2 to MII mode */
45760 +       clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180);
45761 +}
45762 +
45763 +static void __init adder875_setup(void)
45764 +{
45765 +       cpm_reset();
45766 +       init_ioports();
45767 +}
45768 +
45769 +static int __init adder875_probe(void)
45770 +{
45771 +       unsigned long root = of_get_flat_dt_root();
45772 +       return of_flat_dt_is_compatible(root, "analogue-and-micro,adder875");
45773 +}
45774 +
45775 +static __initdata struct of_device_id of_bus_ids[] = {
45776 +       { .compatible = "simple-bus", },
45777 +       {},
45778 +};
45779 +
45780 +static int __init declare_of_platform_devices(void)
45781 +{
45782 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45783 +       return 0;
45784 +}
45785 +machine_device_initcall(adder875, declare_of_platform_devices);
45786 +
45787 +define_machine(adder875) {
45788 +       .name = "Adder MPC875",
45789 +       .probe = adder875_probe,
45790 +       .setup_arch = adder875_setup,
45791 +       .init_IRQ = m8xx_pic_init,
45792 +       .get_irq = mpc8xx_get_irq,
45793 +       .restart = mpc8xx_restart,
45794 +       .calibrate_decr = generic_calibrate_decr,
45795 +       .set_rtc_time = mpc8xx_set_rtc_time,
45796 +       .get_rtc_time = mpc8xx_get_rtc_time,
45797 +       .progress = udbg_progress,
45798 +};
45799 Index: linux-2.6.24.7/arch/powerpc/platforms/8xx/ep88xc.c
45800 ===================================================================
45801 --- linux-2.6.24.7.orig/arch/powerpc/platforms/8xx/ep88xc.c
45802 +++ linux-2.6.24.7/arch/powerpc/platforms/8xx/ep88xc.c
45803 @@ -155,12 +155,11 @@ static struct of_device_id __initdata of
45804  static int __init declare_of_platform_devices(void)
45805  {
45806         /* Publish the QE devices */
45807 -       if (machine_is(ep88xc))
45808 -               of_platform_bus_probe(NULL, of_bus_ids, NULL);
45809 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45810  
45811         return 0;
45812  }
45813 -device_initcall(declare_of_platform_devices);
45814 +machine_device_initcall(ep88xc, declare_of_platform_devices);
45815  
45816  define_machine(ep88xc) {
45817         .name = "Embedded Planet EP88xC",
45818 Index: linux-2.6.24.7/arch/powerpc/platforms/8xx/m8xx_setup.c
45819 ===================================================================
45820 --- linux-2.6.24.7.orig/arch/powerpc/platforms/8xx/m8xx_setup.c
45821 +++ linux-2.6.24.7/arch/powerpc/platforms/8xx/m8xx_setup.c
45822 @@ -120,7 +120,7 @@ void __init mpc8xx_calibrate_decr(void)
45823         ppc_tb_freq /= 16;
45824         ppc_proc_freq = 50000000;
45825         if (!get_freq("clock-frequency", &ppc_proc_freq))
45826 -               printk(KERN_ERR "WARNING: Estimating processor frequency"
45827 +               printk(KERN_ERR "WARNING: Estimating processor frequency "
45828                                 "(not found)\n");
45829  
45830         printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq);
45831 Index: linux-2.6.24.7/arch/powerpc/platforms/8xx/mpc86xads.h
45832 ===================================================================
45833 --- linux-2.6.24.7.orig/arch/powerpc/platforms/8xx/mpc86xads.h
45834 +++ linux-2.6.24.7/arch/powerpc/platforms/8xx/mpc86xads.h
45835 @@ -15,27 +15,6 @@
45836  #ifndef __ASM_MPC86XADS_H__
45837  #define __ASM_MPC86XADS_H__
45838  
45839 -#include <sysdev/fsl_soc.h>
45840 -
45841 -/* U-Boot maps BCSR to 0xff080000 */
45842 -#define BCSR_ADDR              ((uint)0xff080000)
45843 -#define BCSR_SIZE              ((uint)32)
45844 -#define BCSR0                  ((uint)(BCSR_ADDR + 0x00))
45845 -#define BCSR1                  ((uint)(BCSR_ADDR + 0x04))
45846 -#define BCSR2                  ((uint)(BCSR_ADDR + 0x08))
45847 -#define BCSR3                  ((uint)(BCSR_ADDR + 0x0c))
45848 -#define BCSR4                  ((uint)(BCSR_ADDR + 0x10))
45849 -
45850 -#define CFG_PHYDEV_ADDR                ((uint)0xff0a0000)
45851 -#define BCSR5                  ((uint)(CFG_PHYDEV_ADDR + 0x300))
45852 -
45853 -#define MPC8xx_CPM_OFFSET      (0x9c0)
45854 -#define CPM_MAP_ADDR           (get_immrbase() + MPC8xx_CPM_OFFSET)
45855 -#define CPM_IRQ_OFFSET         16     // for compability with cpm_uart driver
45856 -
45857 -#define PCMCIA_MEM_ADDR                ((uint)0xff020000)
45858 -#define PCMCIA_MEM_SIZE                ((uint)(64 * 1024))
45859 -
45860  /* Bits of interest in the BCSRs.
45861   */
45862  #define BCSR1_ETHEN            ((uint)0x20000000)
45863 @@ -64,28 +43,5 @@
45864  #define BCSR5_MII1_EN          0x02
45865  #define BCSR5_MII1_RST         0x01
45866  
45867 -/* Interrupt level assignments */
45868 -#define PHY_INTERRUPT  SIU_IRQ7        /* PHY link change interrupt */
45869 -#define SIU_INT_FEC1   SIU_LEVEL1      /* FEC1 interrupt */
45870 -#define FEC_INTERRUPT  SIU_INT_FEC1    /* FEC interrupt */
45871 -
45872 -/* We don't use the 8259 */
45873 -#define NR_8259_INTS   0
45874 -
45875 -/* CPM Ethernet through SCC1 */
45876 -#define PA_ENET_RXD     ((ushort)0x0001)
45877 -#define PA_ENET_TXD     ((ushort)0x0002)
45878 -#define PA_ENET_TCLK    ((ushort)0x0100)
45879 -#define PA_ENET_RCLK    ((ushort)0x0200)
45880 -#define PB_ENET_TENA    ((uint)0x00001000)
45881 -#define PC_ENET_CLSN    ((ushort)0x0010)
45882 -#define PC_ENET_RENA    ((ushort)0x0020)
45883 -
45884 -/* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
45885 - * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
45886 - */
45887 -#define SICR_ENET_MASK  ((uint)0x000000ff)
45888 -#define SICR_ENET_CLKRT ((uint)0x0000002c)
45889 -
45890  #endif /* __ASM_MPC86XADS_H__ */
45891  #endif /* __KERNEL__ */
45892 Index: linux-2.6.24.7/arch/powerpc/platforms/8xx/mpc86xads_setup.c
45893 ===================================================================
45894 --- linux-2.6.24.7.orig/arch/powerpc/platforms/8xx/mpc86xads_setup.c
45895 +++ linux-2.6.24.7/arch/powerpc/platforms/8xx/mpc86xads_setup.c
45896 @@ -6,264 +6,133 @@
45897   *
45898   * Copyright 2005 MontaVista Software Inc.
45899   *
45900 + * Heavily modified by Scott Wood <scottwood@freescale.com>
45901 + * Copyright 2007 Freescale Semiconductor, Inc.
45902 + *
45903   * This file is licensed under the terms of the GNU General Public License
45904   * version 2. This program is licensed "as is" without any warranty of any
45905   * kind, whether express or implied.
45906   */
45907  
45908  #include <linux/init.h>
45909 -#include <linux/module.h>
45910 -#include <linux/param.h>
45911 -#include <linux/string.h>
45912 -#include <linux/ioport.h>
45913 -#include <linux/device.h>
45914 -#include <linux/delay.h>
45915 -#include <linux/root_dev.h>
45916 -
45917 -#include <linux/fs_enet_pd.h>
45918 -#include <linux/fs_uart_pd.h>
45919 -#include <linux/mii.h>
45920 +#include <linux/of_platform.h>
45921  
45922 -#include <asm/delay.h>
45923  #include <asm/io.h>
45924  #include <asm/machdep.h>
45925 -#include <asm/page.h>
45926 -#include <asm/processor.h>
45927  #include <asm/system.h>
45928  #include <asm/time.h>
45929  #include <asm/mpc8xx.h>
45930  #include <asm/8xx_immap.h>
45931  #include <asm/commproc.h>
45932  #include <asm/fs_pd.h>
45933 -#include <asm/prom.h>
45934 +#include <asm/udbg.h>
45935  
45936  #include <sysdev/commproc.h>
45937  
45938 -static void init_smc1_uart_ioports(struct fs_uart_platform_info* fpi);
45939 -static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi);
45940 -static void init_scc1_ioports(struct fs_platform_info* ptr);
45941 -
45942 -void __init mpc86xads_board_setup(void)
45943 -{
45944 -       cpm8xx_t *cp;
45945 -       unsigned int *bcsr_io;
45946 -       u8 tmpval8;
45947 -
45948 -       bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
45949 -       cp = (cpm8xx_t *)immr_map(im_cpm);
45950 +#include "mpc86xads.h"
45951  
45952 -       if (bcsr_io == NULL) {
45953 -               printk(KERN_CRIT "Could not remap BCSR\n");
45954 -               return;
45955 -       }
45956 -#ifdef CONFIG_SERIAL_CPM_SMC1
45957 -       clrbits32(bcsr_io, BCSR1_RS232EN_1);
45958 -       clrbits32(&cp->cp_simode, 0xe0000000 >> 17);    /* brg1 */
45959 -       tmpval8 = in_8(&(cp->cp_smc[0].smc_smcm)) | (SMCM_RX | SMCM_TX);
45960 -       out_8(&(cp->cp_smc[0].smc_smcm), tmpval8);
45961 -       clrbits16(&cp->cp_smc[0].smc_smcmr, SMCMR_REN | SMCMR_TEN);
45962 -#else
45963 -       setbits32(bcsr_io,BCSR1_RS232EN_1);
45964 -       out_be16(&cp->cp_smc[0].smc_smcmr, 0);
45965 -       out_8(&cp->cp_smc[0].smc_smce, 0);
45966 -#endif
45967 -
45968 -#ifdef CONFIG_SERIAL_CPM_SMC2
45969 -       clrbits32(bcsr_io,BCSR1_RS232EN_2);
45970 -       clrbits32(&cp->cp_simode, 0xe0000000 >> 1);
45971 -       setbits32(&cp->cp_simode, 0x20000000 >> 1);     /* brg2 */
45972 -       tmpval8 = in_8(&(cp->cp_smc[1].smc_smcm)) | (SMCM_RX | SMCM_TX);
45973 -       out_8(&(cp->cp_smc[1].smc_smcm), tmpval8);
45974 -       clrbits16(&cp->cp_smc[1].smc_smcmr, SMCMR_REN | SMCMR_TEN);
45975 -
45976 -       init_smc2_uart_ioports(0);
45977 -#else
45978 -       setbits32(bcsr_io,BCSR1_RS232EN_2);
45979 -       out_be16(&cp->cp_smc[1].smc_smcmr, 0);
45980 -       out_8(&cp->cp_smc[1].smc_smce, 0);
45981 -#endif
45982 -       immr_unmap(cp);
45983 -       iounmap(bcsr_io);
45984 -}
45985 +struct cpm_pin {
45986 +       int port, pin, flags;
45987 +};
45988  
45989 +static struct cpm_pin mpc866ads_pins[] = {
45990 +       /* SMC1 */
45991 +       {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
45992 +       {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
45993 +
45994 +       /* SMC2 */
45995 +       {CPM_PORTB, 21, CPM_PIN_INPUT}, /* RX */
45996 +       {CPM_PORTB, 20, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
45997 +
45998 +       /* SCC1 */
45999 +       {CPM_PORTA, 6, CPM_PIN_INPUT}, /* CLK1 */
46000 +       {CPM_PORTA, 7, CPM_PIN_INPUT}, /* CLK2 */
46001 +       {CPM_PORTA, 14, CPM_PIN_INPUT}, /* TX */
46002 +       {CPM_PORTA, 15, CPM_PIN_INPUT}, /* RX */
46003 +       {CPM_PORTB, 19, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TENA */
46004 +       {CPM_PORTC, 10, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO}, /* RENA */
46005 +       {CPM_PORTC, 11, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO}, /* CLSN */
46006 +
46007 +       /* MII */
46008 +       {CPM_PORTD, 3, CPM_PIN_OUTPUT},
46009 +       {CPM_PORTD, 4, CPM_PIN_OUTPUT},
46010 +       {CPM_PORTD, 5, CPM_PIN_OUTPUT},
46011 +       {CPM_PORTD, 6, CPM_PIN_OUTPUT},
46012 +       {CPM_PORTD, 7, CPM_PIN_OUTPUT},
46013 +       {CPM_PORTD, 8, CPM_PIN_OUTPUT},
46014 +       {CPM_PORTD, 9, CPM_PIN_OUTPUT},
46015 +       {CPM_PORTD, 10, CPM_PIN_OUTPUT},
46016 +       {CPM_PORTD, 11, CPM_PIN_OUTPUT},
46017 +       {CPM_PORTD, 12, CPM_PIN_OUTPUT},
46018 +       {CPM_PORTD, 13, CPM_PIN_OUTPUT},
46019 +       {CPM_PORTD, 14, CPM_PIN_OUTPUT},
46020 +       {CPM_PORTD, 15, CPM_PIN_OUTPUT},
46021 +};
46022  
46023 -static void init_fec1_ioports(struct fs_platform_info* ptr)
46024 +static void __init init_ioports(void)
46025  {
46026 -       iop8xx_t *io_port = (iop8xx_t *)immr_map(im_ioport);
46027 +       int i;
46028  
46029 -       /* configure FEC1 pins  */
46030 +       for (i = 0; i < ARRAY_SIZE(mpc866ads_pins); i++) {
46031 +               struct cpm_pin *pin = &mpc866ads_pins[i];
46032 +               cpm1_set_pin(pin->port, pin->pin, pin->flags);
46033 +       }
46034  
46035 -       setbits16(&io_port->iop_pdpar, 0x1fff);
46036 -       setbits16(&io_port->iop_pddir, 0x1fff);
46037 +       cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
46038 +       cpm1_clk_setup(CPM_CLK_SMC2, CPM_BRG2, CPM_CLK_RTX);
46039 +       cpm1_clk_setup(CPM_CLK_SCC1, CPM_CLK1, CPM_CLK_TX);
46040 +       cpm1_clk_setup(CPM_CLK_SCC1, CPM_CLK2, CPM_CLK_RX);
46041  
46042 -       immr_unmap(io_port);
46043 +       /* Set FEC1 and FEC2 to MII mode */
46044 +       clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180);
46045  }
46046  
46047 -void init_fec_ioports(struct fs_platform_info *fpi)
46048 +static void __init mpc86xads_setup_arch(void)
46049  {
46050 -       int fec_no = fs_get_fec_index(fpi->fs_no);
46051 +       struct device_node *np;
46052 +       u32 __iomem *bcsr_io;
46053 +
46054 +       cpm_reset();
46055 +       init_ioports();
46056  
46057 -       switch (fec_no) {
46058 -       case 0:
46059 -               init_fec1_ioports(fpi);
46060 -               break;
46061 -       default:
46062 -               printk(KERN_ERR "init_fec_ioports: invalid FEC number\n");
46063 +       np = of_find_compatible_node(NULL, NULL, "fsl,mpc866ads-bcsr");
46064 +       if (!np) {
46065 +               printk(KERN_CRIT "Could not find fsl,mpc866ads-bcsr node\n");
46066                 return;
46067         }
46068 -}
46069  
46070 -static void init_scc1_ioports(struct fs_platform_info* fpi)
46071 -{
46072 -       unsigned *bcsr_io;
46073 -       iop8xx_t *io_port;
46074 -       cpm8xx_t *cp;
46075 -
46076 -       bcsr_io = ioremap(BCSR_ADDR, BCSR_SIZE);
46077 -       io_port = (iop8xx_t *)immr_map(im_ioport);
46078 -       cp = (cpm8xx_t *)immr_map(im_cpm);
46079 +       bcsr_io = of_iomap(np, 0);
46080 +       of_node_put(np);
46081  
46082         if (bcsr_io == NULL) {
46083                 printk(KERN_CRIT "Could not remap BCSR\n");
46084                 return;
46085         }
46086  
46087 -       /* Configure port A pins for Txd and Rxd.
46088 -        */
46089 -       setbits16(&io_port->iop_papar, PA_ENET_RXD | PA_ENET_TXD);
46090 -       clrbits16(&io_port->iop_padir, PA_ENET_RXD | PA_ENET_TXD);
46091 -       clrbits16(&io_port->iop_paodr, PA_ENET_TXD);
46092 -
46093 -       /* Configure port C pins to enable CLSN and RENA.
46094 -        */
46095 -       clrbits16(&io_port->iop_pcpar, PC_ENET_CLSN | PC_ENET_RENA);
46096 -       clrbits16(&io_port->iop_pcdir, PC_ENET_CLSN | PC_ENET_RENA);
46097 -       setbits16(&io_port->iop_pcso, PC_ENET_CLSN | PC_ENET_RENA);
46098 -
46099 -       /* Configure port A for TCLK and RCLK.
46100 -        */
46101 -       setbits16(&io_port->iop_papar, PA_ENET_TCLK | PA_ENET_RCLK);
46102 -        clrbits16(&io_port->iop_padir, PA_ENET_TCLK | PA_ENET_RCLK);
46103 -        clrbits32(&cp->cp_pbpar, PB_ENET_TENA);
46104 -        clrbits32(&cp->cp_pbdir, PB_ENET_TENA);
46105 -
46106 -       /* Configure Serial Interface clock routing.
46107 -        * First, clear all SCC bits to zero, then set the ones we want.
46108 -        */
46109 -       clrbits32(&cp->cp_sicr, SICR_ENET_MASK);
46110 -       setbits32(&cp->cp_sicr, SICR_ENET_CLKRT);
46111 -
46112 -       /* In the original SCC enet driver the following code is placed at
46113 -          the end of the initialization */
46114 -        setbits32(&cp->cp_pbpar, PB_ENET_TENA);
46115 -        setbits32(&cp->cp_pbdir, PB_ENET_TENA);
46116 -
46117 -       clrbits32(bcsr_io+1, BCSR1_ETHEN);
46118 +       clrbits32(bcsr_io, BCSR1_RS232EN_1 | BCSR1_RS232EN_2 | BCSR1_ETHEN);
46119         iounmap(bcsr_io);
46120 -       immr_unmap(cp);
46121 -       immr_unmap(io_port);
46122 -}
46123 -
46124 -void init_scc_ioports(struct fs_platform_info *fpi)
46125 -{
46126 -       int scc_no = fs_get_scc_index(fpi->fs_no);
46127 -
46128 -       switch (scc_no) {
46129 -       case 0:
46130 -               init_scc1_ioports(fpi);
46131 -               break;
46132 -       default:
46133 -               printk(KERN_ERR "init_scc_ioports: invalid SCC number\n");
46134 -               return;
46135 -       }
46136  }
46137  
46138 -
46139 -
46140 -static void init_smc1_uart_ioports(struct fs_uart_platform_info* ptr)
46141 +static int __init mpc86xads_probe(void)
46142  {
46143 -        unsigned *bcsr_io;
46144 -       cpm8xx_t *cp = (cpm8xx_t *)immr_map(im_cpm);
46145 -
46146 -       setbits32(&cp->cp_pbpar, 0x000000c0);
46147 -       clrbits32(&cp->cp_pbdir, 0x000000c0);
46148 -       clrbits16(&cp->cp_pbodr, 0x00c0);
46149 -       immr_unmap(cp);
46150 -
46151 -        bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
46152 -
46153 -        if (bcsr_io == NULL) {
46154 -                printk(KERN_CRIT "Could not remap BCSR1\n");
46155 -                return;
46156 -        }
46157 -        clrbits32(bcsr_io,BCSR1_RS232EN_1);
46158 -        iounmap(bcsr_io);
46159 +       unsigned long root = of_get_flat_dt_root();
46160 +       return of_flat_dt_is_compatible(root, "fsl,mpc866ads");
46161  }
46162  
46163 -static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi)
46164 -{
46165 -        unsigned *bcsr_io;
46166 -       cpm8xx_t *cp = (cpm8xx_t *)immr_map(im_cpm);
46167 -
46168 -       setbits32(&cp->cp_pbpar, 0x00000c00);
46169 -       clrbits32(&cp->cp_pbdir, 0x00000c00);
46170 -       clrbits16(&cp->cp_pbodr, 0x0c00);
46171 -       immr_unmap(cp);
46172 -
46173 -        bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
46174 -
46175 -        if (bcsr_io == NULL) {
46176 -                printk(KERN_CRIT "Could not remap BCSR1\n");
46177 -                return;
46178 -        }
46179 -        clrbits32(bcsr_io,BCSR1_RS232EN_2);
46180 -        iounmap(bcsr_io);
46181 -}
46182 +static struct of_device_id __initdata of_bus_ids[] = {
46183 +       { .name = "soc", },
46184 +       { .name = "cpm", },
46185 +       { .name = "localbus", },
46186 +       {},
46187 +};
46188  
46189 -void init_smc_ioports(struct fs_uart_platform_info *data)
46190 +static int __init declare_of_platform_devices(void)
46191  {
46192 -       int smc_no = fs_uart_id_fsid2smc(data->fs_no);
46193 -
46194 -       switch (smc_no) {
46195 -       case 0:
46196 -               init_smc1_uart_ioports(data);
46197 -               data->brg = data->clk_rx;
46198 -               break;
46199 -       case 1:
46200 -               init_smc2_uart_ioports(data);
46201 -               data->brg = data->clk_rx;
46202 -               break;
46203 -       default:
46204 -               printk(KERN_ERR "init_scc_ioports: invalid SCC number\n");
46205 -               return;
46206 -       }
46207 -}
46208 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
46209  
46210 -int platform_device_skip(const char *model, int id)
46211 -{
46212         return 0;
46213  }
46214 -
46215 -static void __init mpc86xads_setup_arch(void)
46216 -{
46217 -       cpm_reset();
46218 -
46219 -       mpc86xads_board_setup();
46220 -
46221 -       ROOT_DEV = Root_NFS;
46222 -}
46223 -
46224 -static int __init mpc86xads_probe(void)
46225 -{
46226 -       char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
46227 -                                         "model", NULL);
46228 -       if (model == NULL)
46229 -               return 0;
46230 -       if (strcmp(model, "MPC866ADS"))
46231 -               return 0;
46232 -
46233 -       return 1;
46234 -}
46235 +machine_device_initcall(mpc86x_ads, declare_of_platform_devices);
46236  
46237  define_machine(mpc86x_ads) {
46238         .name                   = "MPC86x ADS",
46239 @@ -275,4 +144,5 @@ define_machine(mpc86x_ads) {
46240         .calibrate_decr         = mpc8xx_calibrate_decr,
46241         .set_rtc_time           = mpc8xx_set_rtc_time,
46242         .get_rtc_time           = mpc8xx_get_rtc_time,
46243 +       .progress               = udbg_progress,
46244  };
46245 Index: linux-2.6.24.7/arch/powerpc/platforms/8xx/mpc885ads_setup.c
46246 ===================================================================
46247 --- linux-2.6.24.7.orig/arch/powerpc/platforms/8xx/mpc885ads_setup.c
46248 +++ linux-2.6.24.7/arch/powerpc/platforms/8xx/mpc885ads_setup.c
46249 @@ -264,12 +264,11 @@ static struct of_device_id __initdata of
46250  static int __init declare_of_platform_devices(void)
46251  {
46252         /* Publish the QE devices */
46253 -       if (machine_is(mpc885_ads))
46254 -               of_platform_bus_probe(NULL, of_bus_ids, NULL);
46255 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
46256  
46257         return 0;
46258  }
46259 -device_initcall(declare_of_platform_devices);
46260 +machine_device_initcall(mpc885_ads, declare_of_platform_devices);
46261  
46262  define_machine(mpc885_ads) {
46263         .name                   = "Freescale MPC885 ADS",
46264 Index: linux-2.6.24.7/arch/powerpc/platforms/Kconfig
46265 ===================================================================
46266 --- linux-2.6.24.7.orig/arch/powerpc/platforms/Kconfig
46267 +++ linux-2.6.24.7/arch/powerpc/platforms/Kconfig
46268 @@ -22,6 +22,7 @@ config PPC_83xx
46269         depends on 6xx
46270         select FSL_SOC
46271         select 83xx
46272 +       select IPIC
46273         select WANT_DEVICE_TREE
46274  
46275  config PPC_86xx
46276 @@ -80,6 +81,10 @@ config XICS
46277         bool
46278         default y
46279  
46280 +config IPIC
46281 +       bool
46282 +       default n
46283 +
46284  config MPIC
46285         bool
46286         default n
46287 @@ -265,6 +270,7 @@ config TAU_AVERAGE
46288  config QUICC_ENGINE
46289         bool
46290         select PPC_LIB_RHEAP
46291 +       select CRC32
46292         help
46293           The QUICC Engine (QE) is a new generation of communications
46294           coprocessors on Freescale embedded CPUs (akin to CPM in older chips).
46295 @@ -315,6 +321,12 @@ config FSL_ULI1575
46296  config CPM
46297         bool
46298  
46299 +config OF_RTC
46300 +       bool
46301 +       help
46302 +         Uses information from the OF or flattened device tree to instatiate
46303 +         platform devices for direct mapped RTC chips like the DS1742 or DS1743.
46304 +
46305  source "arch/powerpc/sysdev/bestcomm/Kconfig"
46306  
46307  endmenu
46308 Index: linux-2.6.24.7/arch/powerpc/platforms/Kconfig.cputype
46309 ===================================================================
46310 --- linux-2.6.24.7.orig/arch/powerpc/platforms/Kconfig.cputype
46311 +++ linux-2.6.24.7/arch/powerpc/platforms/Kconfig.cputype
46312 @@ -43,6 +43,7 @@ config 40x
46313         bool "AMCC 40x"
46314         select PPC_DCR_NATIVE
46315         select WANT_DEVICE_TREE
46316 +       select PPC_UDBG_16550
46317  
46318  config 44x
46319         bool "AMCC 44x"
46320 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/Makefile
46321 ===================================================================
46322 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/Makefile
46323 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/Makefile
46324 @@ -20,7 +20,7 @@ spu-manage-$(CONFIG_PPC_CELL_NATIVE)  += 
46325  
46326  obj-$(CONFIG_SPU_BASE)                 += spu_callbacks.o spu_base.o \
46327                                            spu_notify.o \
46328 -                                          spu_syscalls.o \
46329 +                                          spu_syscalls.o spu_fault.o \
46330                                            $(spu-priv1-y) \
46331                                            $(spu-manage-y) \
46332                                            spufs/
46333 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/cbe_cpufreq.c
46334 ===================================================================
46335 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/cbe_cpufreq.c
46336 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/cbe_cpufreq.c
46337 @@ -21,8 +21,9 @@
46338   */
46339  
46340  #include <linux/cpufreq.h>
46341 +#include <linux/of_platform.h>
46342 +
46343  #include <asm/machdep.h>
46344 -#include <asm/of_platform.h>
46345  #include <asm/prom.h>
46346  #include <asm/cell-regs.h>
46347  #include "cbe_cpufreq.h"
46348 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
46349 ===================================================================
46350 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
46351 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
46352 @@ -23,7 +23,8 @@
46353  #include <linux/kernel.h>
46354  #include <linux/types.h>
46355  #include <linux/timer.h>
46356 -#include <asm/of_platform.h>
46357 +#include <linux/of_platform.h>
46358 +
46359  #include <asm/processor.h>
46360  #include <asm/prom.h>
46361  #include <asm/pmi.h>
46362 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/cbe_regs.c
46363 ===================================================================
46364 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/cbe_regs.c
46365 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/cbe_regs.c
46366 @@ -9,13 +9,13 @@
46367  #include <linux/percpu.h>
46368  #include <linux/types.h>
46369  #include <linux/module.h>
46370 +#include <linux/of_device.h>
46371 +#include <linux/of_platform.h>
46372  
46373  #include <asm/io.h>
46374  #include <asm/pgtable.h>
46375  #include <asm/prom.h>
46376  #include <asm/ptrace.h>
46377 -#include <asm/of_device.h>
46378 -#include <asm/of_platform.h>
46379  #include <asm/cell-regs.h>
46380  
46381  /*
46382 @@ -256,6 +256,7 @@ void __init cbe_regs_init(void)
46383                         printk(KERN_ERR "cbe_regs: More BE chips than supported"
46384                                "!\n");
46385                         cbe_regs_map_count--;
46386 +                       of_node_put(cpu);
46387                         return;
46388                 }
46389                 map->cpu_node = cpu;
46390 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/io-workarounds.c
46391 ===================================================================
46392 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/io-workarounds.c
46393 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/io-workarounds.c
46394 @@ -238,7 +238,7 @@ static void __init spider_pci_setup_chip
46395  static void __init spider_pci_add_one(struct pci_controller *phb)
46396  {
46397         struct spider_pci_bus *bus = &spider_pci_busses[spider_pci_count];
46398 -       struct device_node *np = phb->arch_data;
46399 +       struct device_node *np = phb->dn;
46400         struct resource rsrc;
46401         void __iomem *regs;
46402  
46403 @@ -309,15 +309,12 @@ static int __init spider_pci_workaround_
46404  {
46405         struct pci_controller *phb;
46406  
46407 -       if (!machine_is(cell))
46408 -               return 0;
46409 -
46410         /* Find spider bridges. We assume they have been all probed
46411          * in setup_arch(). If that was to change, we would need to
46412          * update this code to cope with dynamically added busses
46413          */
46414         list_for_each_entry(phb, &hose_list, list_node) {
46415 -               struct device_node *np = phb->arch_data;
46416 +               struct device_node *np = phb->dn;
46417                 const char *model = of_get_property(np, "model", NULL);
46418  
46419                 /* If no model property or name isn't exactly "pci", skip */
46420 @@ -343,4 +340,4 @@ static int __init spider_pci_workaround_
46421  
46422         return 0;
46423  }
46424 -arch_initcall(spider_pci_workaround_init);
46425 +machine_arch_initcall(cell, spider_pci_workaround_init);
46426 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/iommu.c
46427 ===================================================================
46428 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/iommu.c
46429 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/iommu.c
46430 @@ -26,14 +26,15 @@
46431  #include <linux/init.h>
46432  #include <linux/interrupt.h>
46433  #include <linux/notifier.h>
46434 +#include <linux/of_platform.h>
46435  
46436  #include <asm/prom.h>
46437  #include <asm/iommu.h>
46438  #include <asm/machdep.h>
46439  #include <asm/pci-bridge.h>
46440  #include <asm/udbg.h>
46441 -#include <asm/of_platform.h>
46442  #include <asm/lmb.h>
46443 +#include <asm/firmware.h>
46444  #include <asm/cell-regs.h>
46445  
46446  #include "interrupt.h"
46447 @@ -309,8 +310,8 @@ static void cell_iommu_setup_hardware(st
46448  {
46449         struct page *page;
46450         int ret, i;
46451 -       unsigned long reg, segments, pages_per_segment, ptab_size, n_pte_pages;
46452 -       unsigned long xlate_base;
46453 +       unsigned long reg, segments, pages_per_segment, ptab_size, stab_size,
46454 +                     n_pte_pages, xlate_base;
46455         unsigned int virq;
46456  
46457         if (cell_iommu_find_ioc(iommu->nid, &xlate_base))
46458 @@ -327,7 +328,8 @@ static void cell_iommu_setup_hardware(st
46459                         __FUNCTION__, iommu->nid, segments, pages_per_segment);
46460  
46461         /* set up the segment table */
46462 -       page = alloc_pages_node(iommu->nid, GFP_KERNEL, 0);
46463 +       stab_size = segments * sizeof(unsigned long);
46464 +       page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(stab_size));
46465         BUG_ON(!page);
46466         iommu->stab = page_address(page);
46467         clear_page(iommu->stab);
46468 @@ -489,15 +491,18 @@ static struct cbe_iommu *cell_iommu_for_
46469         return NULL;
46470  }
46471  
46472 +static unsigned long cell_dma_direct_offset;
46473 +
46474  static void cell_dma_dev_setup(struct device *dev)
46475  {
46476         struct iommu_window *window;
46477         struct cbe_iommu *iommu;
46478         struct dev_archdata *archdata = &dev->archdata;
46479  
46480 -       /* If we run without iommu, no need to do anything */
46481 -       if (get_pci_dma_ops() == &dma_direct_ops)
46482 +       if (get_pci_dma_ops() == &dma_direct_ops) {
46483 +               archdata->dma_data = (void *)cell_dma_direct_offset;
46484                 return;
46485 +       }
46486  
46487         /* Current implementation uses the first window available in that
46488          * node's iommu. We -might- do something smarter later though it may
46489 @@ -653,7 +658,7 @@ static int __init cell_iommu_init_disabl
46490  
46491         /* If we have no Axon, we set up the spider DMA magic offset */
46492         if (of_find_node_by_name(NULL, "axon") == NULL)
46493 -               dma_direct_offset = SPIDER_DMA_OFFSET;
46494 +               cell_dma_direct_offset = SPIDER_DMA_OFFSET;
46495  
46496         /* Now we need to check to see where the memory is mapped
46497          * in PCI space. We assume that all busses use the same dma
46498 @@ -687,10 +692,13 @@ static int __init cell_iommu_init_disabl
46499                 return -ENODEV;
46500         }
46501  
46502 -       dma_direct_offset += base;
46503 +       cell_dma_direct_offset += base;
46504 +
46505 +       if (cell_dma_direct_offset != 0)
46506 +               ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup;
46507  
46508         printk("iommu: disabled, direct DMA offset is 0x%lx\n",
46509 -              dma_direct_offset);
46510 +              cell_dma_direct_offset);
46511  
46512         return 0;
46513  }
46514 @@ -699,9 +707,6 @@ static int __init cell_iommu_init(void)
46515  {
46516         struct device_node *np;
46517  
46518 -       if (!machine_is(cell))
46519 -               return -ENODEV;
46520 -
46521         /* If IOMMU is disabled or we have little enough RAM to not need
46522          * to enable it, we setup a direct mapping.
46523          *
46524 @@ -744,5 +749,6 @@ static int __init cell_iommu_init(void)
46525  
46526         return 0;
46527  }
46528 -arch_initcall(cell_iommu_init);
46529 +machine_arch_initcall(cell, cell_iommu_init);
46530 +machine_arch_initcall(celleb_native, cell_iommu_init);
46531  
46532 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/pmu.c
46533 ===================================================================
46534 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/pmu.c
46535 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/pmu.c
46536 @@ -213,7 +213,7 @@ u32 cbe_read_pm(u32 cpu, enum pm_reg_nam
46537                 break;
46538  
46539         case pm_interval:
46540 -               READ_SHADOW_REG(val, pm_interval);
46541 +               READ_MMIO_UPPER32(val, pm_interval);
46542                 break;
46543  
46544         case pm_start_stop:
46545 @@ -381,9 +381,6 @@ static int __init cbe_init_pm_irq(void)
46546         unsigned int irq;
46547         int rc, node;
46548  
46549 -       if (!machine_is(cell))
46550 -               return 0;
46551 -
46552         for_each_node(node) {
46553                 irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI |
46554                                                (node << IIC_IRQ_NODE_SHIFT));
46555 @@ -404,7 +401,7 @@ static int __init cbe_init_pm_irq(void)
46556  
46557         return 0;
46558  }
46559 -arch_initcall(cbe_init_pm_irq);
46560 +machine_arch_initcall(cell, cbe_init_pm_irq);
46561  
46562  void cbe_sync_irq(int node)
46563  {
46564 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/setup.c
46565 ===================================================================
46566 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/setup.c
46567 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/setup.c
46568 @@ -30,6 +30,7 @@
46569  #include <linux/console.h>
46570  #include <linux/mutex.h>
46571  #include <linux/memory_hotplug.h>
46572 +#include <linux/of_platform.h>
46573  
46574  #include <asm/mmu.h>
46575  #include <asm/processor.h>
46576 @@ -51,7 +52,6 @@
46577  #include <asm/spu_priv1.h>
46578  #include <asm/udbg.h>
46579  #include <asm/mpic.h>
46580 -#include <asm/of_platform.h>
46581  #include <asm/cell-regs.h>
46582  
46583  #include "interrupt.h"
46584 @@ -85,9 +85,6 @@ static int __init cell_publish_devices(v
46585  {
46586         int node;
46587  
46588 -       if (!machine_is(cell))
46589 -               return 0;
46590 -
46591         /* Publish OF platform devices for southbridge IOs */
46592         of_platform_bus_probe(NULL, NULL, NULL);
46593  
46594 @@ -101,7 +98,7 @@ static int __init cell_publish_devices(v
46595         }
46596         return 0;
46597  }
46598 -device_initcall(cell_publish_devices);
46599 +machine_device_initcall(cell, cell_publish_devices);
46600  
46601  static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
46602  {
46603 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/smp.c
46604 ===================================================================
46605 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/smp.c
46606 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/smp.c
46607 @@ -42,6 +42,7 @@
46608  #include <asm/firmware.h>
46609  #include <asm/system.h>
46610  #include <asm/rtas.h>
46611 +#include <asm/cputhreads.h>
46612  
46613  #include "interrupt.h"
46614  #include <asm/udbg.h>
46615 @@ -182,7 +183,7 @@ static int smp_cell_cpu_bootable(unsigne
46616          */
46617         if (system_state < SYSTEM_RUNNING &&
46618             cpu_has_feature(CPU_FTR_SMT) &&
46619 -           !smt_enabled_at_boot && nr % 2 != 0)
46620 +           !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
46621                 return 0;
46622  
46623         return 1;
46624 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spu_base.c
46625 ===================================================================
46626 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spu_base.c
46627 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spu_base.c
46628 @@ -34,6 +34,7 @@
46629  #include <linux/linux_logo.h>
46630  #include <asm/spu.h>
46631  #include <asm/spu_priv1.h>
46632 +#include <asm/spu_csa.h>
46633  #include <asm/xmon.h>
46634  #include <asm/prom.h>
46635  
46636 @@ -47,6 +48,13 @@ struct cbe_spu_info cbe_spu_info[MAX_NUM
46637  EXPORT_SYMBOL_GPL(cbe_spu_info);
46638  
46639  /*
46640 + * The spufs fault-handling code needs to call force_sig_info to raise signals
46641 + * on DMA errors. Export it here to avoid general kernel-wide access to this
46642 + * function
46643 + */
46644 +EXPORT_SYMBOL_GPL(force_sig_info);
46645 +
46646 +/*
46647   * Protects cbe_spu_info and spu->number.
46648   */
46649  static DEFINE_SPINLOCK(spu_lock);
46650 @@ -66,6 +74,10 @@ static LIST_HEAD(spu_full_list);
46651  static DEFINE_SPINLOCK(spu_full_list_lock);
46652  static DEFINE_MUTEX(spu_full_list_mutex);
46653  
46654 +struct spu_slb {
46655 +       u64 esid, vsid;
46656 +};
46657 +
46658  void spu_invalidate_slbs(struct spu *spu)
46659  {
46660         struct spu_priv2 __iomem *priv2 = spu->priv2;
46661 @@ -114,40 +126,36 @@ void spu_associate_mm(struct spu *spu, s
46662  }
46663  EXPORT_SYMBOL_GPL(spu_associate_mm);
46664  
46665 -static int __spu_trap_invalid_dma(struct spu *spu)
46666 +int spu_64k_pages_available(void)
46667  {
46668 -       pr_debug("%s\n", __FUNCTION__);
46669 -       spu->dma_callback(spu, SPE_EVENT_INVALID_DMA);
46670 -       return 0;
46671 +       return mmu_psize_defs[MMU_PAGE_64K].shift != 0;
46672  }
46673 +EXPORT_SYMBOL_GPL(spu_64k_pages_available);
46674  
46675 -static int __spu_trap_dma_align(struct spu *spu)
46676 +static void spu_restart_dma(struct spu *spu)
46677  {
46678 -       pr_debug("%s\n", __FUNCTION__);
46679 -       spu->dma_callback(spu, SPE_EVENT_DMA_ALIGNMENT);
46680 -       return 0;
46681 -}
46682 +       struct spu_priv2 __iomem *priv2 = spu->priv2;
46683  
46684 -static int __spu_trap_error(struct spu *spu)
46685 -{
46686 -       pr_debug("%s\n", __FUNCTION__);
46687 -       spu->dma_callback(spu, SPE_EVENT_SPE_ERROR);
46688 -       return 0;
46689 +       if (!test_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags))
46690 +               out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESTART_DMA_COMMAND);
46691  }
46692  
46693 -static void spu_restart_dma(struct spu *spu)
46694 +static inline void spu_load_slb(struct spu *spu, int slbe, struct spu_slb *slb)
46695  {
46696         struct spu_priv2 __iomem *priv2 = spu->priv2;
46697  
46698 -       if (!test_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags))
46699 -               out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESTART_DMA_COMMAND);
46700 +       pr_debug("%s: adding SLB[%d] 0x%016lx 0x%016lx\n",
46701 +                       __func__, slbe, slb->vsid, slb->esid);
46702 +
46703 +       out_be64(&priv2->slb_index_W, slbe);
46704 +       out_be64(&priv2->slb_vsid_RW, slb->vsid);
46705 +       out_be64(&priv2->slb_esid_RW, slb->esid);
46706  }
46707  
46708  static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
46709  {
46710 -       struct spu_priv2 __iomem *priv2 = spu->priv2;
46711         struct mm_struct *mm = spu->mm;
46712 -       u64 esid, vsid, llp;
46713 +       struct spu_slb slb;
46714         int psize;
46715  
46716         pr_debug("%s\n", __FUNCTION__);
46717 @@ -159,7 +167,7 @@ static int __spu_trap_data_seg(struct sp
46718                 printk("%s: invalid access during switch!\n", __func__);
46719                 return 1;
46720         }
46721 -       esid = (ea & ESID_MASK) | SLB_ESID_V;
46722 +       slb.esid = (ea & ESID_MASK) | SLB_ESID_V;
46723  
46724         switch(REGION_ID(ea)) {
46725         case USER_REGION_ID:
46726 @@ -168,21 +176,21 @@ static int __spu_trap_data_seg(struct sp
46727  #else
46728                 psize = mm->context.user_psize;
46729  #endif
46730 -               vsid = (get_vsid(mm->context.id, ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46731 -                               SLB_VSID_USER;
46732 +               slb.vsid = (get_vsid(mm->context.id, ea, MMU_SEGSIZE_256M)
46733 +                               << SLB_VSID_SHIFT) | SLB_VSID_USER;
46734                 break;
46735         case VMALLOC_REGION_ID:
46736                 if (ea < VMALLOC_END)
46737                         psize = mmu_vmalloc_psize;
46738                 else
46739                         psize = mmu_io_psize;
46740 -               vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46741 -                       SLB_VSID_KERNEL;
46742 +               slb.vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M)
46743 +                               << SLB_VSID_SHIFT) | SLB_VSID_KERNEL;
46744                 break;
46745         case KERNEL_REGION_ID:
46746                 psize = mmu_linear_psize;
46747 -               vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46748 -                       SLB_VSID_KERNEL;
46749 +               slb.vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M)
46750 +                               << SLB_VSID_SHIFT) | SLB_VSID_KERNEL;
46751                 break;
46752         default:
46753                 /* Future: support kernel segments so that drivers
46754 @@ -191,11 +199,9 @@ static int __spu_trap_data_seg(struct sp
46755                 pr_debug("invalid region access at %016lx\n", ea);
46756                 return 1;
46757         }
46758 -       llp = mmu_psize_defs[psize].sllp;
46759 +       slb.vsid |= mmu_psize_defs[psize].sllp;
46760  
46761 -       out_be64(&priv2->slb_index_W, spu->slb_replace);
46762 -       out_be64(&priv2->slb_vsid_RW, vsid | llp);
46763 -       out_be64(&priv2->slb_esid_RW, esid);
46764 +       spu_load_slb(spu, spu->slb_replace, &slb);
46765  
46766         spu->slb_replace++;
46767         if (spu->slb_replace >= 8)
46768 @@ -225,13 +231,83 @@ static int __spu_trap_data_map(struct sp
46769                 return 1;
46770         }
46771  
46772 +       spu->class_0_pending = 0;
46773         spu->dar = ea;
46774         spu->dsisr = dsisr;
46775 -       mb();
46776 +
46777         spu->stop_callback(spu);
46778 +
46779         return 0;
46780  }
46781  
46782 +static void __spu_kernel_slb(void *addr, struct spu_slb *slb)
46783 +{
46784 +       unsigned long ea = (unsigned long)addr;
46785 +       u64 llp;
46786 +
46787 +       if (REGION_ID(ea) == KERNEL_REGION_ID)
46788 +               llp = mmu_psize_defs[mmu_linear_psize].sllp;
46789 +       else
46790 +               llp = mmu_psize_defs[mmu_virtual_psize].sllp;
46791 +
46792 +       slb->vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46793 +               SLB_VSID_KERNEL | llp;
46794 +       slb->esid = (ea & ESID_MASK) | SLB_ESID_V;
46795 +}
46796 +
46797 +/**
46798 + * Given an array of @nr_slbs SLB entries, @slbs, return non-zero if the
46799 + * address @new_addr is present.
46800 + */
46801 +static inline int __slb_present(struct spu_slb *slbs, int nr_slbs,
46802 +               void *new_addr)
46803 +{
46804 +       unsigned long ea = (unsigned long)new_addr;
46805 +       int i;
46806 +
46807 +       for (i = 0; i < nr_slbs; i++)
46808 +               if (!((slbs[i].esid ^ ea) & ESID_MASK))
46809 +                       return 1;
46810 +
46811 +       return 0;
46812 +}
46813 +
46814 +/**
46815 + * Setup the SPU kernel SLBs, in preparation for a context save/restore. We
46816 + * need to map both the context save area, and the save/restore code.
46817 + *
46818 + * Because the lscsa and code may cross segment boundaires, we check to see
46819 + * if mappings are required for the start and end of each range. We currently
46820 + * assume that the mappings are smaller that one segment - if not, something
46821 + * is seriously wrong.
46822 + */
46823 +void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa,
46824 +               void *code, int code_size)
46825 +{
46826 +       struct spu_slb slbs[4];
46827 +       int i, nr_slbs = 0;
46828 +       /* start and end addresses of both mappings */
46829 +       void *addrs[] = {
46830 +               lscsa, (void *)lscsa + sizeof(*lscsa) - 1,
46831 +               code, code + code_size - 1
46832 +       };
46833 +
46834 +       /* check the set of addresses, and create a new entry in the slbs array
46835 +        * if there isn't already a SLB for that address */
46836 +       for (i = 0; i < ARRAY_SIZE(addrs); i++) {
46837 +               if (__slb_present(slbs, nr_slbs, addrs[i]))
46838 +                       continue;
46839 +
46840 +               __spu_kernel_slb(addrs[i], &slbs[nr_slbs]);
46841 +               nr_slbs++;
46842 +       }
46843 +
46844 +       /* Add the set of SLBs */
46845 +       for (i = 0; i < nr_slbs; i++)
46846 +               spu_load_slb(spu, i, &slbs[i]);
46847 +}
46848 +EXPORT_SYMBOL_GPL(spu_setup_kernel_slbs);
46849 +
46850  static irqreturn_t
46851  spu_irq_class_0(int irq, void *data)
46852  {
46853 @@ -240,12 +316,13 @@ spu_irq_class_0(int irq, void *data)
46854  
46855         spu = data;
46856  
46857 +       spin_lock(&spu->register_lock);
46858         mask = spu_int_mask_get(spu, 0);
46859 -       stat = spu_int_stat_get(spu, 0);
46860 -       stat &= mask;
46861 +       stat = spu_int_stat_get(spu, 0) & mask;
46862  
46863 -       spin_lock(&spu->register_lock);
46864         spu->class_0_pending |= stat;
46865 +       spu->dsisr = spu_mfc_dsisr_get(spu);
46866 +       spu->dar = spu_mfc_dar_get(spu);
46867         spin_unlock(&spu->register_lock);
46868  
46869         spu->stop_callback(spu);
46870 @@ -255,31 +332,6 @@ spu_irq_class_0(int irq, void *data)
46871         return IRQ_HANDLED;
46872  }
46873  
46874 -int
46875 -spu_irq_class_0_bottom(struct spu *spu)
46876 -{
46877 -       unsigned long flags;
46878 -       unsigned long stat;
46879 -
46880 -       spin_lock_irqsave(&spu->register_lock, flags);
46881 -       stat = spu->class_0_pending;
46882 -       spu->class_0_pending = 0;
46883 -
46884 -       if (stat & 1) /* invalid DMA alignment */
46885 -               __spu_trap_dma_align(spu);
46886 -
46887 -       if (stat & 2) /* invalid MFC DMA */
46888 -               __spu_trap_invalid_dma(spu);
46889 -
46890 -       if (stat & 4) /* error on SPU */
46891 -               __spu_trap_error(spu);
46892 -
46893 -       spin_unlock_irqrestore(&spu->register_lock, flags);
46894 -
46895 -       return (stat & 0x7) ? -EIO : 0;
46896 -}
46897 -EXPORT_SYMBOL_GPL(spu_irq_class_0_bottom);
46898 -
46899  static irqreturn_t
46900  spu_irq_class_1(int irq, void *data)
46901  {
46902 @@ -294,24 +346,23 @@ spu_irq_class_1(int irq, void *data)
46903         stat  = spu_int_stat_get(spu, 1) & mask;
46904         dar   = spu_mfc_dar_get(spu);
46905         dsisr = spu_mfc_dsisr_get(spu);
46906 -       if (stat & 2) /* mapping fault */
46907 +       if (stat & CLASS1_STORAGE_FAULT_INTR)
46908                 spu_mfc_dsisr_set(spu, 0ul);
46909         spu_int_stat_clear(spu, 1, stat);
46910         spin_unlock(&spu->register_lock);
46911         pr_debug("%s: %lx %lx %lx %lx\n", __FUNCTION__, mask, stat,
46912                         dar, dsisr);
46913  
46914 -       if (stat & 1) /* segment fault */
46915 +       if (stat & CLASS1_SEGMENT_FAULT_INTR)
46916                 __spu_trap_data_seg(spu, dar);
46917  
46918 -       if (stat & 2) { /* mapping fault */
46919 +       if (stat & CLASS1_STORAGE_FAULT_INTR)
46920                 __spu_trap_data_map(spu, dar, dsisr);
46921 -       }
46922  
46923 -       if (stat & 4) /* ls compare & suspend on get */
46924 +       if (stat & CLASS1_LS_COMPARE_SUSPEND_ON_GET_INTR)
46925                 ;
46926  
46927 -       if (stat & 8) /* ls compare & suspend on put */
46928 +       if (stat & CLASS1_LS_COMPARE_SUSPEND_ON_PUT_INTR)
46929                 ;
46930  
46931         return stat ? IRQ_HANDLED : IRQ_NONE;
46932 @@ -323,6 +374,8 @@ spu_irq_class_2(int irq, void *data)
46933         struct spu *spu;
46934         unsigned long stat;
46935         unsigned long mask;
46936 +       const int mailbox_intrs =
46937 +               CLASS2_MAILBOX_THRESHOLD_INTR | CLASS2_MAILBOX_INTR;
46938  
46939         spu = data;
46940         spin_lock(&spu->register_lock);
46941 @@ -330,31 +383,30 @@ spu_irq_class_2(int irq, void *data)
46942         mask = spu_int_mask_get(spu, 2);
46943         /* ignore interrupts we're not waiting for */
46944         stat &= mask;
46945 -       /*
46946 -        * mailbox interrupts (0x1 and 0x10) are level triggered.
46947 -        * mask them now before acknowledging.
46948 -        */
46949 -       if (stat & 0x11)
46950 -               spu_int_mask_and(spu, 2, ~(stat & 0x11));
46951 +
46952 +       /* mailbox interrupts are level triggered. mask them now before
46953 +        * acknowledging */
46954 +       if (stat & mailbox_intrs)
46955 +               spu_int_mask_and(spu, 2, ~(stat & mailbox_intrs));
46956         /* acknowledge all interrupts before the callbacks */
46957         spu_int_stat_clear(spu, 2, stat);
46958         spin_unlock(&spu->register_lock);
46959  
46960         pr_debug("class 2 interrupt %d, %lx, %lx\n", irq, stat, mask);
46961  
46962 -       if (stat & 1)  /* PPC core mailbox */
46963 +       if (stat & CLASS2_MAILBOX_INTR)
46964                 spu->ibox_callback(spu);
46965  
46966 -       if (stat & 2) /* SPU stop-and-signal */
46967 +       if (stat & CLASS2_SPU_STOP_INTR)
46968                 spu->stop_callback(spu);
46969  
46970 -       if (stat & 4) /* SPU halted */
46971 +       if (stat & CLASS2_SPU_HALT_INTR)
46972                 spu->stop_callback(spu);
46973  
46974 -       if (stat & 8) /* DMA tag group complete */
46975 +       if (stat & CLASS2_SPU_DMA_TAG_GROUP_COMPLETE_INTR)
46976                 spu->mfc_callback(spu);
46977  
46978 -       if (stat & 0x10) /* SPU mailbox threshold */
46979 +       if (stat & CLASS2_MAILBOX_THRESHOLD_INTR)
46980                 spu->wbox_callback(spu);
46981  
46982         spu->stats.class2_intr++;
46983 @@ -479,13 +531,27 @@ EXPORT_SYMBOL_GPL(spu_add_sysdev_attr);
46984  int spu_add_sysdev_attr_group(struct attribute_group *attrs)
46985  {
46986         struct spu *spu;
46987 +       int rc = 0;
46988  
46989         mutex_lock(&spu_full_list_mutex);
46990 -       list_for_each_entry(spu, &spu_full_list, full_list)
46991 -               sysfs_create_group(&spu->sysdev.kobj, attrs);
46992 +       list_for_each_entry(spu, &spu_full_list, full_list) {
46993 +               rc = sysfs_create_group(&spu->sysdev.kobj, attrs);
46994 +
46995 +               /* we're in trouble here, but try unwinding anyway */
46996 +               if (rc) {
46997 +                       printk(KERN_ERR "%s: can't create sysfs group '%s'\n",
46998 +                                       __func__, attrs->name);
46999 +
47000 +                       list_for_each_entry_continue_reverse(spu,
47001 +                                       &spu_full_list, full_list)
47002 +                               sysfs_remove_group(&spu->sysdev.kobj, attrs);
47003 +                       break;
47004 +               }
47005 +       }
47006 +
47007         mutex_unlock(&spu_full_list_mutex);
47008  
47009 -       return 0;
47010 +       return rc;
47011  }
47012  EXPORT_SYMBOL_GPL(spu_add_sysdev_attr_group);
47013  
47014 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spu_fault.c
47015 ===================================================================
47016 --- /dev/null
47017 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spu_fault.c
47018 @@ -0,0 +1,98 @@
47019 +/*
47020 + * SPU mm fault handler
47021 + *
47022 + * (C) Copyright IBM Deutschland Entwicklung GmbH 2007
47023 + *
47024 + * Author: Arnd Bergmann <arndb@de.ibm.com>
47025 + * Author: Jeremy Kerr <jk@ozlabs.org>
47026 + *
47027 + * This program is free software; you can redistribute it and/or modify
47028 + * it under the terms of the GNU General Public License as published by
47029 + * the Free Software Foundation; either version 2, or (at your option)
47030 + * any later version.
47031 + *
47032 + * This program is distributed in the hope that it will be useful,
47033 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
47034 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
47035 + * GNU General Public License for more details.
47036 + *
47037 + * You should have received a copy of the GNU General Public License
47038 + * along with this program; if not, write to the Free Software
47039 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
47040 + */
47041 +#include <linux/sched.h>
47042 +#include <linux/mm.h>
47043 +#include <linux/module.h>
47044 +
47045 +#include <asm/spu.h>
47046 +#include <asm/spu_csa.h>
47047 +
47048 +/*
47049 + * This ought to be kept in sync with the powerpc specific do_page_fault
47050 + * function. Currently, there are a few corner cases that we haven't had
47051 + * to handle fortunately.
47052 + */
47053 +int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
47054 +               unsigned long dsisr, unsigned *flt)
47055 +{
47056 +       struct vm_area_struct *vma;
47057 +       unsigned long is_write;
47058 +       int ret;
47059 +
47060 +#if 0
47061 +       if (!IS_VALID_EA(ea)) {
47062 +               return -EFAULT;
47063 +       }
47064 +#endif /* XXX */
47065 +       if (mm == NULL) {
47066 +               return -EFAULT;
47067 +       }
47068 +       if (mm->pgd == NULL) {
47069 +               return -EFAULT;
47070 +       }
47071 +
47072 +       down_read(&mm->mmap_sem);
47073 +       vma = find_vma(mm, ea);
47074 +       if (!vma)
47075 +               goto bad_area;
47076 +       if (vma->vm_start <= ea)
47077 +               goto good_area;
47078 +       if (!(vma->vm_flags & VM_GROWSDOWN))
47079 +               goto bad_area;
47080 +       if (expand_stack(vma, ea))
47081 +               goto bad_area;
47082 +good_area:
47083 +       is_write = dsisr & MFC_DSISR_ACCESS_PUT;
47084 +       if (is_write) {
47085 +               if (!(vma->vm_flags & VM_WRITE))
47086 +                       goto bad_area;
47087 +       } else {
47088 +               if (dsisr & MFC_DSISR_ACCESS_DENIED)
47089 +                       goto bad_area;
47090 +               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
47091 +                       goto bad_area;
47092 +       }
47093 +       ret = 0;
47094 +       *flt = handle_mm_fault(mm, vma, ea, is_write);
47095 +       if (unlikely(*flt & VM_FAULT_ERROR)) {
47096 +               if (*flt & VM_FAULT_OOM) {
47097 +                       ret = -ENOMEM;
47098 +                       goto bad_area;
47099 +               } else if (*flt & VM_FAULT_SIGBUS) {
47100 +                       ret = -EFAULT;
47101 +                       goto bad_area;
47102 +               }
47103 +               BUG();
47104 +       }
47105 +       if (*flt & VM_FAULT_MAJOR)
47106 +               current->maj_flt++;
47107 +       else
47108 +               current->min_flt++;
47109 +       up_read(&mm->mmap_sem);
47110 +       return ret;
47111 +
47112 +bad_area:
47113 +       up_read(&mm->mmap_sem);
47114 +       return -EFAULT;
47115 +}
47116 +EXPORT_SYMBOL_GPL(spu_handle_mm_fault);
47117 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spu_manage.c
47118 ===================================================================
47119 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spu_manage.c
47120 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spu_manage.c
47121 @@ -35,6 +35,7 @@
47122  #include <asm/firmware.h>
47123  #include <asm/prom.h>
47124  
47125 +#include "spufs/spufs.h"
47126  #include "interrupt.h"
47127  
47128  struct device_node *spu_devnode(struct spu *spu)
47129 @@ -345,7 +346,7 @@ static int __init of_create_spu(struct s
47130                 }
47131                 ret = spu_map_interrupts_old(spu, spe);
47132                 if (ret) {
47133 -                       printk(KERN_ERR "%s: could not map interrupts",
47134 +                       printk(KERN_ERR "%s: could not map interrupts\n",
47135                                 spu->name);
47136                         goto out_unmap;
47137                 }
47138 @@ -369,6 +370,16 @@ static int of_destroy_spu(struct spu *sp
47139         return 0;
47140  }
47141  
47142 +static void enable_spu_by_master_run(struct spu_context *ctx)
47143 +{
47144 +       ctx->ops->master_start(ctx);
47145 +}
47146 +
47147 +static void disable_spu_by_master_run(struct spu_context *ctx)
47148 +{
47149 +       ctx->ops->master_stop(ctx);
47150 +}
47151 +
47152  /* Hardcoded affinity idxs for qs20 */
47153  #define QS20_SPES_PER_BE 8
47154  static int qs20_reg_idxs[QS20_SPES_PER_BE] =   { 0, 2, 4, 6, 7, 5, 3, 1 };
47155 @@ -411,10 +422,15 @@ static void init_affinity_qs20_harcoded(
47156  
47157  static int of_has_vicinity(void)
47158  {
47159 -       struct spu* spu;
47160 +       struct device_node *dn;
47161  
47162 -       spu = list_first_entry(&cbe_spu_info[0].spus, struct spu, cbe_list);
47163 -       return of_find_property(spu_devnode(spu), "vicinity", NULL) != NULL;
47164 +       for_each_node_by_type(dn, "spe") {
47165 +               if (of_find_property(dn, "vicinity", NULL))  {
47166 +                       of_node_put(dn);
47167 +                       return 1;
47168 +               }
47169 +       }
47170 +       return 0;
47171  }
47172  
47173  static struct spu *devnode_spu(int cbe, struct device_node *dn)
47174 @@ -525,7 +541,7 @@ static int __init init_affinity(void)
47175                 if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
47176                         init_affinity_qs20_harcoded();
47177                 else
47178 -                       printk("No affinity configuration found");
47179 +                       printk("No affinity configuration found\n");
47180         }
47181  
47182         return 0;
47183 @@ -535,5 +551,7 @@ const struct spu_management_ops spu_mana
47184         .enumerate_spus = of_enumerate_spus,
47185         .create_spu = of_create_spu,
47186         .destroy_spu = of_destroy_spu,
47187 +       .enable_spu = enable_spu_by_master_run,
47188 +       .disable_spu = disable_spu_by_master_run,
47189         .init_affinity = init_affinity,
47190  };
47191 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/Makefile
47192 ===================================================================
47193 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/Makefile
47194 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/Makefile
47195 @@ -1,8 +1,8 @@
47196 -obj-y += switch.o fault.o lscsa_alloc.o
47197  
47198  obj-$(CONFIG_SPU_FS) += spufs.o
47199  spufs-y += inode.o file.o context.o syscalls.o coredump.o
47200  spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o
47201 +spufs-y += switch.o fault.o lscsa_alloc.o
47202  
47203  # Rules to build switch.o with the help of SPU tool chain
47204  SPU_CROSS      := spu-
47205 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/backing_ops.c
47206 ===================================================================
47207 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/backing_ops.c
47208 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/backing_ops.c
47209 @@ -106,16 +106,20 @@ static unsigned int spu_backing_mbox_sta
47210                 if (stat & 0xff0000)
47211                         ret |= POLLIN | POLLRDNORM;
47212                 else {
47213 -                       ctx->csa.priv1.int_stat_class0_RW &= ~0x1;
47214 -                       ctx->csa.priv1.int_mask_class2_RW |= 0x1;
47215 +                       ctx->csa.priv1.int_stat_class2_RW &=
47216 +                               ~CLASS2_MAILBOX_INTR;
47217 +                       ctx->csa.priv1.int_mask_class2_RW |=
47218 +                               CLASS2_ENABLE_MAILBOX_INTR;
47219                 }
47220         }
47221         if (events & (POLLOUT | POLLWRNORM)) {
47222                 if (stat & 0x00ff00)
47223                         ret = POLLOUT | POLLWRNORM;
47224                 else {
47225 -                       ctx->csa.priv1.int_stat_class0_RW &= ~0x10;
47226 -                       ctx->csa.priv1.int_mask_class2_RW |= 0x10;
47227 +                       ctx->csa.priv1.int_stat_class2_RW &=
47228 +                               ~CLASS2_MAILBOX_THRESHOLD_INTR;
47229 +                       ctx->csa.priv1.int_mask_class2_RW |=
47230 +                               CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR;
47231                 }
47232         }
47233         spin_unlock_irq(&ctx->csa.register_lock);
47234 @@ -139,7 +143,7 @@ static int spu_backing_ibox_read(struct 
47235                 ret = 4;
47236         } else {
47237                 /* make sure we get woken up by the interrupt */
47238 -               ctx->csa.priv1.int_mask_class2_RW |= 0x1UL;
47239 +               ctx->csa.priv1.int_mask_class2_RW |= CLASS2_ENABLE_MAILBOX_INTR;
47240                 ret = 0;
47241         }
47242         spin_unlock(&ctx->csa.register_lock);
47243 @@ -169,7 +173,8 @@ static int spu_backing_wbox_write(struct
47244         } else {
47245                 /* make sure we get woken up by the interrupt when space
47246                    becomes available */
47247 -               ctx->csa.priv1.int_mask_class2_RW |= 0x10;
47248 +               ctx->csa.priv1.int_mask_class2_RW |=
47249 +                       CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR;
47250                 ret = 0;
47251         }
47252         spin_unlock(&ctx->csa.register_lock);
47253 @@ -268,6 +273,11 @@ static char *spu_backing_get_ls(struct s
47254         return ctx->csa.lscsa->ls;
47255  }
47256  
47257 +static void spu_backing_privcntl_write(struct spu_context *ctx, u64 val)
47258 +{
47259 +       ctx->csa.priv2.spu_privcntl_RW = val;
47260 +}
47261 +
47262  static u32 spu_backing_runcntl_read(struct spu_context *ctx)
47263  {
47264         return ctx->csa.prob.spu_runcntl_RW;
47265 @@ -285,6 +295,11 @@ static void spu_backing_runcntl_write(st
47266         spin_unlock(&ctx->csa.register_lock);
47267  }
47268  
47269 +static void spu_backing_runcntl_stop(struct spu_context *ctx)
47270 +{
47271 +       spu_backing_runcntl_write(ctx, SPU_RUNCNTL_STOP);
47272 +}
47273 +
47274  static void spu_backing_master_start(struct spu_context *ctx)
47275  {
47276         struct spu_state *csa = &ctx->csa;
47277 @@ -358,7 +373,7 @@ static int spu_backing_send_mfc_command(
47278  
47279  static void spu_backing_restart_dma(struct spu_context *ctx)
47280  {
47281 -       /* nothing to do here */
47282 +       ctx->csa.priv2.mfc_control_RW |= MFC_CNTL_RESTART_DMA_COMMAND;
47283  }
47284  
47285  struct spu_context_ops spu_backing_ops = {
47286 @@ -379,8 +394,10 @@ struct spu_context_ops spu_backing_ops =
47287         .npc_write = spu_backing_npc_write,
47288         .status_read = spu_backing_status_read,
47289         .get_ls = spu_backing_get_ls,
47290 +       .privcntl_write = spu_backing_privcntl_write,
47291         .runcntl_read = spu_backing_runcntl_read,
47292         .runcntl_write = spu_backing_runcntl_write,
47293 +       .runcntl_stop = spu_backing_runcntl_stop,
47294         .master_start = spu_backing_master_start,
47295         .master_stop = spu_backing_master_stop,
47296         .set_mfc_query = spu_backing_set_mfc_query,
47297 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/context.c
47298 ===================================================================
47299 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/context.c
47300 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/context.c
47301 @@ -52,6 +52,7 @@ struct spu_context *alloc_spu_context(st
47302         init_waitqueue_head(&ctx->wbox_wq);
47303         init_waitqueue_head(&ctx->stop_wq);
47304         init_waitqueue_head(&ctx->mfc_wq);
47305 +       init_waitqueue_head(&ctx->run_wq);
47306         ctx->state = SPU_STATE_SAVED;
47307         ctx->ops = &spu_backing_ops;
47308         ctx->owner = get_task_mm(current);
47309 @@ -105,7 +106,17 @@ int put_spu_context(struct spu_context *
47310  void spu_forget(struct spu_context *ctx)
47311  {
47312         struct mm_struct *mm;
47313 -       spu_acquire_saved(ctx);
47314 +
47315 +       /*
47316 +        * This is basically an open-coded spu_acquire_saved, except that
47317 +        * we don't acquire the state mutex interruptible.
47318 +        */
47319 +       mutex_lock(&ctx->state_mutex);
47320 +       if (ctx->state != SPU_STATE_SAVED) {
47321 +               set_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags);
47322 +               spu_deactivate(ctx);
47323 +       }
47324 +
47325         mm = ctx->owner;
47326         ctx->owner = NULL;
47327         mmput(mm);
47328 @@ -133,47 +144,23 @@ void spu_unmap_mappings(struct spu_conte
47329  }
47330  
47331  /**
47332 - * spu_acquire_runnable - lock spu contex and make sure it is in runnable state
47333 + * spu_acquire_saved - lock spu contex and make sure it is in saved state
47334   * @ctx:       spu contex to lock
47335 - *
47336 - * Note:
47337 - *     Returns 0 and with the context locked on success
47338 - *     Returns negative error and with the context _unlocked_ on failure.
47339   */
47340 -int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags)
47341 +int spu_acquire_saved(struct spu_context *ctx)
47342  {
47343 -       int ret = -EINVAL;
47344 +       int ret;
47345  
47346 -       spu_acquire(ctx);
47347 -       if (ctx->state == SPU_STATE_SAVED) {
47348 -               /*
47349 -                * Context is about to be freed, so we can't acquire it anymore.
47350 -                */
47351 -               if (!ctx->owner)
47352 -                       goto out_unlock;
47353 -               ret = spu_activate(ctx, flags);
47354 -               if (ret)
47355 -                       goto out_unlock;
47356 -       }
47357 -
47358 -       return 0;
47359 +       ret = spu_acquire(ctx);
47360 +       if (ret)
47361 +               return ret;
47362  
47363 - out_unlock:
47364 -       spu_release(ctx);
47365 -       return ret;
47366 -}
47367 -
47368 -/**
47369 - * spu_acquire_saved - lock spu contex and make sure it is in saved state
47370 - * @ctx:       spu contex to lock
47371 - */
47372 -void spu_acquire_saved(struct spu_context *ctx)
47373 -{
47374 -       spu_acquire(ctx);
47375         if (ctx->state != SPU_STATE_SAVED) {
47376                 set_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags);
47377                 spu_deactivate(ctx);
47378         }
47379 +
47380 +       return 0;
47381  }
47382  
47383  /**
47384 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/coredump.c
47385 ===================================================================
47386 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/coredump.c
47387 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/coredump.c
47388 @@ -148,7 +148,9 @@ int spufs_coredump_extra_notes_size(void
47389  
47390         fd = 0;
47391         while ((ctx = coredump_next_context(&fd)) != NULL) {
47392 -               spu_acquire_saved(ctx);
47393 +               rc = spu_acquire_saved(ctx);
47394 +               if (rc)
47395 +                       break;
47396                 rc = spufs_ctx_note_size(ctx, fd);
47397                 spu_release_saved(ctx);
47398                 if (rc < 0)
47399 @@ -224,7 +226,9 @@ int spufs_coredump_extra_notes_write(str
47400  
47401         fd = 0;
47402         while ((ctx = coredump_next_context(&fd)) != NULL) {
47403 -               spu_acquire_saved(ctx);
47404 +               rc = spu_acquire_saved(ctx);
47405 +               if (rc)
47406 +                       return rc;
47407  
47408                 for (j = 0; spufs_coredump_read[j].name != NULL; j++) {
47409                         rc = spufs_arch_write_note(ctx, j, file, fd, foffset);
47410 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/fault.c
47411 ===================================================================
47412 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/fault.c
47413 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/fault.c
47414 @@ -28,117 +28,71 @@
47415  
47416  #include "spufs.h"
47417  
47418 -/*
47419 - * This ought to be kept in sync with the powerpc specific do_page_fault
47420 - * function. Currently, there are a few corner cases that we haven't had
47421 - * to handle fortunately.
47422 +/**
47423 + * Handle an SPE event, depending on context SPU_CREATE_EVENTS_ENABLED flag.
47424 + *
47425 + * If the context was created with events, we just set the return event.
47426 + * Otherwise, send an appropriate signal to the process.
47427   */
47428 -static int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
47429 -               unsigned long dsisr, unsigned *flt)
47430 -{
47431 -       struct vm_area_struct *vma;
47432 -       unsigned long is_write;
47433 -       int ret;
47434 -
47435 -#if 0
47436 -       if (!IS_VALID_EA(ea)) {
47437 -               return -EFAULT;
47438 -       }
47439 -#endif /* XXX */
47440 -       if (mm == NULL) {
47441 -               return -EFAULT;
47442 -       }
47443 -       if (mm->pgd == NULL) {
47444 -               return -EFAULT;
47445 -       }
47446 -
47447 -       down_read(&mm->mmap_sem);
47448 -       vma = find_vma(mm, ea);
47449 -       if (!vma)
47450 -               goto bad_area;
47451 -       if (vma->vm_start <= ea)
47452 -               goto good_area;
47453 -       if (!(vma->vm_flags & VM_GROWSDOWN))
47454 -               goto bad_area;
47455 -       if (expand_stack(vma, ea))
47456 -               goto bad_area;
47457 -good_area:
47458 -       is_write = dsisr & MFC_DSISR_ACCESS_PUT;
47459 -       if (is_write) {
47460 -               if (!(vma->vm_flags & VM_WRITE))
47461 -                       goto bad_area;
47462 -       } else {
47463 -               if (dsisr & MFC_DSISR_ACCESS_DENIED)
47464 -                       goto bad_area;
47465 -               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
47466 -                       goto bad_area;
47467 -       }
47468 -       ret = 0;
47469 -       *flt = handle_mm_fault(mm, vma, ea, is_write);
47470 -       if (unlikely(*flt & VM_FAULT_ERROR)) {
47471 -               if (*flt & VM_FAULT_OOM) {
47472 -                       ret = -ENOMEM;
47473 -                       goto bad_area;
47474 -               } else if (*flt & VM_FAULT_SIGBUS) {
47475 -                       ret = -EFAULT;
47476 -                       goto bad_area;
47477 -               }
47478 -               BUG();
47479 -       }
47480 -       if (*flt & VM_FAULT_MAJOR)
47481 -               current->maj_flt++;
47482 -       else
47483 -               current->min_flt++;
47484 -       up_read(&mm->mmap_sem);
47485 -       return ret;
47486 -
47487 -bad_area:
47488 -       up_read(&mm->mmap_sem);
47489 -       return -EFAULT;
47490 -}
47491 -
47492 -static void spufs_handle_dma_error(struct spu_context *ctx,
47493 +static void spufs_handle_event(struct spu_context *ctx,
47494                                 unsigned long ea, int type)
47495  {
47496 +       siginfo_t info;
47497 +
47498         if (ctx->flags & SPU_CREATE_EVENTS_ENABLED) {
47499                 ctx->event_return |= type;
47500                 wake_up_all(&ctx->stop_wq);
47501 -       } else {
47502 -               siginfo_t info;
47503 -               memset(&info, 0, sizeof(info));
47504 -
47505 -               switch (type) {
47506 -               case SPE_EVENT_INVALID_DMA:
47507 -                       info.si_signo = SIGBUS;
47508 -                       info.si_code = BUS_OBJERR;
47509 -                       break;
47510 -               case SPE_EVENT_SPE_DATA_STORAGE:
47511 -                       info.si_signo = SIGBUS;
47512 -                       info.si_addr = (void __user *)ea;
47513 -                       info.si_code = BUS_ADRERR;
47514 -                       break;
47515 -               case SPE_EVENT_DMA_ALIGNMENT:
47516 -                       info.si_signo = SIGBUS;
47517 -                       /* DAR isn't set for an alignment fault :( */
47518 -                       info.si_code = BUS_ADRALN;
47519 -                       break;
47520 -               case SPE_EVENT_SPE_ERROR:
47521 -                       info.si_signo = SIGILL;
47522 -                       info.si_addr = (void __user *)(unsigned long)
47523 -                               ctx->ops->npc_read(ctx) - 4;
47524 -                       info.si_code = ILL_ILLOPC;
47525 -                       break;
47526 -               }
47527 -               if (info.si_signo)
47528 -                       force_sig_info(info.si_signo, &info, current);
47529 +               return;
47530         }
47531 +
47532 +       memset(&info, 0, sizeof(info));
47533 +
47534 +       switch (type) {
47535 +       case SPE_EVENT_INVALID_DMA:
47536 +               info.si_signo = SIGBUS;
47537 +               info.si_code = BUS_OBJERR;
47538 +               break;
47539 +       case SPE_EVENT_SPE_DATA_STORAGE:
47540 +               info.si_signo = SIGSEGV;
47541 +               info.si_addr = (void __user *)ea;
47542 +               info.si_code = SEGV_ACCERR;
47543 +               ctx->ops->restart_dma(ctx);
47544 +               break;
47545 +       case SPE_EVENT_DMA_ALIGNMENT:
47546 +               info.si_signo = SIGBUS;
47547 +               /* DAR isn't set for an alignment fault :( */
47548 +               info.si_code = BUS_ADRALN;
47549 +               break;
47550 +       case SPE_EVENT_SPE_ERROR:
47551 +               info.si_signo = SIGILL;
47552 +               info.si_addr = (void __user *)(unsigned long)
47553 +                       ctx->ops->npc_read(ctx) - 4;
47554 +               info.si_code = ILL_ILLOPC;
47555 +               break;
47556 +       }
47557 +
47558 +       if (info.si_signo)
47559 +               force_sig_info(info.si_signo, &info, current);
47560  }
47561  
47562 -void spufs_dma_callback(struct spu *spu, int type)
47563 +int spufs_handle_class0(struct spu_context *ctx)
47564  {
47565 -       spufs_handle_dma_error(spu->ctx, spu->dar, type);
47566 +       unsigned long stat = ctx->csa.class_0_pending & CLASS0_INTR_MASK;
47567 +
47568 +       if (likely(!stat))
47569 +               return 0;
47570 +
47571 +       if (stat & CLASS0_DMA_ALIGNMENT_INTR)
47572 +               spufs_handle_event(ctx, ctx->csa.dar, SPE_EVENT_DMA_ALIGNMENT);
47573 +
47574 +       if (stat & CLASS0_INVALID_DMA_COMMAND_INTR)
47575 +               spufs_handle_event(ctx, ctx->csa.dar, SPE_EVENT_INVALID_DMA);
47576 +
47577 +       if (stat & CLASS0_SPU_ERROR_INTR)
47578 +               spufs_handle_event(ctx, ctx->csa.dar, SPE_EVENT_SPE_ERROR);
47579 +
47580 +       return -EIO;
47581  }
47582 -EXPORT_SYMBOL_GPL(spufs_dma_callback);
47583  
47584  /*
47585   * bottom half handler for page faults, we can't do this from
47586 @@ -154,7 +108,7 @@ int spufs_handle_class1(struct spu_conte
47587         u64 ea, dsisr, access;
47588         unsigned long flags;
47589         unsigned flt = 0;
47590 -       int ret;
47591 +       int ret, ret2;
47592  
47593         /*
47594          * dar and dsisr get passed from the registers
47595 @@ -165,16 +119,8 @@ int spufs_handle_class1(struct spu_conte
47596          * in time, we can still expect to get the same fault
47597          * the immediately after the context restore.
47598          */
47599 -       if (ctx->state == SPU_STATE_RUNNABLE) {
47600 -               ea = ctx->spu->dar;
47601 -               dsisr = ctx->spu->dsisr;
47602 -               ctx->spu->dar= ctx->spu->dsisr = 0;
47603 -       } else {
47604 -               ea = ctx->csa.priv1.mfc_dar_RW;
47605 -               dsisr = ctx->csa.priv1.mfc_dsisr_RW;
47606 -               ctx->csa.priv1.mfc_dar_RW = 0;
47607 -               ctx->csa.priv1.mfc_dsisr_RW = 0;
47608 -       }
47609 +       ea = ctx->csa.dar;
47610 +       dsisr = ctx->csa.dsisr;
47611  
47612         if (!(dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED)))
47613                 return 0;
47614 @@ -201,7 +147,22 @@ int spufs_handle_class1(struct spu_conte
47615         if (ret)
47616                 ret = spu_handle_mm_fault(current->mm, ea, dsisr, &flt);
47617  
47618 -       spu_acquire(ctx);
47619 +       /*
47620 +        * If spu_acquire fails due to a pending signal we just want to return
47621 +        * EINTR to userspace even if that means missing the dma restart or
47622 +        * updating the page fault statistics.
47623 +        */
47624 +       ret2 = spu_acquire(ctx);
47625 +       if (ret2)
47626 +               goto out;
47627 +
47628 +       /*
47629 +        * Clear dsisr under ctxt lock after handling the fault, so that
47630 +        * time slicing will not preempt the context while the page fault
47631 +        * handler is running. Context switch code removes mappings.
47632 +        */
47633 +       ctx->csa.dar = ctx->csa.dsisr = 0;
47634 +
47635         /*
47636          * If we handled the fault successfully and are in runnable
47637          * state, restart the DMA.
47638 @@ -222,9 +183,9 @@ int spufs_handle_class1(struct spu_conte
47639                 if (ctx->spu)
47640                         ctx->ops->restart_dma(ctx);
47641         } else
47642 -               spufs_handle_dma_error(ctx, ea, SPE_EVENT_SPE_DATA_STORAGE);
47643 +               spufs_handle_event(ctx, ea, SPE_EVENT_SPE_DATA_STORAGE);
47644  
47645 + out:
47646         spuctx_switch_state(ctx, SPU_UTIL_SYSTEM);
47647         return ret;
47648  }
47649 -EXPORT_SYMBOL_GPL(spufs_handle_class1);
47650 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/file.c
47651 ===================================================================
47652 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/file.c
47653 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/file.c
47654 @@ -40,6 +40,120 @@
47655  
47656  #define SPUFS_MMAP_4K (PAGE_SIZE == 0x1000)
47657  
47658 +/* Simple attribute files */
47659 +struct spufs_attr {
47660 +       int (*get)(void *, u64 *);
47661 +       int (*set)(void *, u64);
47662 +       char get_buf[24];       /* enough to store a u64 and "\n\0" */
47663 +       char set_buf[24];
47664 +       void *data;
47665 +       const char *fmt;        /* format for read operation */
47666 +       struct mutex mutex;     /* protects access to these buffers */
47667 +};
47668 +
47669 +static int spufs_attr_open(struct inode *inode, struct file *file,
47670 +               int (*get)(void *, u64 *), int (*set)(void *, u64),
47671 +               const char *fmt)
47672 +{
47673 +       struct spufs_attr *attr;
47674 +
47675 +       attr = kmalloc(sizeof(*attr), GFP_KERNEL);
47676 +       if (!attr)
47677 +               return -ENOMEM;
47678 +
47679 +       attr->get = get;
47680 +       attr->set = set;
47681 +       attr->data = inode->i_private;
47682 +       attr->fmt = fmt;
47683 +       mutex_init(&attr->mutex);
47684 +       file->private_data = attr;
47685 +
47686 +       return nonseekable_open(inode, file);
47687 +}
47688 +
47689 +static int spufs_attr_release(struct inode *inode, struct file *file)
47690 +{
47691 +       kfree(file->private_data);
47692 +       return 0;
47693 +}
47694 +
47695 +static ssize_t spufs_attr_read(struct file *file, char __user *buf,
47696 +               size_t len, loff_t *ppos)
47697 +{
47698 +       struct spufs_attr *attr;
47699 +       size_t size;
47700 +       ssize_t ret;
47701 +
47702 +       attr = file->private_data;
47703 +       if (!attr->get)
47704 +               return -EACCES;
47705 +
47706 +       ret = mutex_lock_interruptible(&attr->mutex);
47707 +       if (ret)
47708 +               return ret;
47709 +
47710 +       if (*ppos) {            /* continued read */
47711 +               size = strlen(attr->get_buf);
47712 +       } else {                /* first read */
47713 +               u64 val;
47714 +               ret = attr->get(attr->data, &val);
47715 +               if (ret)
47716 +                       goto out;
47717 +
47718 +               size = scnprintf(attr->get_buf, sizeof(attr->get_buf),
47719 +                                attr->fmt, (unsigned long long)val);
47720 +       }
47721 +
47722 +       ret = simple_read_from_buffer(buf, len, ppos, attr->get_buf, size);
47723 +out:
47724 +       mutex_unlock(&attr->mutex);
47725 +       return ret;
47726 +}
47727 +
47728 +static ssize_t spufs_attr_write(struct file *file, const char __user *buf,
47729 +               size_t len, loff_t *ppos)
47730 +{
47731 +       struct spufs_attr *attr;
47732 +       u64 val;
47733 +       size_t size;
47734 +       ssize_t ret;
47735 +
47736 +       attr = file->private_data;
47737 +       if (!attr->set)
47738 +               return -EACCES;
47739 +
47740 +       ret = mutex_lock_interruptible(&attr->mutex);
47741 +       if (ret)
47742 +               return ret;
47743 +
47744 +       ret = -EFAULT;
47745 +       size = min(sizeof(attr->set_buf) - 1, len);
47746 +       if (copy_from_user(attr->set_buf, buf, size))
47747 +               goto out;
47748 +
47749 +       ret = len; /* claim we got the whole input */
47750 +       attr->set_buf[size] = '\0';
47751 +       val = simple_strtol(attr->set_buf, NULL, 0);
47752 +       attr->set(attr->data, val);
47753 +out:
47754 +       mutex_unlock(&attr->mutex);
47755 +       return ret;
47756 +}
47757 +
47758 +#define DEFINE_SPUFS_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt)     \
47759 +static int __fops ## _open(struct inode *inode, struct file *file)     \
47760 +{                                                                      \
47761 +       __simple_attr_check_format(__fmt, 0ull);                        \
47762 +       return spufs_attr_open(inode, file, __get, __set, __fmt);       \
47763 +}                                                                      \
47764 +static struct file_operations __fops = {                               \
47765 +       .owner   = THIS_MODULE,                                         \
47766 +       .open    = __fops ## _open,                                     \
47767 +       .release = spufs_attr_release,                                  \
47768 +       .read    = spufs_attr_read,                                     \
47769 +       .write   = spufs_attr_write,                                    \
47770 +};
47771 +
47772  
47773  static int
47774  spufs_mem_open(struct inode *inode, struct file *file)
47775 @@ -84,9 +198,12 @@ spufs_mem_read(struct file *file, char _
47776         struct spu_context *ctx = file->private_data;
47777         ssize_t ret;
47778  
47779 -       spu_acquire(ctx);
47780 +       ret = spu_acquire(ctx);
47781 +       if (ret)
47782 +               return ret;
47783         ret = __spufs_mem_read(ctx, buffer, size, pos);
47784         spu_release(ctx);
47785 +
47786         return ret;
47787  }
47788  
47789 @@ -106,7 +223,10 @@ spufs_mem_write(struct file *file, const
47790         if (size > LS_SIZE - pos)
47791                 size = LS_SIZE - pos;
47792  
47793 -       spu_acquire(ctx);
47794 +       ret = spu_acquire(ctx);
47795 +       if (ret)
47796 +               return ret;
47797 +
47798         local_store = ctx->ops->get_ls(ctx);
47799         ret = copy_from_user(local_store + pos, buffer, size);
47800         spu_release(ctx);
47801 @@ -146,7 +266,8 @@ static unsigned long spufs_mem_mmap_nopf
47802         pr_debug("spufs_mem_mmap_nopfn address=0x%lx -> 0x%lx, offset=0x%lx\n",
47803                  addr0, address, offset);
47804  
47805 -       spu_acquire(ctx);
47806 +       if (spu_acquire(ctx))
47807 +               return NOPFN_REFAULT;
47808  
47809         if (ctx->state == SPU_STATE_SAVED) {
47810                 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
47811 @@ -236,23 +357,32 @@ static unsigned long spufs_ps_nopfn(stru
47812  {
47813         struct spu_context *ctx = vma->vm_file->private_data;
47814         unsigned long area, offset = address - vma->vm_start;
47815 -       int ret;
47816  
47817         offset += vma->vm_pgoff << PAGE_SHIFT;
47818         if (offset >= ps_size)
47819                 return NOPFN_SIGBUS;
47820  
47821 -       /* error here usually means a signal.. we might want to test
47822 -        * the error code more precisely though
47823 +       /*
47824 +        * We have to wait for context to be loaded before we have
47825 +        * pages to hand out to the user, but we don't want to wait
47826 +        * with the mmap_sem held.
47827 +        * It is possible to drop the mmap_sem here, but then we need
47828 +        * to return NOPFN_REFAULT because the mappings may have
47829 +        * hanged.
47830          */
47831 -       ret = spu_acquire_runnable(ctx, 0);
47832 -       if (ret)
47833 +       if (spu_acquire(ctx))
47834                 return NOPFN_REFAULT;
47835  
47836 -       area = ctx->spu->problem_phys + ps_offs;
47837 -       vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT);
47838 -       spu_release(ctx);
47839 +       if (ctx->state == SPU_STATE_SAVED) {
47840 +               up_read(&current->mm->mmap_sem);
47841 +               spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
47842 +               down_read(&current->mm->mmap_sem);
47843 +       } else {
47844 +               area = ctx->spu->problem_phys + ps_offs;
47845 +               vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT);
47846 +       }
47847  
47848 +       spu_release(ctx);
47849         return NOPFN_REFAULT;
47850  }
47851  
47852 @@ -286,25 +416,32 @@ static int spufs_cntl_mmap(struct file *
47853  #define spufs_cntl_mmap NULL
47854  #endif /* !SPUFS_MMAP_4K */
47855  
47856 -static u64 spufs_cntl_get(void *data)
47857 +static int spufs_cntl_get(void *data, u64 *val)
47858  {
47859         struct spu_context *ctx = data;
47860 -       u64 val;
47861 +       int ret;
47862  
47863 -       spu_acquire(ctx);
47864 -       val = ctx->ops->status_read(ctx);
47865 +       ret = spu_acquire(ctx);
47866 +       if (ret)
47867 +               return ret;
47868 +       *val = ctx->ops->status_read(ctx);
47869         spu_release(ctx);
47870  
47871 -       return val;
47872 +       return 0;
47873  }
47874  
47875 -static void spufs_cntl_set(void *data, u64 val)
47876 +static int spufs_cntl_set(void *data, u64 val)
47877  {
47878         struct spu_context *ctx = data;
47879 +       int ret;
47880  
47881 -       spu_acquire(ctx);
47882 +       ret = spu_acquire(ctx);
47883 +       if (ret)
47884 +               return ret;
47885         ctx->ops->runcntl_write(ctx, val);
47886         spu_release(ctx);
47887 +
47888 +       return 0;
47889  }
47890  
47891  static int spufs_cntl_open(struct inode *inode, struct file *file)
47892 @@ -317,7 +454,7 @@ static int spufs_cntl_open(struct inode 
47893         if (!i->i_openers++)
47894                 ctx->cntl = inode->i_mapping;
47895         mutex_unlock(&ctx->mapping_lock);
47896 -       return simple_attr_open(inode, file, spufs_cntl_get,
47897 +       return spufs_attr_open(inode, file, spufs_cntl_get,
47898                                         spufs_cntl_set, "0x%08lx");
47899  }
47900  
47901 @@ -327,7 +464,7 @@ spufs_cntl_release(struct inode *inode, 
47902         struct spufs_inode_info *i = SPUFS_I(inode);
47903         struct spu_context *ctx = i->i_ctx;
47904  
47905 -       simple_attr_close(inode, file);
47906 +       spufs_attr_release(inode, file);
47907  
47908         mutex_lock(&ctx->mapping_lock);
47909         if (!--i->i_openers)
47910 @@ -339,8 +476,8 @@ spufs_cntl_release(struct inode *inode, 
47911  static const struct file_operations spufs_cntl_fops = {
47912         .open = spufs_cntl_open,
47913         .release = spufs_cntl_release,
47914 -       .read = simple_attr_read,
47915 -       .write = simple_attr_write,
47916 +       .read = spufs_attr_read,
47917 +       .write = spufs_attr_write,
47918         .mmap = spufs_cntl_mmap,
47919  };
47920  
47921 @@ -368,7 +505,9 @@ spufs_regs_read(struct file *file, char 
47922         int ret;
47923         struct spu_context *ctx = file->private_data;
47924  
47925 -       spu_acquire_saved(ctx);
47926 +       ret = spu_acquire_saved(ctx);
47927 +       if (ret)
47928 +               return ret;
47929         ret = __spufs_regs_read(ctx, buffer, size, pos);
47930         spu_release_saved(ctx);
47931         return ret;
47932 @@ -387,7 +526,9 @@ spufs_regs_write(struct file *file, cons
47933                 return -EFBIG;
47934         *pos += size;
47935  
47936 -       spu_acquire_saved(ctx);
47937 +       ret = spu_acquire_saved(ctx);
47938 +       if (ret)
47939 +               return ret;
47940  
47941         ret = copy_from_user(lscsa->gprs + *pos - size,
47942                              buffer, size) ? -EFAULT : size;
47943 @@ -419,7 +560,9 @@ spufs_fpcr_read(struct file *file, char 
47944         int ret;
47945         struct spu_context *ctx = file->private_data;
47946  
47947 -       spu_acquire_saved(ctx);
47948 +       ret = spu_acquire_saved(ctx);
47949 +       if (ret)
47950 +               return ret;
47951         ret = __spufs_fpcr_read(ctx, buffer, size, pos);
47952         spu_release_saved(ctx);
47953         return ret;
47954 @@ -436,10 +579,12 @@ spufs_fpcr_write(struct file *file, cons
47955         size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
47956         if (size <= 0)
47957                 return -EFBIG;
47958 -       *pos += size;
47959  
47960 -       spu_acquire_saved(ctx);
47961 +       ret = spu_acquire_saved(ctx);
47962 +       if (ret)
47963 +               return ret;
47964  
47965 +       *pos += size;
47966         ret = copy_from_user((char *)&lscsa->fpcr + *pos - size,
47967                              buffer, size) ? -EFAULT : size;
47968  
47969 @@ -486,7 +631,10 @@ static ssize_t spufs_mbox_read(struct fi
47970  
47971         udata = (void __user *)buf;
47972  
47973 -       spu_acquire(ctx);
47974 +       count = spu_acquire(ctx);
47975 +       if (count)
47976 +               return count;
47977 +
47978         for (count = 0; (count + 4) <= len; count += 4, udata++) {
47979                 int ret;
47980                 ret = ctx->ops->mbox_read(ctx, &mbox_data);
47981 @@ -522,12 +670,15 @@ static ssize_t spufs_mbox_stat_read(stru
47982                         size_t len, loff_t *pos)
47983  {
47984         struct spu_context *ctx = file->private_data;
47985 +       ssize_t ret;
47986         u32 mbox_stat;
47987  
47988         if (len < 4)
47989                 return -EINVAL;
47990  
47991 -       spu_acquire(ctx);
47992 +       ret = spu_acquire(ctx);
47993 +       if (ret)
47994 +               return ret;
47995  
47996         mbox_stat = ctx->ops->mbox_stat_read(ctx) & 0xff;
47997  
47998 @@ -562,6 +713,9 @@ void spufs_ibox_callback(struct spu *spu
47999  {
48000         struct spu_context *ctx = spu->ctx;
48001  
48002 +       if (!ctx)
48003 +               return;
48004 +
48005         wake_up_all(&ctx->ibox_wq);
48006         kill_fasync(&ctx->ibox_fasync, SIGIO, POLLIN);
48007  }
48008 @@ -593,7 +747,9 @@ static ssize_t spufs_ibox_read(struct fi
48009  
48010         udata = (void __user *)buf;
48011  
48012 -       spu_acquire(ctx);
48013 +       count = spu_acquire(ctx);
48014 +       if (count)
48015 +               return count;
48016  
48017         /* wait only for the first element */
48018         count = 0;
48019 @@ -639,7 +795,11 @@ static unsigned int spufs_ibox_poll(stru
48020  
48021         poll_wait(file, &ctx->ibox_wq, wait);
48022  
48023 -       spu_acquire(ctx);
48024 +       /*
48025 +        * For now keep this uninterruptible and also ignore the rule
48026 +        * that poll should not sleep.  Will be fixed later.
48027 +        */
48028 +       mutex_lock(&ctx->state_mutex);
48029         mask = ctx->ops->mbox_stat_poll(ctx, POLLIN | POLLRDNORM);
48030         spu_release(ctx);
48031  
48032 @@ -657,12 +817,15 @@ static ssize_t spufs_ibox_stat_read(stru
48033                         size_t len, loff_t *pos)
48034  {
48035         struct spu_context *ctx = file->private_data;
48036 +       ssize_t ret;
48037         u32 ibox_stat;
48038  
48039         if (len < 4)
48040                 return -EINVAL;
48041  
48042 -       spu_acquire(ctx);
48043 +       ret = spu_acquire(ctx);
48044 +       if (ret)
48045 +               return ret;
48046         ibox_stat = (ctx->ops->mbox_stat_read(ctx) >> 16) & 0xff;
48047         spu_release(ctx);
48048  
48049 @@ -698,6 +861,9 @@ void spufs_wbox_callback(struct spu *spu
48050  {
48051         struct spu_context *ctx = spu->ctx;
48052  
48053 +       if (!ctx)
48054 +               return;
48055 +
48056         wake_up_all(&ctx->wbox_wq);
48057         kill_fasync(&ctx->wbox_fasync, SIGIO, POLLOUT);
48058  }
48059 @@ -731,7 +897,9 @@ static ssize_t spufs_wbox_write(struct f
48060         if (__get_user(wbox_data, udata))
48061                 return -EFAULT;
48062  
48063 -       spu_acquire(ctx);
48064 +       count = spu_acquire(ctx);
48065 +       if (count)
48066 +               return count;
48067  
48068         /*
48069          * make sure we can at least write one element, by waiting
48070 @@ -772,7 +940,11 @@ static unsigned int spufs_wbox_poll(stru
48071  
48072         poll_wait(file, &ctx->wbox_wq, wait);
48073  
48074 -       spu_acquire(ctx);
48075 +       /*
48076 +        * For now keep this uninterruptible and also ignore the rule
48077 +        * that poll should not sleep.  Will be fixed later.
48078 +        */
48079 +       mutex_lock(&ctx->state_mutex);
48080         mask = ctx->ops->mbox_stat_poll(ctx, POLLOUT | POLLWRNORM);
48081         spu_release(ctx);
48082  
48083 @@ -790,12 +962,15 @@ static ssize_t spufs_wbox_stat_read(stru
48084                         size_t len, loff_t *pos)
48085  {
48086         struct spu_context *ctx = file->private_data;
48087 +       ssize_t ret;
48088         u32 wbox_stat;
48089  
48090         if (len < 4)
48091                 return -EINVAL;
48092  
48093 -       spu_acquire(ctx);
48094 +       ret = spu_acquire(ctx);
48095 +       if (ret)
48096 +               return ret;
48097         wbox_stat = (ctx->ops->mbox_stat_read(ctx) >> 8) & 0xff;
48098         spu_release(ctx);
48099  
48100 @@ -866,7 +1041,9 @@ static ssize_t spufs_signal1_read(struct
48101         int ret;
48102         struct spu_context *ctx = file->private_data;
48103  
48104 -       spu_acquire_saved(ctx);
48105 +       ret = spu_acquire_saved(ctx);
48106 +       if (ret)
48107 +               return ret;
48108         ret = __spufs_signal1_read(ctx, buf, len, pos);
48109         spu_release_saved(ctx);
48110  
48111 @@ -877,6 +1054,7 @@ static ssize_t spufs_signal1_write(struc
48112                         size_t len, loff_t *pos)
48113  {
48114         struct spu_context *ctx;
48115 +       ssize_t ret;
48116         u32 data;
48117  
48118         ctx = file->private_data;
48119 @@ -887,7 +1065,9 @@ static ssize_t spufs_signal1_write(struc
48120         if (copy_from_user(&data, buf, 4))
48121                 return -EFAULT;
48122  
48123 -       spu_acquire(ctx);
48124 +       ret = spu_acquire(ctx);
48125 +       if (ret)
48126 +               return ret;
48127         ctx->ops->signal1_write(ctx, data);
48128         spu_release(ctx);
48129  
48130 @@ -997,7 +1177,9 @@ static ssize_t spufs_signal2_read(struct
48131         struct spu_context *ctx = file->private_data;
48132         int ret;
48133  
48134 -       spu_acquire_saved(ctx);
48135 +       ret = spu_acquire_saved(ctx);
48136 +       if (ret)
48137 +               return ret;
48138         ret = __spufs_signal2_read(ctx, buf, len, pos);
48139         spu_release_saved(ctx);
48140  
48141 @@ -1008,6 +1190,7 @@ static ssize_t spufs_signal2_write(struc
48142                         size_t len, loff_t *pos)
48143  {
48144         struct spu_context *ctx;
48145 +       ssize_t ret;
48146         u32 data;
48147  
48148         ctx = file->private_data;
48149 @@ -1018,7 +1201,9 @@ static ssize_t spufs_signal2_write(struc
48150         if (copy_from_user(&data, buf, 4))
48151                 return -EFAULT;
48152  
48153 -       spu_acquire(ctx);
48154 +       ret = spu_acquire(ctx);
48155 +       if (ret)
48156 +               return ret;
48157         ctx->ops->signal2_write(ctx, data);
48158         spu_release(ctx);
48159  
48160 @@ -1086,33 +1271,42 @@ static const struct file_operations spuf
48161  #define SPU_ATTR_ACQUIRE_SAVED 2
48162  
48163  #define DEFINE_SPUFS_ATTRIBUTE(__name, __get, __set, __fmt, __acquire) \
48164 -static u64 __##__get(void *data)                                       \
48165 +static int __##__get(void *data, u64 *val)                             \
48166  {                                                                      \
48167         struct spu_context *ctx = data;                                 \
48168 -       u64 ret;                                                        \
48169 +       int ret = 0;                                                    \
48170                                                                         \
48171         if (__acquire == SPU_ATTR_ACQUIRE) {                            \
48172 -               spu_acquire(ctx);                                       \
48173 -               ret = __get(ctx);                                       \
48174 +               ret = spu_acquire(ctx);                                 \
48175 +               if (ret)                                                \
48176 +                       return ret;                                     \
48177 +               *val = __get(ctx);                                      \
48178                 spu_release(ctx);                                       \
48179         } else if (__acquire == SPU_ATTR_ACQUIRE_SAVED) {               \
48180 -               spu_acquire_saved(ctx);                                 \
48181 -               ret = __get(ctx);                                       \
48182 +               ret = spu_acquire_saved(ctx);                           \
48183 +               if (ret)                                                \
48184 +                       return ret;                                     \
48185 +               *val = __get(ctx);                                      \
48186                 spu_release_saved(ctx);                                 \
48187         } else                                                          \
48188 -               ret = __get(ctx);                                       \
48189 +               *val = __get(ctx);                                      \
48190                                                                         \
48191 -       return ret;                                                     \
48192 +       return 0;                                                       \
48193  }                                                                      \
48194 -DEFINE_SIMPLE_ATTRIBUTE(__name, __##__get, __set, __fmt);
48195 +DEFINE_SPUFS_SIMPLE_ATTRIBUTE(__name, __##__get, __set, __fmt);
48196  
48197 -static void spufs_signal1_type_set(void *data, u64 val)
48198 +static int spufs_signal1_type_set(void *data, u64 val)
48199  {
48200         struct spu_context *ctx = data;
48201 +       int ret;
48202  
48203 -       spu_acquire(ctx);
48204 +       ret = spu_acquire(ctx);
48205 +       if (ret)
48206 +               return ret;
48207         ctx->ops->signal1_type_set(ctx, val);
48208         spu_release(ctx);
48209 +
48210 +       return 0;
48211  }
48212  
48213  static u64 spufs_signal1_type_get(struct spu_context *ctx)
48214 @@ -1123,13 +1317,18 @@ DEFINE_SPUFS_ATTRIBUTE(spufs_signal1_typ
48215                        spufs_signal1_type_set, "%llu", SPU_ATTR_ACQUIRE);
48216  
48217  
48218 -static void spufs_signal2_type_set(void *data, u64 val)
48219 +static int spufs_signal2_type_set(void *data, u64 val)
48220  {
48221         struct spu_context *ctx = data;
48222 +       int ret;
48223  
48224 -       spu_acquire(ctx);
48225 +       ret = spu_acquire(ctx);
48226 +       if (ret)
48227 +               return ret;
48228         ctx->ops->signal2_type_set(ctx, val);
48229         spu_release(ctx);
48230 +
48231 +       return 0;
48232  }
48233  
48234  static u64 spufs_signal2_type_get(struct spu_context *ctx)
48235 @@ -1329,6 +1528,9 @@ void spufs_mfc_callback(struct spu *spu)
48236  {
48237         struct spu_context *ctx = spu->ctx;
48238  
48239 +       if (!ctx)
48240 +               return;
48241 +
48242         wake_up_all(&ctx->mfc_wq);
48243  
48244         pr_debug("%s %s\n", __FUNCTION__, spu->name);
48245 @@ -1375,12 +1577,17 @@ static ssize_t spufs_mfc_read(struct fil
48246         if (size != 4)
48247                 goto out;
48248  
48249 -       spu_acquire(ctx);
48250 +       ret = spu_acquire(ctx);
48251 +       if (ret)
48252 +               return ret;
48253 +
48254 +       ret = -EINVAL;
48255         if (file->f_flags & O_NONBLOCK) {
48256                 status = ctx->ops->read_mfc_tagstatus(ctx);
48257                 if (!(status & ctx->tagwait))
48258                         ret = -EAGAIN;
48259                 else
48260 +                       /* XXX(hch): shouldn't we clear ret here? */
48261                         ctx->tagwait &= ~status;
48262         } else {
48263                 ret = spufs_wait(ctx->mfc_wq,
48264 @@ -1505,7 +1712,11 @@ static ssize_t spufs_mfc_write(struct fi
48265         if (ret)
48266                 goto out;
48267  
48268 -       ret = spu_acquire_runnable(ctx, 0);
48269 +       ret = spu_acquire(ctx);
48270 +       if (ret)
48271 +               goto out;
48272 +
48273 +       ret = spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
48274         if (ret)
48275                 goto out;
48276  
48277 @@ -1539,7 +1750,11 @@ static unsigned int spufs_mfc_poll(struc
48278  
48279         poll_wait(file, &ctx->mfc_wq, wait);
48280  
48281 -       spu_acquire(ctx);
48282 +       /*
48283 +        * For now keep this uninterruptible and also ignore the rule
48284 +        * that poll should not sleep.  Will be fixed later.
48285 +        */
48286 +       mutex_lock(&ctx->state_mutex);
48287         ctx->ops->set_mfc_query(ctx, ctx->tagwait, 2);
48288         free_elements = ctx->ops->get_mfc_free_elements(ctx);
48289         tagstatus = ctx->ops->read_mfc_tagstatus(ctx);
48290 @@ -1562,7 +1777,9 @@ static int spufs_mfc_flush(struct file *
48291         struct spu_context *ctx = file->private_data;
48292         int ret;
48293  
48294 -       spu_acquire(ctx);
48295 +       ret = spu_acquire(ctx);
48296 +       if (ret)
48297 +               return ret;
48298  #if 0
48299  /* this currently hangs */
48300         ret = spufs_wait(ctx->mfc_wq,
48301 @@ -1605,12 +1822,18 @@ static const struct file_operations spuf
48302         .mmap    = spufs_mfc_mmap,
48303  };
48304  
48305 -static void spufs_npc_set(void *data, u64 val)
48306 +static int spufs_npc_set(void *data, u64 val)
48307  {
48308         struct spu_context *ctx = data;
48309 -       spu_acquire(ctx);
48310 +       int ret;
48311 +
48312 +       ret = spu_acquire(ctx);
48313 +       if (ret)
48314 +               return ret;
48315         ctx->ops->npc_write(ctx, val);
48316         spu_release(ctx);
48317 +
48318 +       return 0;
48319  }
48320  
48321  static u64 spufs_npc_get(struct spu_context *ctx)
48322 @@ -1620,13 +1843,19 @@ static u64 spufs_npc_get(struct spu_cont
48323  DEFINE_SPUFS_ATTRIBUTE(spufs_npc_ops, spufs_npc_get, spufs_npc_set,
48324                        "0x%llx\n", SPU_ATTR_ACQUIRE);
48325  
48326 -static void spufs_decr_set(void *data, u64 val)
48327 +static int spufs_decr_set(void *data, u64 val)
48328  {
48329         struct spu_context *ctx = data;
48330         struct spu_lscsa *lscsa = ctx->csa.lscsa;
48331 -       spu_acquire_saved(ctx);
48332 +       int ret;
48333 +
48334 +       ret = spu_acquire_saved(ctx);
48335 +       if (ret)
48336 +               return ret;
48337         lscsa->decr.slot[0] = (u32) val;
48338         spu_release_saved(ctx);
48339 +
48340 +       return 0;
48341  }
48342  
48343  static u64 spufs_decr_get(struct spu_context *ctx)
48344 @@ -1637,15 +1866,21 @@ static u64 spufs_decr_get(struct spu_con
48345  DEFINE_SPUFS_ATTRIBUTE(spufs_decr_ops, spufs_decr_get, spufs_decr_set,
48346                        "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED);
48347  
48348 -static void spufs_decr_status_set(void *data, u64 val)
48349 +static int spufs_decr_status_set(void *data, u64 val)
48350  {
48351         struct spu_context *ctx = data;
48352 -       spu_acquire_saved(ctx);
48353 +       int ret;
48354 +
48355 +       ret = spu_acquire_saved(ctx);
48356 +       if (ret)
48357 +               return ret;
48358         if (val)
48359                 ctx->csa.priv2.mfc_control_RW |= MFC_CNTL_DECREMENTER_RUNNING;
48360         else
48361                 ctx->csa.priv2.mfc_control_RW &= ~MFC_CNTL_DECREMENTER_RUNNING;
48362         spu_release_saved(ctx);
48363 +
48364 +       return 0;
48365  }
48366  
48367  static u64 spufs_decr_status_get(struct spu_context *ctx)
48368 @@ -1659,13 +1894,19 @@ DEFINE_SPUFS_ATTRIBUTE(spufs_decr_status
48369                        spufs_decr_status_set, "0x%llx\n",
48370                        SPU_ATTR_ACQUIRE_SAVED);
48371  
48372 -static void spufs_event_mask_set(void *data, u64 val)
48373 +static int spufs_event_mask_set(void *data, u64 val)
48374  {
48375         struct spu_context *ctx = data;
48376         struct spu_lscsa *lscsa = ctx->csa.lscsa;
48377 -       spu_acquire_saved(ctx);
48378 +       int ret;
48379 +
48380 +       ret = spu_acquire_saved(ctx);
48381 +       if (ret)
48382 +               return ret;
48383         lscsa->event_mask.slot[0] = (u32) val;
48384         spu_release_saved(ctx);
48385 +
48386 +       return 0;
48387  }
48388  
48389  static u64 spufs_event_mask_get(struct spu_context *ctx)
48390 @@ -1690,13 +1931,19 @@ static u64 spufs_event_status_get(struct
48391  DEFINE_SPUFS_ATTRIBUTE(spufs_event_status_ops, spufs_event_status_get,
48392                        NULL, "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED)
48393  
48394 -static void spufs_srr0_set(void *data, u64 val)
48395 +static int spufs_srr0_set(void *data, u64 val)
48396  {
48397         struct spu_context *ctx = data;
48398         struct spu_lscsa *lscsa = ctx->csa.lscsa;
48399 -       spu_acquire_saved(ctx);
48400 +       int ret;
48401 +
48402 +       ret = spu_acquire_saved(ctx);
48403 +       if (ret)
48404 +               return ret;
48405         lscsa->srr0.slot[0] = (u32) val;
48406         spu_release_saved(ctx);
48407 +
48408 +       return 0;
48409  }
48410  
48411  static u64 spufs_srr0_get(struct spu_context *ctx)
48412 @@ -1727,10 +1974,12 @@ static u64 spufs_object_id_get(struct sp
48413         return ctx->object_id;
48414  }
48415  
48416 -static void spufs_object_id_set(void *data, u64 id)
48417 +static int spufs_object_id_set(void *data, u64 id)
48418  {
48419         struct spu_context *ctx = data;
48420         ctx->object_id = id;
48421 +
48422 +       return 0;
48423  }
48424  
48425  DEFINE_SPUFS_ATTRIBUTE(spufs_object_id_ops, spufs_object_id_get,
48426 @@ -1777,13 +2026,13 @@ static const struct file_operations spuf
48427  static ssize_t __spufs_mbox_info_read(struct spu_context *ctx,
48428                         char __user *buf, size_t len, loff_t *pos)
48429  {
48430 -       u32 mbox_stat;
48431         u32 data;
48432  
48433 -       mbox_stat = ctx->csa.prob.mb_stat_R;
48434 -       if (mbox_stat & 0x0000ff) {
48435 -               data = ctx->csa.prob.pu_mb_R;
48436 -       }
48437 +       /* EOF if there's no entry in the mbox */
48438 +       if (!(ctx->csa.prob.mb_stat_R & 0x0000ff))
48439 +               return 0;
48440 +
48441 +       data = ctx->csa.prob.pu_mb_R;
48442  
48443         return simple_read_from_buffer(buf, len, pos, &data, sizeof data);
48444  }
48445 @@ -1797,7 +2046,9 @@ static ssize_t spufs_mbox_info_read(stru
48446         if (!access_ok(VERIFY_WRITE, buf, len))
48447                 return -EFAULT;
48448  
48449 -       spu_acquire_saved(ctx);
48450 +       ret = spu_acquire_saved(ctx);
48451 +       if (ret)
48452 +               return ret;
48453         spin_lock(&ctx->csa.register_lock);
48454         ret = __spufs_mbox_info_read(ctx, buf, len, pos);
48455         spin_unlock(&ctx->csa.register_lock);
48456 @@ -1815,13 +2066,13 @@ static const struct file_operations spuf
48457  static ssize_t __spufs_ibox_info_read(struct spu_context *ctx,
48458                                 char __user *buf, size_t len, loff_t *pos)
48459  {
48460 -       u32 ibox_stat;
48461         u32 data;
48462  
48463 -       ibox_stat = ctx->csa.prob.mb_stat_R;
48464 -       if (ibox_stat & 0xff0000) {
48465 -               data = ctx->csa.priv2.puint_mb_R;
48466 -       }
48467 +       /* EOF if there's no entry in the ibox */
48468 +       if (!(ctx->csa.prob.mb_stat_R & 0xff0000))
48469 +               return 0;
48470 +
48471 +       data = ctx->csa.priv2.puint_mb_R;
48472  
48473         return simple_read_from_buffer(buf, len, pos, &data, sizeof data);
48474  }
48475 @@ -1835,7 +2086,9 @@ static ssize_t spufs_ibox_info_read(stru
48476         if (!access_ok(VERIFY_WRITE, buf, len))
48477                 return -EFAULT;
48478  
48479 -       spu_acquire_saved(ctx);
48480 +       ret = spu_acquire_saved(ctx);
48481 +       if (ret)
48482 +               return ret;
48483         spin_lock(&ctx->csa.register_lock);
48484         ret = __spufs_ibox_info_read(ctx, buf, len, pos);
48485         spin_unlock(&ctx->csa.register_lock);
48486 @@ -1876,7 +2129,9 @@ static ssize_t spufs_wbox_info_read(stru
48487         if (!access_ok(VERIFY_WRITE, buf, len))
48488                 return -EFAULT;
48489  
48490 -       spu_acquire_saved(ctx);
48491 +       ret = spu_acquire_saved(ctx);
48492 +       if (ret)
48493 +               return ret;
48494         spin_lock(&ctx->csa.register_lock);
48495         ret = __spufs_wbox_info_read(ctx, buf, len, pos);
48496         spin_unlock(&ctx->csa.register_lock);
48497 @@ -1926,7 +2181,9 @@ static ssize_t spufs_dma_info_read(struc
48498         if (!access_ok(VERIFY_WRITE, buf, len))
48499                 return -EFAULT;
48500  
48501 -       spu_acquire_saved(ctx);
48502 +       ret = spu_acquire_saved(ctx);
48503 +       if (ret)
48504 +               return ret;
48505         spin_lock(&ctx->csa.register_lock);
48506         ret = __spufs_dma_info_read(ctx, buf, len, pos);
48507         spin_unlock(&ctx->csa.register_lock);
48508 @@ -1977,7 +2234,9 @@ static ssize_t spufs_proxydma_info_read(
48509         struct spu_context *ctx = file->private_data;
48510         int ret;
48511  
48512 -       spu_acquire_saved(ctx);
48513 +       ret = spu_acquire_saved(ctx);
48514 +       if (ret)
48515 +               return ret;
48516         spin_lock(&ctx->csa.register_lock);
48517         ret = __spufs_proxydma_info_read(ctx, buf, len, pos);
48518         spin_unlock(&ctx->csa.register_lock);
48519 @@ -2066,8 +2325,12 @@ static unsigned long long spufs_class2_i
48520  static int spufs_show_stat(struct seq_file *s, void *private)
48521  {
48522         struct spu_context *ctx = s->private;
48523 +       int ret;
48524 +
48525 +       ret = spu_acquire(ctx);
48526 +       if (ret)
48527 +               return ret;
48528  
48529 -       spu_acquire(ctx);
48530         seq_printf(s, "%s %llu %llu %llu %llu "
48531                       "%llu %llu %llu %llu %llu %llu %llu %llu\n",
48532                 ctx_state_names[ctx->stats.util_state],
48533 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/hw_ops.c
48534 ===================================================================
48535 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/hw_ops.c
48536 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/hw_ops.c
48537 @@ -76,16 +76,18 @@ static unsigned int spu_hw_mbox_stat_pol
48538                 if (stat & 0xff0000)
48539                         ret |= POLLIN | POLLRDNORM;
48540                 else {
48541 -                       spu_int_stat_clear(spu, 2, 0x1);
48542 -                       spu_int_mask_or(spu, 2, 0x1);
48543 +                       spu_int_stat_clear(spu, 2, CLASS2_MAILBOX_INTR);
48544 +                       spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
48545                 }
48546         }
48547         if (events & (POLLOUT | POLLWRNORM)) {
48548                 if (stat & 0x00ff00)
48549                         ret = POLLOUT | POLLWRNORM;
48550                 else {
48551 -                       spu_int_stat_clear(spu, 2, 0x10);
48552 -                       spu_int_mask_or(spu, 2, 0x10);
48553 +                       spu_int_stat_clear(spu, 2,
48554 +                                       CLASS2_MAILBOX_THRESHOLD_INTR);
48555 +                       spu_int_mask_or(spu, 2,
48556 +                                       CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR);
48557                 }
48558         }
48559         spin_unlock_irq(&spu->register_lock);
48560 @@ -106,7 +108,7 @@ static int spu_hw_ibox_read(struct spu_c
48561                 ret = 4;
48562         } else {
48563                 /* make sure we get woken up by the interrupt */
48564 -               spu_int_mask_or(spu, 2, 0x1);
48565 +               spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
48566                 ret = 0;
48567         }
48568         spin_unlock_irq(&spu->register_lock);
48569 @@ -127,7 +129,7 @@ static int spu_hw_wbox_write(struct spu_
48570         } else {
48571                 /* make sure we get woken up by the interrupt when space
48572                    becomes available */
48573 -               spu_int_mask_or(spu, 2, 0x10);
48574 +               spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR);
48575                 ret = 0;
48576         }
48577         spin_unlock_irq(&spu->register_lock);
48578 @@ -206,6 +208,11 @@ static char *spu_hw_get_ls(struct spu_co
48579         return ctx->spu->local_store;
48580  }
48581  
48582 +static void spu_hw_privcntl_write(struct spu_context *ctx, u64 val)
48583 +{
48584 +       out_be64(&ctx->spu->priv2->spu_privcntl_RW, val);
48585 +}
48586 +
48587  static u32 spu_hw_runcntl_read(struct spu_context *ctx)
48588  {
48589         return in_be32(&ctx->spu->problem->spu_runcntl_RW);
48590 @@ -215,11 +222,21 @@ static void spu_hw_runcntl_write(struct 
48591  {
48592         spin_lock_irq(&ctx->spu->register_lock);
48593         if (val & SPU_RUNCNTL_ISOLATE)
48594 -               out_be64(&ctx->spu->priv2->spu_privcntl_RW, 4LL);
48595 +               spu_hw_privcntl_write(ctx,
48596 +                       SPU_PRIVCNT_LOAD_REQUEST_ENABLE_MASK);
48597         out_be32(&ctx->spu->problem->spu_runcntl_RW, val);
48598         spin_unlock_irq(&ctx->spu->register_lock);
48599  }
48600  
48601 +static void spu_hw_runcntl_stop(struct spu_context *ctx)
48602 +{
48603 +       spin_lock_irq(&ctx->spu->register_lock);
48604 +       out_be32(&ctx->spu->problem->spu_runcntl_RW, SPU_RUNCNTL_STOP);
48605 +       while (in_be32(&ctx->spu->problem->spu_status_R) & SPU_STATUS_RUNNING)
48606 +               cpu_relax();
48607 +       spin_unlock_irq(&ctx->spu->register_lock);
48608 +}
48609 +
48610  static void spu_hw_master_start(struct spu_context *ctx)
48611  {
48612         struct spu *spu = ctx->spu;
48613 @@ -319,8 +336,10 @@ struct spu_context_ops spu_hw_ops = {
48614         .npc_write = spu_hw_npc_write,
48615         .status_read = spu_hw_status_read,
48616         .get_ls = spu_hw_get_ls,
48617 +       .privcntl_write = spu_hw_privcntl_write,
48618         .runcntl_read = spu_hw_runcntl_read,
48619         .runcntl_write = spu_hw_runcntl_write,
48620 +       .runcntl_stop = spu_hw_runcntl_stop,
48621         .master_start = spu_hw_master_start,
48622         .master_stop = spu_hw_master_stop,
48623         .set_mfc_query = spu_hw_set_mfc_query,
48624 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
48625 ===================================================================
48626 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
48627 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
48628 @@ -28,6 +28,8 @@
48629  #include <asm/spu_csa.h>
48630  #include <asm/mmu.h>
48631  
48632 +#include "spufs.h"
48633 +
48634  static int spu_alloc_lscsa_std(struct spu_state *csa)
48635  {
48636         struct spu_lscsa *lscsa;
48637 @@ -73,7 +75,7 @@ int spu_alloc_lscsa(struct spu_state *cs
48638         int             i, j, n_4k;
48639  
48640         /* Check availability of 64K pages */
48641 -       if (mmu_psize_defs[MMU_PAGE_64K].shift == 0)
48642 +       if (!spu_64k_pages_available())
48643                 goto fail;
48644  
48645         csa->use_big_pages = 1;
48646 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/run.c
48647 ===================================================================
48648 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/run.c
48649 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/run.c
48650 @@ -15,24 +15,55 @@ void spufs_stop_callback(struct spu *spu
48651  {
48652         struct spu_context *ctx = spu->ctx;
48653  
48654 -       wake_up_all(&ctx->stop_wq);
48655 +       /*
48656 +        * It should be impossible to preempt a context while an exception
48657 +        * is being processed, since the context switch code is specially
48658 +        * coded to deal with interrupts ... But, just in case, sanity check
48659 +        * the context pointer.  It is OK to return doing nothing since
48660 +        * the exception will be regenerated when the context is resumed.
48661 +        */
48662 +       if (ctx) {
48663 +               /* Copy exception arguments into module specific structure */
48664 +               ctx->csa.class_0_pending = spu->class_0_pending;
48665 +               ctx->csa.dsisr = spu->dsisr;
48666 +               ctx->csa.dar = spu->dar;
48667 +
48668 +               /* ensure that the exception status has hit memory before a
48669 +                * thread waiting on the context's stop queue is woken */
48670 +               smp_wmb();
48671 +
48672 +               wake_up_all(&ctx->stop_wq);
48673 +       }
48674 +
48675 +       /* Clear callback arguments from spu structure */
48676 +       spu->class_0_pending = 0;
48677 +       spu->dsisr = 0;
48678 +       spu->dar = 0;
48679  }
48680  
48681 -static inline int spu_stopped(struct spu_context *ctx, u32 *stat)
48682 +int spu_stopped(struct spu_context *ctx, u32 *stat)
48683  {
48684 -       struct spu *spu;
48685 -       u64 pte_fault;
48686 +       u64 dsisr;
48687 +       u32 stopped;
48688  
48689         *stat = ctx->ops->status_read(ctx);
48690  
48691 -       spu = ctx->spu;
48692 -       if (ctx->state != SPU_STATE_RUNNABLE ||
48693 -           test_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags))
48694 +       if (test_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags))
48695 +               return 1;
48696 +
48697 +       stopped = SPU_STATUS_INVALID_INSTR | SPU_STATUS_SINGLE_STEP |
48698 +               SPU_STATUS_STOPPED_BY_HALT | SPU_STATUS_STOPPED_BY_STOP;
48699 +       if (*stat & stopped)
48700 +               return 1;
48701 +
48702 +       dsisr = ctx->csa.dsisr;
48703 +       if (dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED))
48704                 return 1;
48705 -       pte_fault = spu->dsisr &
48706 -           (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED);
48707 -       return (!(*stat & SPU_STATUS_RUNNING) || pte_fault || spu->class_0_pending) ?
48708 -               1 : 0;
48709 +
48710 +       if (ctx->csa.class_0_pending)
48711 +               return 1;
48712 +
48713 +       return 0;
48714  }
48715  
48716  static int spu_setup_isolated(struct spu_context *ctx)
48717 @@ -128,34 +159,66 @@ out:
48718  
48719  static int spu_run_init(struct spu_context *ctx, u32 *npc)
48720  {
48721 +       unsigned long runcntl = SPU_RUNCNTL_RUNNABLE;
48722 +       int ret;
48723 +
48724         spuctx_switch_state(ctx, SPU_UTIL_SYSTEM);
48725  
48726 -       if (ctx->flags & SPU_CREATE_ISOLATE) {
48727 -               unsigned long runcntl;
48728 +       /*
48729 +        * NOSCHED is synchronous scheduling with respect to the caller.
48730 +        * The caller waits for the context to be loaded.
48731 +        */
48732 +       if (ctx->flags & SPU_CREATE_NOSCHED) {
48733 +               if (ctx->state == SPU_STATE_SAVED) {
48734 +                       ret = spu_activate(ctx, 0);
48735 +                       if (ret)
48736 +                               return ret;
48737 +               }
48738 +       }
48739  
48740 +       /*
48741 +        * Apply special setup as required.
48742 +        */
48743 +       if (ctx->flags & SPU_CREATE_ISOLATE) {
48744                 if (!(ctx->ops->status_read(ctx) & SPU_STATUS_ISOLATED_STATE)) {
48745 -                       int ret = spu_setup_isolated(ctx);
48746 +                       ret = spu_setup_isolated(ctx);
48747                         if (ret)
48748                                 return ret;
48749                 }
48750  
48751 -               /* if userspace has set the runcntrl register (eg, to issue an
48752 -                * isolated exit), we need to re-set it here */
48753 +               /*
48754 +                * If userspace has set the runcntrl register (eg, to
48755 +                * issue an isolated exit), we need to re-set it here
48756 +                */
48757                 runcntl = ctx->ops->runcntl_read(ctx) &
48758                         (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE);
48759                 if (runcntl == 0)
48760                         runcntl = SPU_RUNCNTL_RUNNABLE;
48761 +       }
48762 +
48763 +       if (ctx->flags & SPU_CREATE_NOSCHED) {
48764 +               spuctx_switch_state(ctx, SPU_UTIL_USER);
48765                 ctx->ops->runcntl_write(ctx, runcntl);
48766         } else {
48767 -               unsigned long mode = SPU_PRIVCNTL_MODE_NORMAL;
48768 -               ctx->ops->npc_write(ctx, *npc);
48769 +               unsigned long privcntl;
48770 +
48771                 if (test_thread_flag(TIF_SINGLESTEP))
48772 -                       mode = SPU_PRIVCNTL_MODE_SINGLE_STEP;
48773 -               out_be64(&ctx->spu->priv2->spu_privcntl_RW, mode);
48774 -               ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
48775 -       }
48776 +                       privcntl = SPU_PRIVCNTL_MODE_SINGLE_STEP;
48777 +               else
48778 +                       privcntl = SPU_PRIVCNTL_MODE_NORMAL;
48779  
48780 -       spuctx_switch_state(ctx, SPU_UTIL_USER);
48781 +               ctx->ops->npc_write(ctx, *npc);
48782 +               ctx->ops->privcntl_write(ctx, privcntl);
48783 +               ctx->ops->runcntl_write(ctx, runcntl);
48784 +
48785 +               if (ctx->state == SPU_STATE_SAVED) {
48786 +                       ret = spu_activate(ctx, 0);
48787 +                       if (ret)
48788 +                               return ret;
48789 +               } else {
48790 +                       spuctx_switch_state(ctx, SPU_UTIL_USER);
48791 +               }
48792 +       }
48793  
48794         return 0;
48795  }
48796 @@ -165,6 +228,8 @@ static int spu_run_fini(struct spu_conte
48797  {
48798         int ret = 0;
48799  
48800 +       spu_del_from_rq(ctx);
48801 +
48802         *status = ctx->ops->status_read(ctx);
48803         *npc = ctx->ops->npc_read(ctx);
48804  
48805 @@ -177,26 +242,6 @@ static int spu_run_fini(struct spu_conte
48806         return ret;
48807  }
48808  
48809 -static int spu_reacquire_runnable(struct spu_context *ctx, u32 *npc,
48810 -                                        u32 *status)
48811 -{
48812 -       int ret;
48813 -
48814 -       ret = spu_run_fini(ctx, npc, status);
48815 -       if (ret)
48816 -               return ret;
48817 -
48818 -       if (*status & (SPU_STATUS_STOPPED_BY_STOP | SPU_STATUS_STOPPED_BY_HALT))
48819 -               return *status;
48820 -
48821 -       ret = spu_acquire_runnable(ctx, 0);
48822 -       if (ret)
48823 -               return ret;
48824 -
48825 -       spuctx_switch_state(ctx, SPU_UTIL_USER);
48826 -       return 0;
48827 -}
48828 -
48829  /*
48830   * SPU syscall restarting is tricky because we violate the basic
48831   * assumption that the signal handler is running on the interrupted
48832 @@ -247,7 +292,7 @@ static int spu_process_callback(struct s
48833         u32 ls_pointer, npc;
48834         void __iomem *ls;
48835         long spu_ret;
48836 -       int ret;
48837 +       int ret, ret2;
48838  
48839         /* get syscall block from local store */
48840         npc = ctx->ops->npc_read(ctx) & ~3;
48841 @@ -269,9 +314,11 @@ static int spu_process_callback(struct s
48842                 if (spu_ret <= -ERESTARTSYS) {
48843                         ret = spu_handle_restartsys(ctx, &spu_ret, &npc);
48844                 }
48845 -               spu_acquire(ctx);
48846 +               ret2 = spu_acquire(ctx);
48847                 if (ret == -ERESTARTSYS)
48848                         return ret;
48849 +               if (ret2)
48850 +                       return -EINTR;
48851         }
48852  
48853         /* write result, jump over indirect pointer */
48854 @@ -281,18 +328,6 @@ static int spu_process_callback(struct s
48855         return ret;
48856  }
48857  
48858 -static inline int spu_process_events(struct spu_context *ctx)
48859 -{
48860 -       struct spu *spu = ctx->spu;
48861 -       int ret = 0;
48862 -
48863 -       if (spu->class_0_pending)
48864 -               ret = spu_irq_class_0_bottom(spu);
48865 -       if (!ret && signal_pending(current))
48866 -               ret = -ERESTARTSYS;
48867 -       return ret;
48868 -}
48869 -
48870  long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
48871  {
48872         int ret;
48873 @@ -302,29 +337,14 @@ long spufs_run_spu(struct spu_context *c
48874         if (mutex_lock_interruptible(&ctx->run_mutex))
48875                 return -ERESTARTSYS;
48876  
48877 -       ctx->ops->master_start(ctx);
48878 +       spu_enable_spu(ctx);
48879         ctx->event_return = 0;
48880  
48881 -       spu_acquire(ctx);
48882 -       if (ctx->state == SPU_STATE_SAVED) {
48883 -               __spu_update_sched_info(ctx);
48884 -               spu_set_timeslice(ctx);
48885 -
48886 -               ret = spu_activate(ctx, 0);
48887 -               if (ret) {
48888 -                       spu_release(ctx);
48889 -                       goto out;
48890 -               }
48891 -       } else {
48892 -               /*
48893 -                * We have to update the scheduling priority under active_mutex
48894 -                * to protect against find_victim().
48895 -                *
48896 -                * No need to update the timeslice ASAP, it will get updated
48897 -                * once the current one has expired.
48898 -                */
48899 -               spu_update_sched_info(ctx);
48900 -       }
48901 +       ret = spu_acquire(ctx);
48902 +       if (ret)
48903 +               goto out_unlock;
48904 +
48905 +       spu_update_sched_info(ctx);
48906  
48907         ret = spu_run_init(ctx, npc);
48908         if (ret) {
48909 @@ -358,14 +378,12 @@ long spufs_run_spu(struct spu_context *c
48910                 if (ret)
48911                         break;
48912  
48913 -               if (unlikely(ctx->state != SPU_STATE_RUNNABLE)) {
48914 -                       ret = spu_reacquire_runnable(ctx, npc, &status);
48915 -                       if (ret)
48916 -                               goto out2;
48917 -                       continue;
48918 -               }
48919 -               ret = spu_process_events(ctx);
48920 +               ret = spufs_handle_class0(ctx);
48921 +               if (ret)
48922 +                       break;
48923  
48924 +               if (signal_pending(current))
48925 +                       ret = -ERESTARTSYS;
48926         } while (!ret && !(status & (SPU_STATUS_STOPPED_BY_STOP |
48927                                       SPU_STATUS_STOPPED_BY_HALT |
48928                                        SPU_STATUS_SINGLE_STEP)));
48929 @@ -376,11 +394,10 @@ long spufs_run_spu(struct spu_context *c
48930                 ctx->stats.libassist++;
48931  
48932  
48933 -       ctx->ops->master_stop(ctx);
48934 +       spu_disable_spu(ctx);
48935         ret = spu_run_fini(ctx, npc, &status);
48936         spu_yield(ctx);
48937  
48938 -out2:
48939         if ((ret == 0) ||
48940             ((ret == -ERESTARTSYS) &&
48941              ((status & SPU_STATUS_STOPPED_BY_HALT) ||
48942 @@ -401,6 +418,7 @@ out2:
48943  
48944  out:
48945         *event = ctx->event_return;
48946 +out_unlock:
48947         mutex_unlock(&ctx->run_mutex);
48948         return ret;
48949  }
48950 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/sched.c
48951 ===================================================================
48952 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/sched.c
48953 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/sched.c
48954 @@ -58,6 +58,7 @@ static unsigned long spu_avenrun[3];
48955  static struct spu_prio_array *spu_prio;
48956  static struct task_struct *spusched_task;
48957  static struct timer_list spusched_timer;
48958 +static struct timer_list spuloadavg_timer;
48959  
48960  /*
48961   * Priority of a normal, non-rt, non-niced'd process (aka nice level 0).
48962 @@ -105,15 +106,21 @@ void spu_set_timeslice(struct spu_contex
48963  void __spu_update_sched_info(struct spu_context *ctx)
48964  {
48965         /*
48966 -        * 32-Bit assignment are atomic on powerpc, and we don't care about
48967 -        * memory ordering here because retriving the controlling thread is
48968 -        * per defintion racy.
48969 +        * assert that the context is not on the runqueue, so it is safe
48970 +        * to change its scheduling parameters.
48971 +        */
48972 +       BUG_ON(!list_empty(&ctx->rq));
48973 +
48974 +       /*
48975 +        * 32-Bit assignments are atomic on powerpc, and we don't care about
48976 +        * memory ordering here because retrieving the controlling thread is
48977 +        * per definition racy.
48978          */
48979         ctx->tid = current->pid;
48980  
48981         /*
48982          * We do our own priority calculations, so we normally want
48983 -        * ->static_prio to start with. Unfortunately thies field
48984 +        * ->static_prio to start with. Unfortunately this field
48985          * contains junk for threads with a realtime scheduling
48986          * policy so we have to look at ->prio in this case.
48987          */
48988 @@ -124,23 +131,32 @@ void __spu_update_sched_info(struct spu_
48989         ctx->policy = current->policy;
48990  
48991         /*
48992 -        * A lot of places that don't hold list_mutex poke into
48993 -        * cpus_allowed, including grab_runnable_context which
48994 -        * already holds the runq_lock.  So abuse runq_lock
48995 -        * to protect this field aswell.
48996 +        * TO DO: the context may be loaded, so we may need to activate
48997 +        * it again on a different node. But it shouldn't hurt anything
48998 +        * to update its parameters, because we know that the scheduler
48999 +        * is not actively looking at this field, since it is not on the
49000 +        * runqueue. The context will be rescheduled on the proper node
49001 +        * if it is timesliced or preempted.
49002          */
49003 -       spin_lock(&spu_prio->runq_lock);
49004         ctx->cpus_allowed = current->cpus_allowed;
49005 -       spin_unlock(&spu_prio->runq_lock);
49006  }
49007  
49008  void spu_update_sched_info(struct spu_context *ctx)
49009  {
49010 -       int node = ctx->spu->node;
49011 +       int node;
49012  
49013 -       mutex_lock(&cbe_spu_info[node].list_mutex);
49014 -       __spu_update_sched_info(ctx);
49015 -       mutex_unlock(&cbe_spu_info[node].list_mutex);
49016 +       if (ctx->state == SPU_STATE_RUNNABLE) {
49017 +               node = ctx->spu->node;
49018 +
49019 +               /*
49020 +                * Take list_mutex to sync with find_victim().
49021 +                */
49022 +               mutex_lock(&cbe_spu_info[node].list_mutex);
49023 +               __spu_update_sched_info(ctx);
49024 +               mutex_unlock(&cbe_spu_info[node].list_mutex);
49025 +       } else {
49026 +               __spu_update_sched_info(ctx);
49027 +       }
49028  }
49029  
49030  static int __node_allowed(struct spu_context *ctx, int node)
49031 @@ -174,7 +190,7 @@ void do_notify_spus_active(void)
49032          * Wake up the active spu_contexts.
49033          *
49034          * When the awakened processes see their "notify_active" flag is set,
49035 -        * they will call spu_switch_notify();
49036 +        * they will call spu_switch_notify().
49037          */
49038         for_each_online_node(node) {
49039                 struct spu *spu;
49040 @@ -221,7 +237,6 @@ static void spu_bind_context(struct spu 
49041         spu->wbox_callback = spufs_wbox_callback;
49042         spu->stop_callback = spufs_stop_callback;
49043         spu->mfc_callback = spufs_mfc_callback;
49044 -       spu->dma_callback = spufs_dma_callback;
49045         mb();
49046         spu_unmap_mappings(ctx);
49047         spu_restore(&ctx->csa, spu);
49048 @@ -409,7 +424,6 @@ static void spu_unbind_context(struct sp
49049         spu->wbox_callback = NULL;
49050         spu->stop_callback = NULL;
49051         spu->mfc_callback = NULL;
49052 -       spu->dma_callback = NULL;
49053         spu_associate_mm(spu, NULL);
49054         spu->pid = 0;
49055         spu->tgid = 0;
49056 @@ -454,6 +468,13 @@ static void __spu_add_to_rq(struct spu_c
49057         }
49058  }
49059  
49060 +static void spu_add_to_rq(struct spu_context *ctx)
49061 +{
49062 +       spin_lock(&spu_prio->runq_lock);
49063 +       __spu_add_to_rq(ctx);
49064 +       spin_unlock(&spu_prio->runq_lock);
49065 +}
49066 +
49067  static void __spu_del_from_rq(struct spu_context *ctx)
49068  {
49069         int prio = ctx->prio;
49070 @@ -468,10 +489,24 @@ static void __spu_del_from_rq(struct spu
49071         }
49072  }
49073  
49074 +void spu_del_from_rq(struct spu_context *ctx)
49075 +{
49076 +       spin_lock(&spu_prio->runq_lock);
49077 +       __spu_del_from_rq(ctx);
49078 +       spin_unlock(&spu_prio->runq_lock);
49079 +}
49080 +
49081  static void spu_prio_wait(struct spu_context *ctx)
49082  {
49083         DEFINE_WAIT(wait);
49084  
49085 +       /*
49086 +        * The caller must explicitly wait for a context to be loaded
49087 +        * if the nosched flag is set.  If NOSCHED is not set, the caller
49088 +        * queues the context and waits for an spu event or error.
49089 +        */
49090 +       BUG_ON(!(ctx->flags & SPU_CREATE_NOSCHED));
49091 +
49092         spin_lock(&spu_prio->runq_lock);
49093         prepare_to_wait_exclusive(&ctx->stop_wq, &wait, TASK_INTERRUPTIBLE);
49094         if (!signal_pending(current)) {
49095 @@ -555,7 +590,7 @@ static struct spu *find_victim(struct sp
49096         /*
49097          * Look for a possible preemption candidate on the local node first.
49098          * If there is no candidate look at the other nodes.  This isn't
49099 -        * exactly fair, but so far the whole spu schedule tries to keep
49100 +        * exactly fair, but so far the whole spu scheduler tries to keep
49101          * a strong node affinity.  We might want to fine-tune this in
49102          * the future.
49103          */
49104 @@ -571,6 +606,7 @@ static struct spu *find_victim(struct sp
49105                         struct spu_context *tmp = spu->ctx;
49106  
49107                         if (tmp && tmp->prio > ctx->prio &&
49108 +                           !(tmp->flags & SPU_CREATE_NOSCHED) &&
49109                             (!victim || tmp->prio > victim->prio))
49110                                 victim = spu->ctx;
49111                 }
49112 @@ -582,6 +618,10 @@ static struct spu *find_victim(struct sp
49113                          * higher priority contexts before lower priority
49114                          * ones, so this is safe until we introduce
49115                          * priority inheritance schemes.
49116 +                        *
49117 +                        * XXX if the highest priority context is locked,
49118 +                        * this can loop a long time.  Might be better to
49119 +                        * look at another context or give up after X retries.
49120                          */
49121                         if (!mutex_trylock(&victim->state_mutex)) {
49122                                 victim = NULL;
49123 @@ -589,10 +629,10 @@ static struct spu *find_victim(struct sp
49124                         }
49125  
49126                         spu = victim->spu;
49127 -                       if (!spu) {
49128 +                       if (!spu || victim->prio <= ctx->prio) {
49129                                 /*
49130                                  * This race can happen because we've dropped
49131 -                                * the active list mutex.  No a problem, just
49132 +                                * the active list mutex.  Not a problem, just
49133                                  * restart the search.
49134                                  */
49135                                 mutex_unlock(&victim->state_mutex);
49136 @@ -607,13 +647,10 @@ static struct spu *find_victim(struct sp
49137  
49138                         victim->stats.invol_ctx_switch++;
49139                         spu->stats.invol_ctx_switch++;
49140 +                       spu_add_to_rq(victim);
49141 +
49142                         mutex_unlock(&victim->state_mutex);
49143 -                       /*
49144 -                        * We need to break out of the wait loop in spu_run
49145 -                        * manually to ensure this context gets put on the
49146 -                        * runqueue again ASAP.
49147 -                        */
49148 -                       wake_up(&victim->stop_wq);
49149 +
49150                         return spu;
49151                 }
49152         }
49153 @@ -621,6 +658,50 @@ static struct spu *find_victim(struct sp
49154         return NULL;
49155  }
49156  
49157 +static void __spu_schedule(struct spu *spu, struct spu_context *ctx)
49158 +{
49159 +       int node = spu->node;
49160 +       int success = 0;
49161 +
49162 +       spu_set_timeslice(ctx);
49163 +
49164 +       mutex_lock(&cbe_spu_info[node].list_mutex);
49165 +       if (spu->ctx == NULL) {
49166 +               spu_bind_context(spu, ctx);
49167 +               cbe_spu_info[node].nr_active++;
49168 +               spu->alloc_state = SPU_USED;
49169 +               success = 1;
49170 +       }
49171 +       mutex_unlock(&cbe_spu_info[node].list_mutex);
49172 +
49173 +       if (success)
49174 +               wake_up_all(&ctx->run_wq);
49175 +       else
49176 +               spu_add_to_rq(ctx);
49177 +}
49178 +
49179 +static void spu_schedule(struct spu *spu, struct spu_context *ctx)
49180 +{
49181 +       /* not a candidate for interruptible because it's called either
49182 +          from the scheduler thread or from spu_deactivate */
49183 +       mutex_lock(&ctx->state_mutex);
49184 +       __spu_schedule(spu, ctx);
49185 +       spu_release(ctx);
49186 +}
49187 +
49188 +static void spu_unschedule(struct spu *spu, struct spu_context *ctx)
49189 +{
49190 +       int node = spu->node;
49191 +
49192 +       mutex_lock(&cbe_spu_info[node].list_mutex);
49193 +       cbe_spu_info[node].nr_active--;
49194 +       spu->alloc_state = SPU_FREE;
49195 +       spu_unbind_context(spu, ctx);
49196 +       ctx->stats.invol_ctx_switch++;
49197 +       spu->stats.invol_ctx_switch++;
49198 +       mutex_unlock(&cbe_spu_info[node].list_mutex);
49199 +}
49200 +
49201  /**
49202   * spu_activate - find a free spu for a context and execute it
49203   * @ctx:       spu context to schedule
49204 @@ -632,39 +713,47 @@ static struct spu *find_victim(struct sp
49205   */
49206  int spu_activate(struct spu_context *ctx, unsigned long flags)
49207  {
49208 -       do {
49209 -               struct spu *spu;
49210 +       struct spu *spu;
49211  
49212 -               /*
49213 -                * If there are multiple threads waiting for a single context
49214 -                * only one actually binds the context while the others will
49215 -                * only be able to acquire the state_mutex once the context
49216 -                * already is in runnable state.
49217 -                */
49218 -               if (ctx->spu)
49219 -                       return 0;
49220 +       /*
49221 +        * If there are multiple threads waiting for a single context
49222 +        * only one actually binds the context while the others will
49223 +        * only be able to acquire the state_mutex once the context
49224 +        * already is in runnable state.
49225 +        */
49226 +       if (ctx->spu)
49227 +               return 0;
49228  
49229 -               spu = spu_get_idle(ctx);
49230 -               /*
49231 -                * If this is a realtime thread we try to get it running by
49232 -                * preempting a lower priority thread.
49233 -                */
49234 -               if (!spu && rt_prio(ctx->prio))
49235 -                       spu = find_victim(ctx);
49236 -               if (spu) {
49237 -                       int node = spu->node;
49238 +spu_activate_top:
49239 +       if (signal_pending(current))
49240 +               return -ERESTARTSYS;
49241  
49242 -                       mutex_lock(&cbe_spu_info[node].list_mutex);
49243 -                       spu_bind_context(spu, ctx);
49244 -                       cbe_spu_info[node].nr_active++;
49245 -                       mutex_unlock(&cbe_spu_info[node].list_mutex);
49246 -                       return 0;
49247 -               }
49248 +       spu = spu_get_idle(ctx);
49249 +       /*
49250 +        * If this is a realtime thread we try to get it running by
49251 +        * preempting a lower priority thread.
49252 +        */
49253 +       if (!spu && rt_prio(ctx->prio))
49254 +               spu = find_victim(ctx);
49255 +       if (spu) {
49256 +               unsigned long runcntl;
49257  
49258 +               runcntl = ctx->ops->runcntl_read(ctx);
49259 +               __spu_schedule(spu, ctx);
49260 +               if (runcntl & SPU_RUNCNTL_RUNNABLE)
49261 +                       spuctx_switch_state(ctx, SPU_UTIL_USER);
49262 +
49263 +               return 0;
49264 +       }
49265 +
49266 +       if (ctx->flags & SPU_CREATE_NOSCHED) {
49267                 spu_prio_wait(ctx);
49268 -       } while (!signal_pending(current));
49269 +               goto spu_activate_top;
49270 +       }
49271 +
49272 +       spu_add_to_rq(ctx);
49273  
49274 -       return -ERESTARTSYS;
49275 +       return 0;
49276  }
49277  
49278  /**
49279 @@ -706,21 +795,19 @@ static int __spu_deactivate(struct spu_c
49280         if (spu) {
49281                 new = grab_runnable_context(max_prio, spu->node);
49282                 if (new || force) {
49283 -                       int node = spu->node;
49284 -
49285 -                       mutex_lock(&cbe_spu_info[node].list_mutex);
49286 -                       spu_unbind_context(spu, ctx);
49287 -                       spu->alloc_state = SPU_FREE;
49288 -                       cbe_spu_info[node].nr_active--;
49289 -                       mutex_unlock(&cbe_spu_info[node].list_mutex);
49290 -
49291 -                       ctx->stats.vol_ctx_switch++;
49292 -                       spu->stats.vol_ctx_switch++;
49293 -
49294 -                       if (new)
49295 -                               wake_up(&new->stop_wq);
49296 +                       spu_unschedule(spu, ctx);
49297 +                       if (new) {
49298 +                               if (new->flags & SPU_CREATE_NOSCHED)
49299 +                                       wake_up(&new->stop_wq);
49300 +                               else {
49301 +                                       spu_release(ctx);
49302 +                                       spu_schedule(spu, new);
49303 +                                       /* this one can't easily be made
49304 +                                          interruptible */
49305 +                                       mutex_lock(&ctx->state_mutex);
49306 +                               }
49307 +                       }
49308                 }
49309 -
49310         }
49311  
49312         return new != NULL;
49313 @@ -757,43 +844,38 @@ void spu_yield(struct spu_context *ctx)
49314  
49315  static noinline void spusched_tick(struct spu_context *ctx)
49316  {
49317 +       struct spu_context *new = NULL;
49318 +       struct spu *spu = NULL;
49319 +       u32 status;
49320 +
49321 +       if (spu_acquire(ctx))
49322 +               BUG();  /* a kernel thread never has signals pending */
49323 +
49324 +       if (ctx->state != SPU_STATE_RUNNABLE)
49325 +               goto out;
49326 +       if (spu_stopped(ctx, &status))
49327 +               goto out;
49328         if (ctx->flags & SPU_CREATE_NOSCHED)
49329 -               return;
49330 +               goto out;
49331         if (ctx->policy == SCHED_FIFO)
49332 -               return;
49333 +               goto out;
49334  
49335         if (--ctx->time_slice)
49336 -               return;
49337 -
49338 -       /*
49339 -        * Unfortunately list_mutex ranks outside of state_mutex, so
49340 -        * we have to trylock here.  If we fail give the context another
49341 -        * tick and try again.
49342 -        */
49343 -       if (mutex_trylock(&ctx->state_mutex)) {
49344 -               struct spu *spu = ctx->spu;
49345 -               struct spu_context *new;
49346 +               goto out;
49347  
49348 -               new = grab_runnable_context(ctx->prio + 1, spu->node);
49349 -               if (new) {
49350 -                       spu_unbind_context(spu, ctx);
49351 -                       ctx->stats.invol_ctx_switch++;
49352 -                       spu->stats.invol_ctx_switch++;
49353 -                       spu->alloc_state = SPU_FREE;
49354 -                       cbe_spu_info[spu->node].nr_active--;
49355 -                       wake_up(&new->stop_wq);
49356 -                       /*
49357 -                        * We need to break out of the wait loop in
49358 -                        * spu_run manually to ensure this context
49359 -                        * gets put on the runqueue again ASAP.
49360 -                        */
49361 -                       wake_up(&ctx->stop_wq);
49362 -               }
49363 -               spu_set_timeslice(ctx);
49364 -               mutex_unlock(&ctx->state_mutex);
49365 +       spu = ctx->spu;
49366 +       new = grab_runnable_context(ctx->prio + 1, spu->node);
49367 +       if (new) {
49368 +               spu_unschedule(spu, ctx);
49369 +               spu_add_to_rq(ctx);
49370         } else {
49371                 ctx->time_slice++;
49372         }
49373 +out:
49374 +       spu_release(ctx);
49375 +
49376 +       if (new)
49377 +               spu_schedule(spu, new);
49378  }
49379  
49380  /**
49381 @@ -817,35 +899,31 @@ static unsigned long count_active_contex
49382  }
49383  
49384  /**
49385 - * spu_calc_load - given tick count, update the avenrun load estimates.
49386 - * @tick:      tick count
49387 + * spu_calc_load - update the avenrun load estimates.
49388   *
49389   * No locking against reading these values from userspace, as for
49390   * the CPU loadavg code.
49391   */
49392 -static void spu_calc_load(unsigned long ticks)
49393 +static void spu_calc_load(void)
49394  {
49395         unsigned long active_tasks; /* fixed-point */
49396 -       static int count = LOAD_FREQ;
49397  
49398 -       count -= ticks;
49399 -
49400 -       if (unlikely(count < 0)) {
49401 -               active_tasks = count_active_contexts() * FIXED_1;
49402 -               do {
49403 -                       CALC_LOAD(spu_avenrun[0], EXP_1, active_tasks);
49404 -                       CALC_LOAD(spu_avenrun[1], EXP_5, active_tasks);
49405 -                       CALC_LOAD(spu_avenrun[2], EXP_15, active_tasks);
49406 -                       count += LOAD_FREQ;
49407 -               } while (count < 0);
49408 -       }
49409 +       active_tasks = count_active_contexts() * FIXED_1;
49410 +       CALC_LOAD(spu_avenrun[0], EXP_1, active_tasks);
49411 +       CALC_LOAD(spu_avenrun[1], EXP_5, active_tasks);
49412 +       CALC_LOAD(spu_avenrun[2], EXP_15, active_tasks);
49413  }
49414  
49415  static void spusched_wake(unsigned long data)
49416  {
49417         mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK);
49418         wake_up_process(spusched_task);
49419 -       spu_calc_load(SPUSCHED_TICK);
49420 +}
49421 +
49422 +static void spuloadavg_wake(unsigned long data)
49423 +{
49424 +       mod_timer(&spuloadavg_timer, jiffies + LOAD_FREQ);
49425 +       spu_calc_load();
49426  }
49427  
49428  static int spusched_thread(void *unused)
49429 @@ -857,17 +935,58 @@ static int spusched_thread(void *unused)
49430                 set_current_state(TASK_INTERRUPTIBLE);
49431                 schedule();
49432                 for (node = 0; node < MAX_NUMNODES; node++) {
49433 -                       mutex_lock(&cbe_spu_info[node].list_mutex);
49434 -                       list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list)
49435 -                               if (spu->ctx)
49436 -                                       spusched_tick(spu->ctx);
49437 -                       mutex_unlock(&cbe_spu_info[node].list_mutex);
49438 +                       struct mutex *mtx = &cbe_spu_info[node].list_mutex;
49439 +
49440 +                       mutex_lock(mtx);
49441 +                       list_for_each_entry(spu, &cbe_spu_info[node].spus,
49442 +                                       cbe_list) {
49443 +                               struct spu_context *ctx = spu->ctx;
49444 +
49445 +                               if (ctx) {
49446 +                                       mutex_unlock(mtx);
49447 +                                       spusched_tick(ctx);
49448 +                                       mutex_lock(mtx);
49449 +                               }
49450 +                       }
49451 +                       mutex_unlock(mtx);
49452                 }
49453         }
49454  
49455         return 0;
49456  }
49457  
49458 +void spuctx_switch_state(struct spu_context *ctx,
49459 +               enum spu_utilization_state new_state)
49460 +{
49461 +       unsigned long long curtime;
49462 +       signed long long delta;
49463 +       struct timespec ts;
49464 +       struct spu *spu;
49465 +       enum spu_utilization_state old_state;
49466 +
49467 +       ktime_get_ts(&ts);
49468 +       curtime = timespec_to_ns(&ts);
49469 +       delta = curtime - ctx->stats.tstamp;
49470 +
49471 +       WARN_ON(!mutex_is_locked(&ctx->state_mutex));
49472 +       WARN_ON(delta < 0);
49473 +
49474 +       spu = ctx->spu;
49475 +       old_state = ctx->stats.util_state;
49476 +       ctx->stats.util_state = new_state;
49477 +       ctx->stats.tstamp = curtime;
49478 +
49479 +       /*
49480 +        * Update the physical SPU utilization statistics.
49481 +        */
49482 +       if (spu) {
49483 +               ctx->stats.times[old_state] += delta;
49484 +               spu->stats.times[old_state] += delta;
49485 +               spu->stats.util_state = new_state;
49486 +               spu->stats.tstamp = curtime;
49487 +       }
49488 +}
49489 +
49490  #define LOAD_INT(x) ((x) >> FSHIFT)
49491  #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
49492  
49493 @@ -881,7 +1000,7 @@ static int show_spu_loadavg(struct seq_f
49494  
49495         /*
49496          * Note that last_pid doesn't really make much sense for the
49497 -        * SPU loadavg (it even seems very odd on the CPU side..),
49498 +        * SPU loadavg (it even seems very odd on the CPU side...),
49499          * but we include it here to have a 100% compatible interface.
49500          */
49501         seq_printf(s, "%d.%02d %d.%02d %d.%02d %ld/%d %d\n",
49502 @@ -922,6 +1041,7 @@ int __init spu_sched_init(void)
49503         spin_lock_init(&spu_prio->runq_lock);
49504  
49505         setup_timer(&spusched_timer, spusched_wake, 0);
49506 +       setup_timer(&spuloadavg_timer, spuloadavg_wake, 0);
49507  
49508         spusched_task = kthread_run(spusched_thread, NULL, "spusched");
49509         if (IS_ERR(spusched_task)) {
49510 @@ -929,6 +1049,8 @@ int __init spu_sched_init(void)
49511                 goto out_free_spu_prio;
49512         }
49513  
49514 +       mod_timer(&spuloadavg_timer, 0);
49515 +
49516         entry = create_proc_entry("spu_loadavg", 0, NULL);
49517         if (!entry)
49518                 goto out_stop_kthread;
49519 @@ -954,6 +1076,7 @@ void spu_sched_exit(void)
49520         remove_proc_entry("spu_loadavg", NULL);
49521  
49522         del_timer_sync(&spusched_timer);
49523 +       del_timer_sync(&spuloadavg_timer);
49524         kthread_stop(spusched_task);
49525  
49526         for (node = 0; node < MAX_NUMNODES; node++) {
49527 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/spufs.h
49528 ===================================================================
49529 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/spufs.h
49530 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/spufs.h
49531 @@ -71,6 +71,7 @@ struct spu_context {
49532         wait_queue_head_t wbox_wq;
49533         wait_queue_head_t stop_wq;
49534         wait_queue_head_t mfc_wq;
49535 +       wait_queue_head_t run_wq;
49536         struct fasync_struct *ibox_fasync;
49537         struct fasync_struct *wbox_fasync;
49538         struct fasync_struct *mfc_fasync;
49539 @@ -168,8 +169,10 @@ struct spu_context_ops {
49540         void (*npc_write) (struct spu_context * ctx, u32 data);
49541          u32(*status_read) (struct spu_context * ctx);
49542         char*(*get_ls) (struct spu_context * ctx);
49543 +       void (*privcntl_write) (struct spu_context *ctx, u64 data);
49544          u32 (*runcntl_read) (struct spu_context * ctx);
49545         void (*runcntl_write) (struct spu_context * ctx, u32 data);
49546 +       void (*runcntl_stop) (struct spu_context * ctx);
49547         void (*master_start) (struct spu_context * ctx);
49548         void (*master_stop) (struct spu_context * ctx);
49549         int (*set_mfc_query)(struct spu_context * ctx, u32 mask, u32 mode);
49550 @@ -219,15 +222,16 @@ void spu_gang_add_ctx(struct spu_gang *g
49551  
49552  /* fault handling */
49553  int spufs_handle_class1(struct spu_context *ctx);
49554 +int spufs_handle_class0(struct spu_context *ctx);
49555  
49556  /* affinity */
49557  struct spu *affinity_check(struct spu_context *ctx);
49558  
49559  /* context management */
49560  extern atomic_t nr_spu_contexts;
49561 -static inline void spu_acquire(struct spu_context *ctx)
49562 +static inline int __must_check spu_acquire(struct spu_context *ctx)
49563  {
49564 -       mutex_lock(&ctx->state_mutex);
49565 +       return mutex_lock_interruptible(&ctx->state_mutex);
49566  }
49567  
49568  static inline void spu_release(struct spu_context *ctx)
49569 @@ -242,10 +246,11 @@ int put_spu_context(struct spu_context *
49570  void spu_unmap_mappings(struct spu_context *ctx);
49571  
49572  void spu_forget(struct spu_context *ctx);
49573 -int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags);
49574 -void spu_acquire_saved(struct spu_context *ctx);
49575 +int __must_check spu_acquire_saved(struct spu_context *ctx);
49576  void spu_release_saved(struct spu_context *ctx);
49577  
49578 +int spu_stopped(struct spu_context *ctx, u32 * stat);
49579 +void spu_del_from_rq(struct spu_context *ctx);
49580  int spu_activate(struct spu_context *ctx, unsigned long flags);
49581  void spu_deactivate(struct spu_context *ctx);
49582  void spu_yield(struct spu_context *ctx);
49583 @@ -279,7 +284,9 @@ extern char *isolated_loader;
49584                 }                                                       \
49585                 spu_release(ctx);                                       \
49586                 schedule();                                             \
49587 -               spu_acquire(ctx);                                       \
49588 +               __ret = spu_acquire(ctx);                               \
49589 +               if (__ret)                                              \
49590 +                       break;                                          \
49591         }                                                               \
49592         finish_wait(&(wq), &__wait);                                    \
49593         __ret;                                                          \
49594 @@ -306,41 +313,16 @@ struct spufs_coredump_reader {
49595  extern struct spufs_coredump_reader spufs_coredump_read[];
49596  extern int spufs_coredump_num_notes;
49597  
49598 -/*
49599 - * This function is a little bit too large for an inline, but
49600 - * as fault.c is built into the kernel we can't move it out of
49601 - * line.
49602 - */
49603 -static inline void spuctx_switch_state(struct spu_context *ctx,
49604 -               enum spu_utilization_state new_state)
49605 -{
49606 -       unsigned long long curtime;
49607 -       signed long long delta;
49608 -       struct timespec ts;
49609 -       struct spu *spu;
49610 -       enum spu_utilization_state old_state;
49611 -
49612 -       ktime_get_ts(&ts);
49613 -       curtime = timespec_to_ns(&ts);
49614 -       delta = curtime - ctx->stats.tstamp;
49615 -
49616 -       WARN_ON(!mutex_is_locked(&ctx->state_mutex));
49617 -       WARN_ON(delta < 0);
49618 -
49619 -       spu = ctx->spu;
49620 -       old_state = ctx->stats.util_state;
49621 -       ctx->stats.util_state = new_state;
49622 -       ctx->stats.tstamp = curtime;
49623 -
49624 -       /*
49625 -        * Update the physical SPU utilization statistics.
49626 -        */
49627 -       if (spu) {
49628 -               ctx->stats.times[old_state] += delta;
49629 -               spu->stats.times[old_state] += delta;
49630 -               spu->stats.util_state = new_state;
49631 -               spu->stats.tstamp = curtime;
49632 -       }
49633 -}
49634 +extern int spu_init_csa(struct spu_state *csa);
49635 +extern void spu_fini_csa(struct spu_state *csa);
49636 +extern int spu_save(struct spu_state *prev, struct spu *spu);
49637 +extern int spu_restore(struct spu_state *new, struct spu *spu);
49638 +extern int spu_switch(struct spu_state *prev, struct spu_state *new,
49639 +                     struct spu *spu);
49640 +extern int spu_alloc_lscsa(struct spu_state *csa);
49641 +extern void spu_free_lscsa(struct spu_state *csa);
49642 +
49643 +extern void spuctx_switch_state(struct spu_context *ctx,
49644 +               enum spu_utilization_state new_state);
49645  
49646  #endif
49647 Index: linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/switch.c
49648 ===================================================================
49649 --- linux-2.6.24.7.orig/arch/powerpc/platforms/cell/spufs/switch.c
49650 +++ linux-2.6.24.7/arch/powerpc/platforms/cell/spufs/switch.c
49651 @@ -48,6 +48,8 @@
49652  #include <asm/spu_csa.h>
49653  #include <asm/mmu_context.h>
49654  
49655 +#include "spufs.h"
49656 +
49657  #include "spu_save_dump.h"
49658  #include "spu_restore_dump.h"
49659  
49660 @@ -691,35 +693,9 @@ static inline void resume_mfc_queue(stru
49661         out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESUME_DMA_QUEUE);
49662  }
49663  
49664 -static inline void get_kernel_slb(u64 ea, u64 slb[2])
49665 +static inline void setup_mfc_slbs(struct spu_state *csa, struct spu *spu,
49666 +               unsigned int *code, int code_size)
49667  {
49668 -       u64 llp;
49669 -
49670 -       if (REGION_ID(ea) == KERNEL_REGION_ID)
49671 -               llp = mmu_psize_defs[mmu_linear_psize].sllp;
49672 -       else
49673 -               llp = mmu_psize_defs[mmu_virtual_psize].sllp;
49674 -       slb[0] = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
49675 -               SLB_VSID_KERNEL | llp;
49676 -       slb[1] = (ea & ESID_MASK) | SLB_ESID_V;
49677 -}
49678 -
49679 -static inline void load_mfc_slb(struct spu *spu, u64 slb[2], int slbe)
49680 -{
49681 -       struct spu_priv2 __iomem *priv2 = spu->priv2;
49682 -
49683 -       out_be64(&priv2->slb_index_W, slbe);
49684 -       eieio();
49685 -       out_be64(&priv2->slb_vsid_RW, slb[0]);
49686 -       out_be64(&priv2->slb_esid_RW, slb[1]);
49687 -       eieio();
49688 -}
49689 -
49690 -static inline void setup_mfc_slbs(struct spu_state *csa, struct spu *spu)
49691 -{
49692 -       u64 code_slb[2];
49693 -       u64 lscsa_slb[2];
49694 -
49695         /* Save, Step 47:
49696          * Restore, Step 30.
49697          *     If MFC_SR1[R]=1, write 0 to SLB_Invalidate_All
49698 @@ -735,11 +711,7 @@ static inline void setup_mfc_slbs(struct
49699          *     translation is desired by OS environment).
49700          */
49701         spu_invalidate_slbs(spu);
49702 -       get_kernel_slb((unsigned long)&spu_save_code[0], code_slb);
49703 -       get_kernel_slb((unsigned long)csa->lscsa, lscsa_slb);
49704 -       load_mfc_slb(spu, code_slb, 0);
49705 -       if ((lscsa_slb[0] != code_slb[0]) || (lscsa_slb[1] != code_slb[1]))
49706 -               load_mfc_slb(spu, lscsa_slb, 1);
49707 +       spu_setup_kernel_slbs(spu, csa->lscsa, code, code_size);
49708  }
49709  
49710  static inline void set_switch_active(struct spu_state *csa, struct spu *spu)
49711 @@ -768,9 +740,9 @@ static inline void enable_interrupts(str
49712          *     (translation) interrupts.
49713          */
49714         spin_lock_irq(&spu->register_lock);
49715 -       spu_int_stat_clear(spu, 0, ~0ul);
49716 -       spu_int_stat_clear(spu, 1, ~0ul);
49717 -       spu_int_stat_clear(spu, 2, ~0ul);
49718 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49719 +       spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK);
49720 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49721         spu_int_mask_set(spu, 0, 0ul);
49722         spu_int_mask_set(spu, 1, class1_mask);
49723         spu_int_mask_set(spu, 2, 0ul);
49724 @@ -927,8 +899,8 @@ static inline void wait_tag_complete(str
49725         POLL_WHILE_FALSE(in_be32(&prob->dma_tagstatus_R) & mask);
49726  
49727         local_irq_save(flags);
49728 -       spu_int_stat_clear(spu, 0, ~(0ul));
49729 -       spu_int_stat_clear(spu, 2, ~(0ul));
49730 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49731 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49732         local_irq_restore(flags);
49733  }
49734  
49735 @@ -946,8 +918,8 @@ static inline void wait_spu_stopped(stru
49736         POLL_WHILE_TRUE(in_be32(&prob->spu_status_R) & SPU_STATUS_RUNNING);
49737  
49738         local_irq_save(flags);
49739 -       spu_int_stat_clear(spu, 0, ~(0ul));
49740 -       spu_int_stat_clear(spu, 2, ~(0ul));
49741 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49742 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49743         local_irq_restore(flags);
49744  }
49745  
49746 @@ -1423,9 +1395,9 @@ static inline void clear_interrupts(stru
49747         spu_int_mask_set(spu, 0, 0ul);
49748         spu_int_mask_set(spu, 1, 0ul);
49749         spu_int_mask_set(spu, 2, 0ul);
49750 -       spu_int_stat_clear(spu, 0, ~0ul);
49751 -       spu_int_stat_clear(spu, 1, ~0ul);
49752 -       spu_int_stat_clear(spu, 2, ~0ul);
49753 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49754 +       spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK);
49755 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49756         spin_unlock_irq(&spu->register_lock);
49757  }
49758  
49759 @@ -1866,7 +1838,8 @@ static void save_lscsa(struct spu_state 
49760          */
49761  
49762         resume_mfc_queue(prev, spu);    /* Step 46. */
49763 -       setup_mfc_slbs(prev, spu);      /* Step 47. */
49764 +       /* Step 47. */
49765 +       setup_mfc_slbs(prev, spu, spu_save_code, sizeof(spu_save_code));
49766         set_switch_active(prev, spu);   /* Step 48. */
49767         enable_interrupts(prev, spu);   /* Step 49. */
49768         save_ls_16kb(prev, spu);        /* Step 50. */
49769 @@ -1971,7 +1944,8 @@ static void restore_lscsa(struct spu_sta
49770         setup_spu_status_part1(next, spu);      /* Step 27. */
49771         setup_spu_status_part2(next, spu);      /* Step 28. */
49772         restore_mfc_rag(next, spu);             /* Step 29. */
49773 -       setup_mfc_slbs(next, spu);              /* Step 30. */
49774 +       /* Step 30. */
49775 +       setup_mfc_slbs(next, spu, spu_restore_code, sizeof(spu_restore_code));
49776         set_spu_npc(next, spu);                 /* Step 31. */
49777         set_signot1(next, spu);                 /* Step 32. */
49778         set_signot2(next, spu);                 /* Step 33. */
49779 @@ -2103,10 +2077,6 @@ int spu_save(struct spu_state *prev, str
49780         int rc;
49781  
49782         acquire_spu_lock(spu);          /* Step 1.     */
49783 -       prev->dar = spu->dar;
49784 -       prev->dsisr = spu->dsisr;
49785 -       spu->dar = 0;
49786 -       spu->dsisr = 0;
49787         rc = __do_spu_save(prev, spu);  /* Steps 2-53. */
49788         release_spu_lock(spu);
49789         if (rc != 0 && rc != 2 && rc != 6) {
49790 @@ -2133,9 +2103,6 @@ int spu_restore(struct spu_state *new, s
49791         acquire_spu_lock(spu);
49792         harvest(NULL, spu);
49793         spu->slb_replace = 0;
49794 -       new->dar = 0;
49795 -       new->dsisr = 0;
49796 -       spu->class_0_pending = 0;
49797         rc = __do_spu_restore(new, spu);
49798         release_spu_lock(spu);
49799         if (rc) {
49800 @@ -2215,10 +2182,8 @@ int spu_init_csa(struct spu_state *csa)
49801  
49802         return 0;
49803  }
49804 -EXPORT_SYMBOL_GPL(spu_init_csa);
49805  
49806  void spu_fini_csa(struct spu_state *csa)
49807  {
49808         spu_free_lscsa(csa);
49809  }
49810 -EXPORT_SYMBOL_GPL(spu_fini_csa);
49811 Index: linux-2.6.24.7/arch/powerpc/platforms/celleb/Kconfig
49812 ===================================================================
49813 --- linux-2.6.24.7.orig/arch/powerpc/platforms/celleb/Kconfig
49814 +++ linux-2.6.24.7/arch/powerpc/platforms/celleb/Kconfig
49815 @@ -2,6 +2,8 @@ config PPC_CELLEB
49816         bool "Toshiba's Cell Reference Set 'Celleb' Architecture"
49817         depends on PPC_MULTIPLATFORM && PPC64
49818         select PPC_CELL
49819 +       select PPC_CELL_NATIVE
49820 +       select PPC_RTAS
49821         select PPC_INDIRECT_IO
49822         select PPC_OF_PLATFORM_PCI
49823         select HAS_TXX9_SERIAL
49824 Index: linux-2.6.24.7/arch/powerpc/platforms/celleb/io-workarounds.c
49825 ===================================================================
49826 --- linux-2.6.24.7.orig/arch/powerpc/platforms/celleb/io-workarounds.c
49827 +++ linux-2.6.24.7/arch/powerpc/platforms/celleb/io-workarounds.c
49828 @@ -22,6 +22,7 @@
49829  
49830  #undef DEBUG
49831  
49832 +#include <linux/of.h>
49833  #include <linux/of_device.h>
49834  #include <linux/irq.h>
49835  
49836 @@ -222,7 +223,7 @@ void __init celleb_pci_add_one(struct pc
49837                                void (*dummy_read)(struct pci_controller *))
49838  {
49839         struct celleb_pci_bus *bus = &celleb_pci_busses[celleb_pci_count];
49840 -       struct device_node *np = phb->arch_data;
49841 +       struct device_node *np = phb->dn;
49842  
49843         if (celleb_pci_count >= MAX_CELLEB_PCI_BUS) {
49844                 printk(KERN_ERR "Too many pci bridges, workarounds"
49845 @@ -256,13 +257,13 @@ int __init celleb_pci_workaround_init(vo
49846  
49847         celleb_dummy_page_va = kmalloc(PAGE_SIZE, GFP_KERNEL);
49848         if (!celleb_dummy_page_va) {
49849 -               printk(KERN_ERR "Celleb: dummy read disabled."
49850 +               printk(KERN_ERR "Celleb: dummy read disabled. "
49851                         "Alloc celleb_dummy_page_va failed\n");
49852                 return 1;
49853         }
49854  
49855         list_for_each_entry(phb, &hose_list, list_node) {
49856 -               node = phb->arch_data;
49857 +               node = phb->dn;
49858                 match = of_match_node(celleb_pci_workaround_match, node);
49859  
49860                 if (match) {
49861 Index: linux-2.6.24.7/arch/powerpc/platforms/celleb/iommu.c
49862 ===================================================================
49863 --- linux-2.6.24.7.orig/arch/powerpc/platforms/celleb/iommu.c
49864 +++ linux-2.6.24.7/arch/powerpc/platforms/celleb/iommu.c
49865 @@ -22,8 +22,9 @@
49866  #include <linux/init.h>
49867  #include <linux/dma-mapping.h>
49868  #include <linux/pci.h>
49869 +#include <linux/of_platform.h>
49870  
49871 -#include <asm/of_platform.h>
49872 +#include <asm/machdep.h>
49873  
49874  #include "beat_wrapper.h"
49875  
49876 @@ -51,6 +52,8 @@ static int __init find_dma_window(u64 *i
49877         return 0;
49878  }
49879  
49880 +static unsigned long celleb_dma_direct_offset;
49881 +
49882  static void __init celleb_init_direct_mapping(void)
49883  {
49884         u64 lpar_addr, io_addr;
49885 @@ -68,7 +71,18 @@ static void __init celleb_init_direct_ma
49886                                      ioid, DMA_FLAGS);
49887         }
49888  
49889 -       dma_direct_offset = dma_base;
49890 +       celleb_dma_direct_offset = dma_base;
49891 +}
49892 +
49893 +static void celleb_dma_dev_setup(struct device *dev)
49894 +{
49895 +       dev->archdata.dma_ops = get_pci_dma_ops();
49896 +       dev->archdata.dma_data = (void *)celleb_dma_direct_offset;
49897 +}
49898 +
49899 +static void celleb_pci_dma_dev_setup(struct pci_dev *pdev)
49900 +{
49901 +       celleb_dma_dev_setup(&pdev->dev);
49902  }
49903  
49904  static int celleb_of_bus_notify(struct notifier_block *nb,
49905 @@ -80,7 +94,7 @@ static int celleb_of_bus_notify(struct n
49906         if (action != BUS_NOTIFY_ADD_DEVICE)
49907                 return 0;
49908  
49909 -       dev->archdata.dma_ops = get_pci_dma_ops();
49910 +       celleb_dma_dev_setup(dev);
49911  
49912         return 0;
49913  }
49914 @@ -91,14 +105,12 @@ static struct notifier_block celleb_of_b
49915  
49916  static int __init celleb_init_iommu(void)
49917  {
49918 -       if (!machine_is(celleb))
49919 -               return -ENODEV;
49920 -
49921         celleb_init_direct_mapping();
49922         set_pci_dma_ops(&dma_direct_ops);
49923 +       ppc_md.pci_dma_dev_setup = celleb_pci_dma_dev_setup;
49924         bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
49925  
49926         return 0;
49927  }
49928  
49929 -arch_initcall(celleb_init_iommu);
49930 +machine_arch_initcall(celleb_beat, celleb_init_iommu);
49931 Index: linux-2.6.24.7/arch/powerpc/platforms/celleb/pci.c
49932 ===================================================================
49933 --- linux-2.6.24.7.orig/arch/powerpc/platforms/celleb/pci.c
49934 +++ linux-2.6.24.7/arch/powerpc/platforms/celleb/pci.c
49935 @@ -31,6 +31,7 @@
49936  #include <linux/init.h>
49937  #include <linux/bootmem.h>
49938  #include <linux/pci_regs.h>
49939 +#include <linux/of.h>
49940  #include <linux/of_device.h>
49941  
49942  #include <asm/io.h>
49943 @@ -138,8 +139,6 @@ static void celleb_config_read_fake(unsi
49944                 *val = celleb_fake_config_readl(p);
49945                 break;
49946         }
49947 -
49948 -       return;
49949  }
49950  
49951  static void celleb_config_write_fake(unsigned char *config, int where,
49952 @@ -158,7 +157,6 @@ static void celleb_config_write_fake(uns
49953                 celleb_fake_config_writel(val, p);
49954                 break;
49955         }
49956 -       return;
49957  }
49958  
49959  static int celleb_fake_pci_read_config(struct pci_bus *bus,
49960 @@ -351,6 +349,10 @@ static int __init celleb_setup_fake_pci_
49961         wi1 = of_get_property(node, "vendor-id", NULL);
49962         wi2 = of_get_property(node, "class-code", NULL);
49963         wi3 = of_get_property(node, "revision-id", NULL);
49964 +       if (!wi0 || !wi1 || !wi2 || !wi3) {
49965 +               printk(KERN_ERR "PCI: Missing device tree properties.\n");
49966 +               goto error;
49967 +       }
49968  
49969         celleb_config_write_fake(*config, PCI_DEVICE_ID, 2, wi0[0] & 0xffff);
49970         celleb_config_write_fake(*config, PCI_VENDOR_ID, 2, wi1[0] & 0xffff);
49971 @@ -372,6 +374,10 @@ static int __init celleb_setup_fake_pci_
49972         celleb_setup_pci_base_addrs(hose, devno, fn, num_base_addr);
49973  
49974         li = of_get_property(node, "interrupts", &rlen);
49975 +       if (!li) {
49976 +               printk(KERN_ERR "PCI: interrupts not found.\n");
49977 +               goto error;
49978 +       }
49979         val = li[0];
49980         celleb_config_write_fake(*config, PCI_INTERRUPT_PIN, 1, 1);
49981         celleb_config_write_fake(*config, PCI_INTERRUPT_LINE, 1, val);
49982 @@ -475,7 +481,7 @@ static struct of_device_id celleb_phb_ma
49983  
49984  int __init celleb_setup_phb(struct pci_controller *phb)
49985  {
49986 -       struct device_node *dev = phb->arch_data;
49987 +       struct device_node *dev = phb->dn;
49988         const struct of_device_id *match;
49989         int (*setup_func)(struct device_node *, struct pci_controller *);
49990  
49991 Index: linux-2.6.24.7/arch/powerpc/platforms/celleb/scc_epci.c
49992 ===================================================================
49993 --- linux-2.6.24.7.orig/arch/powerpc/platforms/celleb/scc_epci.c
49994 +++ linux-2.6.24.7/arch/powerpc/platforms/celleb/scc_epci.c
49995 @@ -95,7 +95,7 @@ void __init epci_workaround_init(struct 
49996         private->dummy_page_da = dma_map_single(hose->parent,
49997                 celleb_dummy_page_va, PAGE_SIZE, DMA_FROM_DEVICE);
49998         if (private->dummy_page_da == DMA_ERROR_CODE) {
49999 -               printk(KERN_ERR "EPCI: dummy read disabled."
50000 +               printk(KERN_ERR "EPCI: dummy read disabled. "
50001                        "Map dummy page failed.\n");
50002                 return;
50003         }
50004 Index: linux-2.6.24.7/arch/powerpc/platforms/celleb/scc_uhc.c
50005 ===================================================================
50006 --- linux-2.6.24.7.orig/arch/powerpc/platforms/celleb/scc_uhc.c
50007 +++ linux-2.6.24.7/arch/powerpc/platforms/celleb/scc_uhc.c
50008 @@ -47,7 +47,8 @@ static void enable_scc_uhc(struct pci_de
50009         u32 val = 0;
50010         int i;
50011  
50012 -       if (!machine_is(celleb))
50013 +       if (!machine_is(celleb_beat) &&
50014 +           !machine_is(celleb_native))
50015                 return;
50016  
50017         uhc_base = ioremap(pci_resource_start(dev, 0),
50018 Index: linux-2.6.24.7/arch/powerpc/platforms/celleb/setup.c
50019 ===================================================================
50020 --- linux-2.6.24.7.orig/arch/powerpc/platforms/celleb/setup.c
50021 +++ linux-2.6.24.7/arch/powerpc/platforms/celleb/setup.c
50022 @@ -40,6 +40,7 @@
50023  #include <linux/seq_file.h>
50024  #include <linux/root_dev.h>
50025  #include <linux/console.h>
50026 +#include <linux/of_platform.h>
50027  
50028  #include <asm/mmu.h>
50029  #include <asm/processor.h>
50030 @@ -52,12 +53,16 @@
50031  #include <asm/time.h>
50032  #include <asm/spu_priv1.h>
50033  #include <asm/firmware.h>
50034 -#include <asm/of_platform.h>
50035 +#include <asm/rtas.h>
50036 +#include <asm/cell-regs.h>
50037  
50038  #include "interrupt.h"
50039  #include "beat_wrapper.h"
50040  #include "beat.h"
50041  #include "pci.h"
50042 +#include "../cell/interrupt.h"
50043 +#include "../cell/pervasive.h"
50044 +#include "../cell/ras.h"
50045  
50046  static char celleb_machine_type[128] = "Celleb";
50047  
50048 @@ -88,61 +93,122 @@ static void celleb_progress(char *s, uns
50049         printk("*** %04x : %s\n", hex, s ? s : "");
50050  }
50051  
50052 -static void __init celleb_setup_arch(void)
50053 +static void __init celleb_setup_arch_common(void)
50054 +{
50055 +       /* init to some ~sane value until calibrate_delay() runs */
50056 +       loops_per_jiffy = 50000000;
50057 +
50058 +#ifdef CONFIG_DUMMY_CONSOLE
50059 +       conswitchp = &dummy_con;
50060 +#endif
50061 +}
50062 +
50063 +static struct of_device_id celleb_bus_ids[] __initdata = {
50064 +       { .type = "scc", },
50065 +       { .type = "ioif", },    /* old style */
50066 +       {},
50067 +};
50068 +
50069 +static int __init celleb_publish_devices(void)
50070 +{
50071 +       /* Publish OF platform devices for southbridge IOs */
50072 +       of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
50073 +
50074 +       celleb_pci_workaround_init();
50075 +
50076 +       return 0;
50077 +}
50078 +machine_device_initcall(celleb_beat, celleb_publish_devices);
50079 +machine_device_initcall(celleb_native, celleb_publish_devices);
50080 +
50081 +
50082 +/*
50083 + * functions for Celleb-Beat
50084 + */
50085 +static void __init celleb_setup_arch_beat(void)
50086  {
50087  #ifdef CONFIG_SPU_BASE
50088 -       spu_priv1_ops = &spu_priv1_beat_ops;
50089 -       spu_management_ops = &spu_management_of_ops;
50090 +       spu_priv1_ops           = &spu_priv1_beat_ops;
50091 +       spu_management_ops      = &spu_management_of_ops;
50092  #endif
50093  
50094  #ifdef CONFIG_SMP
50095         smp_init_celleb();
50096  #endif
50097  
50098 -       /* init to some ~sane value until calibrate_delay() runs */
50099 -       loops_per_jiffy = 50000000;
50100 -
50101 -#ifdef CONFIG_DUMMY_CONSOLE
50102 -       conswitchp = &dummy_con;
50103 -#endif
50104 +       celleb_setup_arch_common();
50105  }
50106  
50107 -static int __init celleb_probe(void)
50108 +static int __init celleb_probe_beat(void)
50109  {
50110         unsigned long root = of_get_flat_dt_root();
50111  
50112         if (!of_flat_dt_is_compatible(root, "Beat"))
50113                 return 0;
50114  
50115 -       powerpc_firmware_features |= FW_FEATURE_CELLEB_POSSIBLE;
50116 +       powerpc_firmware_features |= FW_FEATURE_CELLEB_ALWAYS
50117 +               | FW_FEATURE_BEAT | FW_FEATURE_LPAR;
50118         hpte_init_beat_v3();
50119 +
50120         return 1;
50121  }
50122  
50123 -static struct of_device_id celleb_bus_ids[] __initdata = {
50124 -       { .type = "scc", },
50125 -       { .type = "ioif", },    /* old style */
50126 -       {},
50127 -};
50128  
50129 -static int __init celleb_publish_devices(void)
50130 +/*
50131 + * functions for Celleb-native
50132 + */
50133 +static void __init celleb_init_IRQ_native(void)
50134  {
50135 -       if (!machine_is(celleb))
50136 -               return 0;
50137 +       iic_init_IRQ();
50138 +       spider_init_IRQ();
50139 +}
50140  
50141 -       /* Publish OF platform devices for southbridge IOs */
50142 -       of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
50143 +static void __init celleb_setup_arch_native(void)
50144 +{
50145 +#ifdef CONFIG_SPU_BASE
50146 +       spu_priv1_ops           = &spu_priv1_mmio_ops;
50147 +       spu_management_ops      = &spu_management_of_ops;
50148 +#endif
50149  
50150 -       celleb_pci_workaround_init();
50151 +       cbe_regs_init();
50152  
50153 -       return 0;
50154 +#ifdef CONFIG_CBE_RAS
50155 +       cbe_ras_init();
50156 +#endif
50157 +
50158 +#ifdef CONFIG_SMP
50159 +       smp_init_cell();
50160 +#endif
50161 +
50162 +       cbe_pervasive_init();
50163 +
50164 +       /* XXX: nvram initialization should be added */
50165 +
50166 +       celleb_setup_arch_common();
50167 +}
50168 +
50169 +static int __init celleb_probe_native(void)
50170 +{
50171 +       unsigned long root = of_get_flat_dt_root();
50172 +
50173 +       if (of_flat_dt_is_compatible(root, "Beat") ||
50174 +           !of_flat_dt_is_compatible(root, "TOSHIBA,Celleb"))
50175 +               return 0;
50176 +
50177 +       powerpc_firmware_features |= FW_FEATURE_CELLEB_ALWAYS;
50178 +       hpte_init_native();
50179 +
50180 +       return 1;
50181  }
50182 -device_initcall(celleb_publish_devices);
50183  
50184 -define_machine(celleb) {
50185 -       .name                   = "Cell Reference Set",
50186 -       .probe                  = celleb_probe,
50187 -       .setup_arch             = celleb_setup_arch,
50188 +
50189 +/*
50190 + * machine definitions
50191 + */
50192 +define_machine(celleb_beat) {
50193 +       .name                   = "Cell Reference Set (Beat)",
50194 +       .probe                  = celleb_probe_beat,
50195 +       .setup_arch             = celleb_setup_arch_beat,
50196         .show_cpuinfo           = celleb_show_cpuinfo,
50197         .restart                = beat_restart,
50198         .power_off              = beat_power_off,
50199 @@ -167,3 +233,26 @@ define_machine(celleb) {
50200         .machine_crash_shutdown = default_machine_crash_shutdown,
50201  #endif
50202  };
50203 +
50204 +define_machine(celleb_native) {
50205 +       .name                   = "Cell Reference Set (native)",
50206 +       .probe                  = celleb_probe_native,
50207 +       .setup_arch             = celleb_setup_arch_native,
50208 +       .show_cpuinfo           = celleb_show_cpuinfo,
50209 +       .restart                = rtas_restart,
50210 +       .power_off              = rtas_power_off,
50211 +       .halt                   = rtas_halt,
50212 +       .get_boot_time          = rtas_get_boot_time,
50213 +       .get_rtc_time           = rtas_get_rtc_time,
50214 +       .set_rtc_time           = rtas_set_rtc_time,
50215 +       .calibrate_decr         = generic_calibrate_decr,
50216 +       .progress               = celleb_progress,
50217 +       .pci_probe_mode         = celleb_pci_probe_mode,
50218 +       .pci_setup_phb          = celleb_setup_phb,
50219 +       .init_IRQ               = celleb_init_IRQ_native,
50220 +#ifdef CONFIG_KEXEC
50221 +       .machine_kexec          = default_machine_kexec,
50222 +       .machine_kexec_prepare  = default_machine_kexec_prepare,
50223 +       .machine_crash_shutdown = default_machine_crash_shutdown,
50224 +#endif
50225 +};
50226 Index: linux-2.6.24.7/arch/powerpc/platforms/chrp/pci.c
50227 ===================================================================
50228 --- linux-2.6.24.7.orig/arch/powerpc/platforms/chrp/pci.c
50229 +++ linux-2.6.24.7/arch/powerpc/platforms/chrp/pci.c
50230 @@ -198,7 +198,7 @@ static void __init setup_peg2(struct pci
50231                 printk ("RTAS supporting Pegasos OF not found, please upgrade"
50232                         " your firmware\n");
50233         }
50234 -       pci_assign_all_buses = 1;
50235 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
50236         /* keep the reference to the root node */
50237  }
50238  
50239 Index: linux-2.6.24.7/arch/powerpc/platforms/chrp/setup.c
50240 ===================================================================
50241 --- linux-2.6.24.7.orig/arch/powerpc/platforms/chrp/setup.c
50242 +++ linux-2.6.24.7/arch/powerpc/platforms/chrp/setup.c
50243 @@ -115,7 +115,7 @@ void chrp_show_cpuinfo(struct seq_file *
50244         seq_printf(m, "machine\t\t: CHRP %s\n", model);
50245  
50246         /* longtrail (goldengate) stuff */
50247 -       if (!strncmp(model, "IBM,LongTrail", 13)) {
50248 +       if (model && !strncmp(model, "IBM,LongTrail", 13)) {
50249                 /* VLSI VAS96011/12 `Golden Gate 2' */
50250                 /* Memory banks */
50251                 sdramen = (in_le32(gg2_pci_config_base + GG2_PCI_DRAM_CTRL)
50252 @@ -203,15 +203,20 @@ static void __init sio_fixup_irq(const c
50253  static void __init sio_init(void)
50254  {
50255         struct device_node *root;
50256 +       const char *model;
50257  
50258 -       if ((root = of_find_node_by_path("/")) &&
50259 -           !strncmp(of_get_property(root, "model", NULL),
50260 -                       "IBM,LongTrail", 13)) {
50261 +       root = of_find_node_by_path("/");
50262 +       if (!root)
50263 +               return;
50264 +
50265 +       model = of_get_property(root, "model", NULL);
50266 +       if (model && !strncmp(model, "IBM,LongTrail", 13)) {
50267                 /* logical device 0 (KBC/Keyboard) */
50268                 sio_fixup_irq("keyboard", 0, 1, 2);
50269                 /* select logical device 1 (KBC/Mouse) */
50270                 sio_fixup_irq("mouse", 1, 12, 2);
50271         }
50272 +
50273         of_node_put(root);
50274  }
50275  
50276 @@ -251,6 +256,57 @@ static void briq_restart(char *cmd)
50277         for(;;);
50278  }
50279  
50280 +/*
50281 + * Per default, input/output-device points to the keyboard/screen
50282 + * If no card is installed, the built-in serial port is used as a fallback.
50283 + * But unfortunately, the firmware does not connect /chosen/{stdin,stdout}
50284 + * the the built-in serial node. Instead, a /failsafe node is created.
50285 + */
50286 +static void chrp_init_early(void)
50287 +{
50288 +       struct device_node *node;
50289 +       const char *property;
50290 +
50291 +       if (strstr(cmd_line, "console="))
50292 +               return;
50293 +       /* find the boot console from /chosen/stdout */
50294 +       if (!of_chosen)
50295 +               return;
50296 +       node = of_find_node_by_path("/");
50297 +       if (!node)
50298 +               return;
50299 +       property = of_get_property(node, "model", NULL);
50300 +       if (!property)
50301 +               goto out_put;
50302 +       if (strcmp(property, "Pegasos2"))
50303 +               goto out_put;
50304 +       /* this is a Pegasos2 */
50305 +       property = of_get_property(of_chosen, "linux,stdout-path", NULL);
50306 +       if (!property)
50307 +               goto out_put;
50308 +       of_node_put(node);
50309 +       node = of_find_node_by_path(property);
50310 +       if (!node)
50311 +               return;
50312 +       property = of_get_property(node, "device_type", NULL);
50313 +       if (!property)
50314 +               goto out_put;
50315 +       if (strcmp(property, "serial"))
50316 +               goto out_put;
50317 +       /*
50318 +        * The 9pin connector is either /failsafe
50319 +        * or /pci@80000000/isa@C/serial@i2F8
50320 +        * The optional graphics card has also type 'serial' in VGA mode.
50321 +        */
50322 +       property = of_get_property(node, "name", NULL);
50323 +       if (!property)
50324 +               goto out_put;
50325 +       if (!strcmp(property, "failsafe") || !strcmp(property, "serial"))
50326 +               add_preferred_console("ttyS", 0, NULL);
50327 +out_put:
50328 +       of_node_put(node);
50329 +}
50330 +
50331  void __init chrp_setup_arch(void)
50332  {
50333         struct device_node *root = of_find_node_by_path("/");
50334 @@ -594,6 +650,7 @@ define_machine(chrp) {
50335         .probe                  = chrp_probe,
50336         .setup_arch             = chrp_setup_arch,
50337         .init                   = chrp_init2,
50338 +       .init_early             = chrp_init_early,
50339         .show_cpuinfo           = chrp_show_cpuinfo,
50340         .init_IRQ               = chrp_init_IRQ,
50341         .restart                = rtas_restart,
50342 Index: linux-2.6.24.7/arch/powerpc/platforms/embedded6xx/Kconfig
50343 ===================================================================
50344 --- linux-2.6.24.7.orig/arch/powerpc/platforms/embedded6xx/Kconfig
50345 +++ linux-2.6.24.7/arch/powerpc/platforms/embedded6xx/Kconfig
50346 @@ -9,6 +9,8 @@ config LINKSTATION
50347         select FSL_SOC
50348         select PPC_UDBG_16550 if SERIAL_8250
50349         select DEFAULT_UIMAGE
50350 +       select MPC10X_OPENPIC
50351 +       select MPC10X_BRIDGE
50352         help
50353           Select LINKSTATION if configuring for one of PPC- (MPC8241)
50354           based NAS systems from Buffalo Technology. So far only
50355 @@ -16,6 +18,19 @@ config LINKSTATION
50356           Linkstation-I HD-HLAN and HD-HGLAN versions, and PPC-based
50357           Terastation systems should be supported too.
50358  
50359 +config STORCENTER
50360 +       bool "IOMEGA StorCenter"
50361 +       depends on EMBEDDED6xx
50362 +       select MPIC
50363 +       select FSL_SOC
50364 +       select PPC_UDBG_16550 if SERIAL_8250
50365 +       select WANT_DEVICE_TREE
50366 +       select MPC10X_OPENPIC
50367 +       select MPC10X_BRIDGE
50368 +       help
50369 +         Select STORCENTER if configuring for the iomega StorCenter
50370 +         with an 8241 CPU in it.
50371 +
50372  config MPC7448HPC2
50373         bool "Freescale MPC7448HPC2(Taiga)"
50374         depends on EMBEDDED6xx
50375 @@ -23,6 +38,7 @@ config MPC7448HPC2
50376         select DEFAULT_UIMAGE
50377         select PPC_UDBG_16550
50378         select WANT_DEVICE_TREE
50379 +       select TSI108_BRIDGE
50380         help
50381           Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
50382           platform
50383 @@ -33,6 +49,7 @@ config PPC_HOLLY
50384         select TSI108_BRIDGE
50385         select PPC_UDBG_16550
50386         select WANT_DEVICE_TREE
50387 +       select TSI108_BRIDGE
50388         help
50389           Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval
50390           Board with TSI108/9 bridge (Hickory/Holly)
50391 @@ -48,17 +65,13 @@ config PPC_PRPMC2800
50392  
50393  config TSI108_BRIDGE
50394         bool
50395 -       depends on MPC7448HPC2 || PPC_HOLLY
50396         select PCI
50397         select MPIC
50398         select MPIC_WEIRD
50399 -       default y
50400  
50401  config MPC10X_BRIDGE
50402         bool
50403 -       depends on LINKSTATION
50404         select PPC_INDIRECT_PCI
50405 -       default y
50406  
50407  config MV64X60
50408         bool
50409 @@ -67,8 +80,6 @@ config MV64X60
50410  
50411  config MPC10X_OPENPIC
50412         bool
50413 -       depends on LINKSTATION
50414 -       default y
50415  
50416  config MPC10X_STORE_GATHERING
50417         bool "Enable MPC10x store gathering"
50418 Index: linux-2.6.24.7/arch/powerpc/platforms/embedded6xx/Makefile
50419 ===================================================================
50420 --- linux-2.6.24.7.orig/arch/powerpc/platforms/embedded6xx/Makefile
50421 +++ linux-2.6.24.7/arch/powerpc/platforms/embedded6xx/Makefile
50422 @@ -3,5 +3,6 @@
50423  #
50424  obj-$(CONFIG_MPC7448HPC2)      += mpc7448_hpc2.o
50425  obj-$(CONFIG_LINKSTATION)      += linkstation.o ls_uart.o
50426 +obj-$(CONFIG_STORCENTER)       += storcenter.o
50427  obj-$(CONFIG_PPC_HOLLY)                += holly.o
50428  obj-$(CONFIG_PPC_PRPMC2800)    += prpmc2800.o
50429 Index: linux-2.6.24.7/arch/powerpc/platforms/embedded6xx/holly.c
50430 ===================================================================
50431 --- linux-2.6.24.7.orig/arch/powerpc/platforms/embedded6xx/holly.c
50432 +++ linux-2.6.24.7/arch/powerpc/platforms/embedded6xx/holly.c
50433 @@ -20,12 +20,12 @@
50434  #include <linux/console.h>
50435  #include <linux/delay.h>
50436  #include <linux/irq.h>
50437 -#include <linux/ide.h>
50438  #include <linux/seq_file.h>
50439  #include <linux/root_dev.h>
50440  #include <linux/serial.h>
50441  #include <linux/tty.h>
50442  #include <linux/serial_core.h>
50443 +#include <linux/of_platform.h>
50444  
50445  #include <asm/system.h>
50446  #include <asm/time.h>
50447 @@ -39,7 +39,6 @@
50448  #include <asm/tsi108_irq.h>
50449  #include <asm/tsi108_pci.h>
50450  #include <asm/mpic.h>
50451 -#include <asm/of_platform.h>
50452  
50453  #undef DEBUG
50454  
50455 Index: linux-2.6.24.7/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
50456 ===================================================================
50457 --- linux-2.6.24.7.orig/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
50458 +++ linux-2.6.24.7/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
50459 @@ -53,8 +53,6 @@
50460  
50461  #define MPC7448HPC2_PCI_CFG_PHYS 0xfb000000
50462  
50463 -extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
50464 -
50465  int mpc7448_hpc2_exclude_device(struct pci_controller *hose,
50466                                 u_char bus, u_char devfn)
50467  {
50468 Index: linux-2.6.24.7/arch/powerpc/platforms/embedded6xx/storcenter.c
50469 ===================================================================
50470 --- /dev/null
50471 +++ linux-2.6.24.7/arch/powerpc/platforms/embedded6xx/storcenter.c
50472 @@ -0,0 +1,192 @@
50473 +/*
50474 + * Board setup routines for the storcenter
50475 + *
50476 + * Copyright 2007 (C) Oyvind Repvik (nail@nslu2-linux.org)
50477 + * Copyright 2007 Andy Wilcox, Jon Loeliger
50478 + *
50479 + * Based on linkstation.c by G. Liakhovetski
50480 + *
50481 + * This file is licensed under the terms of the GNU General Public License
50482 + * version 2.  This program is licensed "as is" without any warranty of
50483 + * any kind, whether express or implied.
50484 + */
50485 +
50486 +#include <linux/kernel.h>
50487 +#include <linux/pci.h>
50488 +#include <linux/initrd.h>
50489 +#include <linux/mtd/physmap.h>
50490 +#include <linux/of_platform.h>
50491 +
50492 +#include <asm/system.h>
50493 +#include <asm/time.h>
50494 +#include <asm/prom.h>
50495 +#include <asm/mpic.h>
50496 +#include <asm/pci-bridge.h>
50497 +
50498 +#include "mpc10x.h"
50499 +
50500 +
50501 +#ifdef CONFIG_MTD_PHYSMAP
50502 +static struct mtd_partition storcenter_physmap_partitions[] = {
50503 +       {
50504 +               .name   = "kernel",
50505 +               .offset = 0x000000,
50506 +               .size   = 0x170000,
50507 +       },
50508 +       {
50509 +               .name   = "rootfs",
50510 +               .offset = 0x170000,
50511 +               .size   = 0x590000,
50512 +       },
50513 +       {
50514 +               .name   = "uboot",
50515 +               .offset = 0x700000,
50516 +               .size   = 0x040000,
50517 +       },
50518 +       {
50519 +               .name   = "config",
50520 +               .offset = 0x740000,
50521 +               .size   = 0x0c0000,
50522 +       },
50523 +};
50524 +#endif
50525 +
50526 +
50527 +static __initdata struct of_device_id storcenter_of_bus[] = {
50528 +       { .name = "soc", },
50529 +       {},
50530 +};
50531 +
50532 +static int __init storcenter_device_probe(void)
50533 +{
50534 +       of_platform_bus_probe(NULL, storcenter_of_bus, NULL);
50535 +       return 0;
50536 +}
50537 +machine_device_initcall(storcenter, storcenter_device_probe);
50538 +
50539 +
50540 +static int __init storcenter_add_bridge(struct device_node *dev)
50541 +{
50542 +#ifdef CONFIG_PCI
50543 +       int len;
50544 +       struct pci_controller *hose;
50545 +       const int *bus_range;
50546 +
50547 +       printk("Adding PCI host bridge %s\n", dev->full_name);
50548 +
50549 +       hose = pcibios_alloc_controller(dev);
50550 +       if (hose == NULL)
50551 +               return -ENOMEM;
50552 +
50553 +       bus_range = of_get_property(dev, "bus-range", &len);
50554 +       hose->first_busno = bus_range ? bus_range[0] : 0;
50555 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
50556 +
50557 +       setup_indirect_pci(hose, MPC10X_MAPB_CNFG_ADDR, MPC10X_MAPB_CNFG_DATA, 0);
50558 +
50559 +       /* Interpret the "ranges" property */
50560 +       /* This also maps the I/O region and sets isa_io/mem_base */
50561 +       pci_process_bridge_OF_ranges(hose, dev, 1);
50562 +#endif
50563 +
50564 +       return 0;
50565 +}
50566 +
50567 +static void __init storcenter_setup_arch(void)
50568 +{
50569 +       struct device_node *np;
50570 +
50571 +#ifdef CONFIG_MTD_PHYSMAP
50572 +       physmap_set_partitions(storcenter_physmap_partitions,
50573 +                              ARRAY_SIZE(storcenter_physmap_partitions));
50574 +#endif
50575 +
50576 +       /* Lookup PCI host bridges */
50577 +       for_each_compatible_node(np, "pci", "mpc10x-pci")
50578 +               storcenter_add_bridge(np);
50579 +
50580 +       printk(KERN_INFO "IOMEGA StorCenter\n");
50581 +}
50582 +
50583 +/*
50584 + * Interrupt setup and service.  Interrrupts on the turbostation come
50585 + * from the four PCI slots plus onboard 8241 devices: I2C, DUART.
50586 + */
50587 +static void __init storcenter_init_IRQ(void)
50588 +{
50589 +       struct mpic *mpic;
50590 +       struct device_node *dnp;
50591 +       const void *prop;
50592 +       int size;
50593 +       phys_addr_t paddr;
50594 +
50595 +       dnp = of_find_node_by_type(NULL, "open-pic");
50596 +       if (dnp == NULL)
50597 +               return;
50598 +
50599 +       prop = of_get_property(dnp, "reg", &size);
50600 +       if (prop == NULL) {
50601 +               of_node_put(dnp);
50602 +               return;
50603 +       }
50604 +
50605 +       paddr = (phys_addr_t)of_translate_address(dnp, prop);
50606 +       mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET,
50607 +                       4, 32, " EPIC     ");
50608 +
50609 +       of_node_put(dnp);
50610 +
50611 +       BUG_ON(mpic == NULL);
50612 +
50613 +       /* PCI IRQs */
50614 +       /*
50615 +        * 2.6.12 patch:
50616 +        *         openpic_set_sources(0, 5, OpenPIC_Addr + 0x10200);
50617 +        *         openpic_set_sources(5, 2, OpenPIC_Addr + 0x11120);
50618 +        *         first_irq, num_irqs, __iomem first_ISR
50619 +        *         o_ss: i, src: 0, fdf50200
50620 +        *         o_ss: i, src: 1, fdf50220
50621 +        *         o_ss: i, src: 2, fdf50240
50622 +        *         o_ss: i, src: 3, fdf50260
50623 +        *         o_ss: i, src: 4, fdf50280
50624 +        *         o_ss: i, src: 5, fdf51120
50625 +        *         o_ss: i, src: 6, fdf51140
50626 +        */
50627 +       mpic_assign_isu(mpic, 0, paddr + 0x10200);
50628 +       mpic_assign_isu(mpic, 1, paddr + 0x10220);
50629 +       mpic_assign_isu(mpic, 2, paddr + 0x10240);
50630 +       mpic_assign_isu(mpic, 3, paddr + 0x10260);
50631 +       mpic_assign_isu(mpic, 4, paddr + 0x10280);
50632 +       mpic_assign_isu(mpic, 5, paddr + 0x11120);
50633 +       mpic_assign_isu(mpic, 6, paddr + 0x11140);
50634 +
50635 +       mpic_init(mpic);
50636 +}
50637 +
50638 +static void storcenter_restart(char *cmd)
50639 +{
50640 +       local_irq_disable();
50641 +
50642 +       /* Set exception prefix high - to the firmware */
50643 +       _nmask_and_or_msr(0, MSR_IP);
50644 +
50645 +       /* Wait for reset to happen */
50646 +       for (;;) ;
50647 +}
50648 +
50649 +static int __init storcenter_probe(void)
50650 +{
50651 +       unsigned long root = of_get_flat_dt_root();
50652 +
50653 +       return of_flat_dt_is_compatible(root, "storcenter");
50654 +}
50655 +
50656 +define_machine(storcenter){
50657 +       .name                   = "IOMEGA StorCenter",
50658 +       .probe                  = storcenter_probe,
50659 +       .setup_arch             = storcenter_setup_arch,
50660 +       .init_IRQ               = storcenter_init_IRQ,
50661 +       .get_irq                = mpic_get_irq,
50662 +       .restart                = storcenter_restart,
50663 +       .calibrate_decr         = generic_calibrate_decr,
50664 +};
50665 Index: linux-2.6.24.7/arch/powerpc/platforms/iseries/Makefile
50666 ===================================================================
50667 --- linux-2.6.24.7.orig/arch/powerpc/platforms/iseries/Makefile
50668 +++ linux-2.6.24.7/arch/powerpc/platforms/iseries/Makefile
50669 @@ -5,7 +5,7 @@ extra-y += dt.o
50670  obj-y += exception.o
50671  obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt_mod.o mf.o lpevents.o \
50672         hvcall.o proc.o htab.o iommu.o misc.o irq.o
50673 -obj-$(CONFIG_PCI) += pci.o vpdinfo.o
50674 +obj-$(CONFIG_PCI) += pci.o
50675  obj-$(CONFIG_SMP) += smp.o
50676  obj-$(CONFIG_VIOPATH) += viopath.o vio.o
50677  obj-$(CONFIG_MODULES) += ksyms.o
50678 Index: linux-2.6.24.7/arch/powerpc/platforms/iseries/iommu.c
50679 ===================================================================
50680 --- linux-2.6.24.7.orig/arch/powerpc/platforms/iseries/iommu.c
50681 +++ linux-2.6.24.7/arch/powerpc/platforms/iseries/iommu.c
50682 @@ -163,8 +163,10 @@ static struct iommu_table *iommu_table_f
50683                     (it->it_type == TCE_PCI) &&
50684                     (it->it_offset == tbl->it_offset) &&
50685                     (it->it_index == tbl->it_index) &&
50686 -                   (it->it_size == tbl->it_size))
50687 +                   (it->it_size == tbl->it_size)) {
50688 +                       of_node_put(node);
50689                         return it;
50690 +               }
50691         }
50692         return NULL;
50693  }
50694 Index: linux-2.6.24.7/arch/powerpc/platforms/iseries/lpevents.c
50695 ===================================================================
50696 --- linux-2.6.24.7.orig/arch/powerpc/platforms/iseries/lpevents.c
50697 +++ linux-2.6.24.7/arch/powerpc/platforms/iseries/lpevents.c
50698 @@ -239,7 +239,7 @@ int HvLpEvent_unregisterHandler(HvLpEven
50699                          * other CPUs, and that the deleted handler isn't
50700                          * still running on another CPU when we return.
50701                          */
50702 -                       synchronize_rcu();
50703 +                       synchronize_sched();
50704                         return 0;
50705                 }
50706         }
50707 Index: linux-2.6.24.7/arch/powerpc/platforms/iseries/pci.c
50708 ===================================================================
50709 --- linux-2.6.24.7.orig/arch/powerpc/platforms/iseries/pci.c
50710 +++ linux-2.6.24.7/arch/powerpc/platforms/iseries/pci.c
50711 @@ -1,5 +1,6 @@
50712  /*
50713   * Copyright (C) 2001 Allan Trautman, IBM Corporation
50714 + * Copyright (C) 2005,2007  Stephen Rothwell, IBM Corp
50715   *
50716   * iSeries specific routines for PCI.
50717   *
50718 @@ -19,13 +20,18 @@
50719   * along with this program; if not, write to the Free Software
50720   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
50721   */
50722 +
50723 +#undef DEBUG
50724 +
50725  #include <linux/kernel.h>
50726  #include <linux/list.h>
50727  #include <linux/string.h>
50728  #include <linux/init.h>
50729  #include <linux/module.h>
50730  #include <linux/pci.h>
50731 +#include <linux/of.h>
50732  
50733 +#include <asm/types.h>
50734  #include <asm/io.h>
50735  #include <asm/irq.h>
50736  #include <asm/prom.h>
50737 @@ -35,6 +41,7 @@
50738  #include <asm/abs_addr.h>
50739  #include <asm/firmware.h>
50740  
50741 +#include <asm/iseries/hv_types.h>
50742  #include <asm/iseries/hv_call_xm.h>
50743  #include <asm/iseries/mf.h>
50744  #include <asm/iseries/iommu.h>
50745 @@ -45,15 +52,8 @@
50746  #include "pci.h"
50747  #include "call_pci.h"
50748  
50749 -/*
50750 - * Forward declares of prototypes.
50751 - */
50752 -static struct device_node *find_Device_Node(int bus, int devfn);
50753 -
50754 -static int Pci_Retry_Max = 3;  /* Only retry 3 times  */
50755 -static int Pci_Error_Flag = 1; /* Set Retry Error on. */
50756 -
50757 -static struct pci_ops iSeries_pci_ops;
50758 +#define PCI_RETRY_MAX  3
50759 +static int limit_pci_retries = 1;      /* Set Retry Error on. */
50760  
50761  /*
50762   * Table defines
50763 @@ -62,6 +62,7 @@ static struct pci_ops iSeries_pci_ops;
50764  #define IOMM_TABLE_MAX_ENTRIES 1024
50765  #define IOMM_TABLE_ENTRY_SIZE  0x0000000000400000UL
50766  #define BASE_IO_MEMORY         0xE000000000000000UL
50767 +#define END_IO_MEMORY          0xEFFFFFFFFFFFFFFFUL
50768  
50769  static unsigned long max_io_memory = BASE_IO_MEMORY;
50770  static long current_iomm_table_entry;
50771 @@ -70,12 +71,237 @@ static long current_iomm_table_entry;
50772   * Lookup Tables.
50773   */
50774  static struct device_node *iomm_table[IOMM_TABLE_MAX_ENTRIES];
50775 -static u8 iobar_table[IOMM_TABLE_MAX_ENTRIES];
50776 +static u64 ds_addr_table[IOMM_TABLE_MAX_ENTRIES];
50777  
50778 -static const char pci_io_text[] = "iSeries PCI I/O";
50779  static DEFINE_SPINLOCK(iomm_table_lock);
50780  
50781  /*
50782 + * Generate a Direct Select Address for the Hypervisor
50783 + */
50784 +static inline u64 iseries_ds_addr(struct device_node *node)
50785 +{
50786 +       struct pci_dn *pdn = PCI_DN(node);
50787 +       const u32 *sbp = of_get_property(node, "linux,subbus", NULL);
50788 +
50789 +       return ((u64)pdn->busno << 48) + ((u64)(sbp ? *sbp : 0) << 40)
50790 +                       + ((u64)0x10 << 32);
50791 +}
50792 +
50793 +/*
50794 + * Size of Bus VPD data
50795 + */
50796 +#define BUS_VPDSIZE      1024
50797 +
50798 +/*
50799 + * Bus Vpd Tags
50800 + */
50801 +#define VPD_END_OF_AREA                0x79
50802 +#define VPD_ID_STRING          0x82
50803 +#define VPD_VENDOR_AREA                0x84
50804 +
50805 +/*
50806 + * Mfg Area Tags
50807 + */
50808 +#define VPD_FRU_FRAME_ID       0x4649  /* "FI" */
50809 +#define VPD_SLOT_MAP_FORMAT    0x4D46  /* "MF" */
50810 +#define VPD_SLOT_MAP           0x534D  /* "SM" */
50811 +
50812 +/*
50813 + * Structures of the areas
50814 + */
50815 +struct mfg_vpd_area {
50816 +       u16     tag;
50817 +       u8      length;
50818 +       u8      data1;
50819 +       u8      data2;
50820 +};
50821 +#define MFG_ENTRY_SIZE   3
50822 +
50823 +struct slot_map {
50824 +       u8      agent;
50825 +       u8      secondary_agent;
50826 +       u8      phb;
50827 +       char    card_location[3];
50828 +       char    parms[8];
50829 +       char    reserved[2];
50830 +};
50831 +#define SLOT_ENTRY_SIZE   16
50832 +
50833 +/*
50834 + * Parse the Slot Area
50835 + */
50836 +static void __init iseries_parse_slot_area(struct slot_map *map, int len,
50837 +               HvAgentId agent, u8 *phb, char card[4])
50838 +{
50839 +       /*
50840 +        * Parse Slot label until we find the one requested
50841 +        */
50842 +       while (len > 0) {
50843 +               if (map->agent == agent) {
50844 +                       /*
50845 +                        * If Phb wasn't found, grab the entry first one found.
50846 +                        */
50847 +                       if (*phb == 0xff)
50848 +                               *phb = map->phb;
50849 +                       /* Found it, extract the data. */
50850 +                       if (map->phb == *phb) {
50851 +                               memcpy(card, &map->card_location, 3);
50852 +                               card[3]  = 0;
50853 +                               break;
50854 +                       }
50855 +               }
50856 +               /* Point to the next Slot */
50857 +               map = (struct slot_map *)((char *)map + SLOT_ENTRY_SIZE);
50858 +               len -= SLOT_ENTRY_SIZE;
50859 +       }
50860 +}
50861 +
50862 +/*
50863 + * Parse the Mfg Area
50864 + */
50865 +static void __init iseries_parse_mfg_area(struct mfg_vpd_area *area, int len,
50866 +               HvAgentId agent, u8 *phb, u8 *frame, char card[4])
50867 +{
50868 +       u16 slot_map_fmt = 0;
50869 +
50870 +       /* Parse Mfg Data */
50871 +       while (len > 0) {
50872 +               int mfg_tag_len = area->length;
50873 +               /* Frame ID         (FI 4649020310 ) */
50874 +               if (area->tag == VPD_FRU_FRAME_ID)
50875 +                       *frame = area->data1;
50876 +               /* Slot Map Format  (MF 4D46020004 ) */
50877 +               else if (area->tag == VPD_SLOT_MAP_FORMAT)
50878 +                       slot_map_fmt = (area->data1 * 256)
50879 +                               + area->data2;
50880 +               /* Slot Map         (SM 534D90 */
50881 +               else if (area->tag == VPD_SLOT_MAP) {
50882 +                       struct slot_map *slot_map;
50883 +
50884 +                       if (slot_map_fmt == 0x1004)
50885 +                               slot_map = (struct slot_map *)((char *)area
50886 +                                               + MFG_ENTRY_SIZE + 1);
50887 +                       else
50888 +                               slot_map = (struct slot_map *)((char *)area
50889 +                                               + MFG_ENTRY_SIZE);
50890 +                       iseries_parse_slot_area(slot_map, mfg_tag_len,
50891 +                                       agent, phb, card);
50892 +               }
50893 +               /*
50894 +                * Point to the next Mfg Area
50895 +                * Use defined size, sizeof give wrong answer
50896 +                */
50897 +               area = (struct mfg_vpd_area *)((char *)area + mfg_tag_len
50898 +                               + MFG_ENTRY_SIZE);
50899 +               len -= (mfg_tag_len + MFG_ENTRY_SIZE);
50900 +       }
50901 +}
50902 +
50903 +/*
50904 + * Look for "BUS".. Data is not Null terminated.
50905 + * PHBID of 0xFF indicates PHB was not found in VPD Data.
50906 + */
50907 +static u8 __init iseries_parse_phbid(u8 *area, int len)
50908 +{
50909 +       while (len > 0) {
50910 +               if ((*area == 'B') && (*(area + 1) == 'U')
50911 +                               && (*(area + 2) == 'S')) {
50912 +                       area += 3;
50913 +                       while (*area == ' ')
50914 +                               area++;
50915 +                       return *area & 0x0F;
50916 +               }
50917 +               area++;
50918 +               len--;
50919 +       }
50920 +       return 0xff;
50921 +}
50922 +
50923 +/*
50924 + * Parse out the VPD Areas
50925 + */
50926 +static void __init iseries_parse_vpd(u8 *data, int data_len,
50927 +               HvAgentId agent, u8 *frame, char card[4])
50928 +{
50929 +       u8 phb = 0xff;
50930 +
50931 +       while (data_len > 0) {
50932 +               int len;
50933 +               u8 tag = *data;
50934 +
50935 +               if (tag == VPD_END_OF_AREA)
50936 +                       break;
50937 +               len = *(data + 1) + (*(data + 2) * 256);
50938 +               data += 3;
50939 +               data_len -= 3;
50940 +               if (tag == VPD_ID_STRING)
50941 +                       phb = iseries_parse_phbid(data, len);
50942 +               else if (tag == VPD_VENDOR_AREA)
50943 +                       iseries_parse_mfg_area((struct mfg_vpd_area *)data, len,
50944 +                                       agent, &phb, frame, card);
50945 +               /* Point to next Area. */
50946 +               data += len;
50947 +               data_len -= len;
50948 +       }
50949 +}
50950 +
50951 +static int __init iseries_get_location_code(u16 bus, HvAgentId agent,
50952 +               u8 *frame, char card[4])
50953 +{
50954 +       int status = 0;
50955 +       int bus_vpd_len = 0;
50956 +       u8 *bus_vpd = kmalloc(BUS_VPDSIZE, GFP_KERNEL);
50957 +
50958 +       if (bus_vpd == NULL) {
50959 +               printk("PCI: Bus VPD Buffer allocation failure.\n");
50960 +               return 0;
50961 +       }
50962 +       bus_vpd_len = HvCallPci_getBusVpd(bus, iseries_hv_addr(bus_vpd),
50963 +                                       BUS_VPDSIZE);
50964 +       if (bus_vpd_len == 0) {
50965 +               printk("PCI: Bus VPD Buffer zero length.\n");
50966 +               goto out_free;
50967 +       }
50968 +       /* printk("PCI: bus_vpd: %p, %d\n",bus_vpd, bus_vpd_len); */
50969 +       /* Make sure this is what I think it is */
50970 +       if (*bus_vpd != VPD_ID_STRING) {
50971 +               printk("PCI: Bus VPD Buffer missing starting tag.\n");
50972 +               goto out_free;
50973 +       }
50974 +       iseries_parse_vpd(bus_vpd, bus_vpd_len, agent, frame, card);
50975 +       status = 1;
50976 +out_free:
50977 +       kfree(bus_vpd);
50978 +       return status;
50979 +}
50980 +
50981 +/*
50982 + * Prints the device information.
50983 + * - Pass in pci_dev* pointer to the device.
50984 + * - Pass in the device count
50985 + *
50986 + * Format:
50987 + * PCI: Bus  0, Device 26, Vendor 0x12AE  Frame  1, Card  C10  Ethernet
50988 + * controller
50989 + */
50990 +static void __init iseries_device_information(struct pci_dev *pdev,
50991 +                                             u16 bus, HvSubBusNumber subbus)
50992 +{
50993 +       u8 frame = 0;
50994 +       char card[4];
50995 +       HvAgentId agent;
50996 +
50997 +       agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
50998 +                       ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
50999 +
51000 +       if (iseries_get_location_code(bus, agent, &frame, card)) {
51001 +               printk(KERN_INFO "PCI: %s, Vendor %04X Frame%3d, "
51002 +                      "Card %4s  0x%04X\n", pci_name(pdev), pdev->vendor,
51003 +                      frame, card, (int)(pdev->class >> 8));
51004 +       }
51005 +}
51006 +
51007 +/*
51008   * iomm_table_allocate_entry
51009   *
51010   * Adds pci_dev entry in address translation table
51011 @@ -87,7 +313,7 @@ static DEFINE_SPINLOCK(iomm_table_lock);
51012   * - CurrentIndex is incremented to keep track of the last entry.
51013   * - Builds the resource entry for allocated BARs.
51014   */
51015 -static void iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
51016 +static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
51017  {
51018         struct resource *bar_res = &dev->resource[bar_num];
51019         long bar_size = pci_resource_len(dev, bar_num);
51020 @@ -101,7 +327,6 @@ static void iomm_table_allocate_entry(st
51021          * Set Resource values.
51022          */
51023         spin_lock(&iomm_table_lock);
51024 -       bar_res->name = pci_io_text;
51025         bar_res->start = BASE_IO_MEMORY +
51026                 IOMM_TABLE_ENTRY_SIZE * current_iomm_table_entry;
51027         bar_res->end = bar_res->start + bar_size - 1;
51028 @@ -110,7 +335,8 @@ static void iomm_table_allocate_entry(st
51029          */
51030         while (bar_size > 0 ) {
51031                 iomm_table[current_iomm_table_entry] = dev->sysdata;
51032 -               iobar_table[current_iomm_table_entry] = bar_num;
51033 +               ds_addr_table[current_iomm_table_entry] =
51034 +                       iseries_ds_addr(dev->sysdata) | (bar_num << 24);
51035                 bar_size -= IOMM_TABLE_ENTRY_SIZE;
51036                 ++current_iomm_table_entry;
51037         }
51038 @@ -130,7 +356,7 @@ static void iomm_table_allocate_entry(st
51039   * - Loops through The Bar resources(0 - 5) including the ROM
51040   *   is resource(6).
51041   */
51042 -static void allocate_device_bars(struct pci_dev *dev)
51043 +static void __init allocate_device_bars(struct pci_dev *dev)
51044  {
51045         int bar_num;
51046  
51047 @@ -145,79 +371,19 @@ static void allocate_device_bars(struct 
51048   * PCI: Read Vendor Failed 0x18.58.10 Rc: 0x00xx
51049   * PCI: Connect Bus Unit Failed 0x18.58.10 Rc: 0x00xx
51050   */
51051 -static void pci_Log_Error(char *Error_Text, int Bus, int SubBus,
51052 -               int AgentId, int HvRc)
51053 +static void pci_log_error(char *error, int bus, int subbus,
51054 +               int agent, int hv_res)
51055  {
51056 -       if (HvRc == 0x0302)
51057 +       if (hv_res == 0x0302)
51058                 return;
51059         printk(KERN_ERR "PCI: %s Failed: 0x%02X.%02X.%02X Rc: 0x%04X",
51060 -              Error_Text, Bus, SubBus, AgentId, HvRc);
51061 -}
51062 -
51063 -/*
51064 - * iSeries_pci_final_fixup(void)
51065 - */
51066 -void __init iSeries_pci_final_fixup(void)
51067 -{
51068 -       struct pci_dev *pdev = NULL;
51069 -       struct device_node *node;
51070 -       int DeviceCount = 0;
51071 -
51072 -       /* Fix up at the device node and pci_dev relationship */
51073 -       mf_display_src(0xC9000100);
51074 -
51075 -       printk("pcibios_final_fixup\n");
51076 -       for_each_pci_dev(pdev) {
51077 -               node = find_Device_Node(pdev->bus->number, pdev->devfn);
51078 -               printk("pci dev %p (%x.%x), node %p\n", pdev,
51079 -                      pdev->bus->number, pdev->devfn, node);
51080 -
51081 -               if (node != NULL) {
51082 -                       struct pci_dn *pdn = PCI_DN(node);
51083 -                       const u32 *agent;
51084 -
51085 -                       agent = of_get_property(node, "linux,agent-id", NULL);
51086 -                       if ((pdn != NULL) && (agent != NULL)) {
51087 -                               u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
51088 -                                               pdn->bussubno);
51089 -                               int err;
51090 -
51091 -                               err = HvCallXm_connectBusUnit(pdn->busno, pdn->bussubno,
51092 -                                               *agent, irq);
51093 -                               if (err)
51094 -                                       pci_Log_Error("Connect Bus Unit",
51095 -                                               pdn->busno, pdn->bussubno, *agent, err);
51096 -                               else {
51097 -                                       err = HvCallPci_configStore8(pdn->busno, pdn->bussubno,
51098 -                                                       *agent,
51099 -                                                       PCI_INTERRUPT_LINE,
51100 -                                                       irq);
51101 -                                       if (err)
51102 -                                               pci_Log_Error("PciCfgStore Irq Failed!",
51103 -                                                       pdn->busno, pdn->bussubno, *agent, err);
51104 -                               }
51105 -                               if (!err)
51106 -                                       pdev->irq = irq;
51107 -                       }
51108 -
51109 -                       ++DeviceCount;
51110 -                       pdev->sysdata = (void *)node;
51111 -                       PCI_DN(node)->pcidev = pdev;
51112 -                       allocate_device_bars(pdev);
51113 -                       iSeries_Device_Information(pdev, DeviceCount);
51114 -                       iommu_devnode_init_iSeries(pdev, node);
51115 -               } else
51116 -                       printk("PCI: Device Tree not found for 0x%016lX\n",
51117 -                                       (unsigned long)pdev);
51118 -       }
51119 -       iSeries_activate_IRQs();
51120 -       mf_display_src(0xC9000200);
51121 +              error, bus, subbus, agent, hv_res);
51122  }
51123  
51124  /*
51125   * Look down the chain to find the matching Device Device
51126   */
51127 -static struct device_node *find_Device_Node(int bus, int devfn)
51128 +static struct device_node *find_device_node(int bus, int devfn)
51129  {
51130         struct device_node *node;
51131  
51132 @@ -230,22 +396,66 @@ static struct device_node *find_Device_N
51133         return NULL;
51134  }
51135  
51136 -#if 0
51137  /*
51138 - * Returns the device node for the passed pci_dev
51139 - * Sanity Check Node PciDev to passed pci_dev
51140 - * If none is found, returns a NULL which the client must handle.
51141 + * iSeries_pcibios_fixup_resources
51142 + *
51143 + * Fixes up all resources for devices
51144   */
51145 -static struct device_node *get_Device_Node(struct pci_dev *pdev)
51146 +void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
51147  {
51148 +       const u32 *agent;
51149 +       const u32 *sub_bus;
51150 +       unsigned char bus = pdev->bus->number;
51151         struct device_node *node;
51152 +       int i;
51153 +
51154 +       node = find_device_node(bus, pdev->devfn);
51155 +       pr_debug("PCI: iSeries %s, pdev %p, node %p\n",
51156 +                pci_name(pdev), pdev, node);
51157 +       if (!node) {
51158 +               printk("PCI: %s disabled, device tree entry not found !\n",
51159 +                      pci_name(pdev));
51160 +               for (i = 0; i <= PCI_ROM_RESOURCE; i++)
51161 +                       pdev->resource[i].flags = 0;
51162 +               return;
51163 +       }
51164 +       sub_bus = of_get_property(node, "linux,subbus", NULL);
51165 +       agent = of_get_property(node, "linux,agent-id", NULL);
51166 +       if (agent && sub_bus) {
51167 +               u8 irq = iSeries_allocate_IRQ(bus, 0, *sub_bus);
51168 +               int err;
51169 +
51170 +               err = HvCallXm_connectBusUnit(bus, *sub_bus, *agent, irq);
51171 +               if (err)
51172 +                       pci_log_error("Connect Bus Unit",
51173 +                                     bus, *sub_bus, *agent, err);
51174 +               else {
51175 +                       err = HvCallPci_configStore8(bus, *sub_bus,
51176 +                                       *agent, PCI_INTERRUPT_LINE, irq);
51177 +                       if (err)
51178 +                               pci_log_error("PciCfgStore Irq Failed!",
51179 +                                               bus, *sub_bus, *agent, err);
51180 +                       else
51181 +                               pdev->irq = irq;
51182 +               }
51183 +       }
51184  
51185 -       node = pdev->sysdata;
51186 -       if (node == NULL || PCI_DN(node)->pcidev != pdev)
51187 -               node = find_Device_Node(pdev->bus->number, pdev->devfn);
51188 -       return node;
51189 +       pdev->sysdata = node;
51190 +       allocate_device_bars(pdev);
51191 +       iseries_device_information(pdev, bus, *sub_bus);
51192 +       iommu_devnode_init_iSeries(pdev, node);
51193 +}
51194 +
51195 +/*
51196 + * iSeries_pci_final_fixup(void)
51197 + */
51198 +void __init iSeries_pci_final_fixup(void)
51199 +{
51200 +       /* Fix up at the device node and pci_dev relationship */
51201 +       mf_display_src(0xC9000100);
51202 +       iSeries_activate_IRQs();
51203 +       mf_display_src(0xC9000200);
51204  }
51205 -#endif
51206  
51207  /*
51208   * Config space read and write functions.
51209 @@ -269,7 +479,7 @@ static u64 hv_cfg_write_func[4] = {
51210  static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
51211                 int offset, int size, u32 *val)
51212  {
51213 -       struct device_node *node = find_Device_Node(bus->number, devfn);
51214 +       struct device_node *node = find_device_node(bus->number, devfn);
51215         u64 fn;
51216         struct HvCallPci_LoadReturn ret;
51217  
51218 @@ -299,7 +509,7 @@ static int iSeries_pci_read_config(struc
51219  static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn,
51220                 int offset, int size, u32 val)
51221  {
51222 -       struct device_node *node = find_Device_Node(bus->number, devfn);
51223 +       struct device_node *node = find_device_node(bus->number, devfn);
51224         u64 fn;
51225         u64 ret;
51226  
51227 @@ -331,22 +541,22 @@ static struct pci_ops iSeries_pci_ops = 
51228   * PCI: Device 23.90 ReadL Retry( 1)
51229   * PCI: Device 23.90 ReadL Retry Successful(1)
51230   */
51231 -static int CheckReturnCode(char *TextHdr, struct device_node *DevNode,
51232 +static int check_return_code(char *type, struct device_node *dn,
51233                 int *retry, u64 ret)
51234  {
51235         if (ret != 0)  {
51236 -               struct pci_dn *pdn = PCI_DN(DevNode);
51237 +               struct pci_dn *pdn = PCI_DN(dn);
51238  
51239                 (*retry)++;
51240                 printk("PCI: %s: Device 0x%04X:%02X  I/O Error(%2d): 0x%04X\n",
51241 -                               TextHdr, pdn->busno, pdn->devfn,
51242 +                               type, pdn->busno, pdn->devfn,
51243                                 *retry, (int)ret);
51244                 /*
51245                  * Bump the retry and check for retry count exceeded.
51246                  * If, Exceeded, panic the system.
51247                  */
51248 -               if (((*retry) > Pci_Retry_Max) &&
51249 -                               (Pci_Error_Flag > 0)) {
51250 +               if (((*retry) > PCI_RETRY_MAX) &&
51251 +                               (limit_pci_retries > 0)) {
51252                         mf_display_src(0xB6000103);
51253                         panic_timeout = 0;
51254                         panic("PCI: Hardware I/O Error, SRC B6000103, "
51255 @@ -363,28 +573,39 @@ static int CheckReturnCode(char *TextHdr
51256   * the exposure of being device global.
51257   */
51258  static inline struct device_node *xlate_iomm_address(
51259 -               const volatile void __iomem *IoAddress,
51260 -               u64 *dsaptr, u64 *BarOffsetPtr)
51261 +               const volatile void __iomem *addr,
51262 +               u64 *dsaptr, u64 *bar_offset, const char *func)
51263  {
51264 -       unsigned long OrigIoAddr;
51265 -       unsigned long BaseIoAddr;
51266 -       unsigned long TableIndex;
51267 -       struct device_node *DevNode;
51268 +       unsigned long orig_addr;
51269 +       unsigned long base_addr;
51270 +       unsigned long ind;
51271 +       struct device_node *dn;
51272  
51273 -       OrigIoAddr = (unsigned long __force)IoAddress;
51274 -       if ((OrigIoAddr < BASE_IO_MEMORY) || (OrigIoAddr >= max_io_memory))
51275 +       orig_addr = (unsigned long __force)addr;
51276 +       if ((orig_addr < BASE_IO_MEMORY) || (orig_addr >= max_io_memory)) {
51277 +               static unsigned long last_jiffies;
51278 +               static int num_printed;
51279 +
51280 +               if ((jiffies - last_jiffies) > 60 * HZ) {
51281 +                       last_jiffies = jiffies;
51282 +                       num_printed = 0;
51283 +               }
51284 +               if (num_printed++ < 10)
51285 +                       printk(KERN_ERR
51286 +                               "iSeries_%s: invalid access at IO address %p\n",
51287 +                               func, addr);
51288                 return NULL;
51289 -       BaseIoAddr = OrigIoAddr - BASE_IO_MEMORY;
51290 -       TableIndex = BaseIoAddr / IOMM_TABLE_ENTRY_SIZE;
51291 -       DevNode = iomm_table[TableIndex];
51292 -
51293 -       if (DevNode != NULL) {
51294 -               int barnum = iobar_table[TableIndex];
51295 -               *dsaptr = iseries_ds_addr(DevNode) | (barnum << 24);
51296 -               *BarOffsetPtr = BaseIoAddr % IOMM_TABLE_ENTRY_SIZE;
51297 +       }
51298 +       base_addr = orig_addr - BASE_IO_MEMORY;
51299 +       ind = base_addr / IOMM_TABLE_ENTRY_SIZE;
51300 +       dn = iomm_table[ind];
51301 +
51302 +       if (dn != NULL) {
51303 +               *dsaptr = ds_addr_table[ind];
51304 +               *bar_offset = base_addr % IOMM_TABLE_ENTRY_SIZE;
51305         } else
51306 -               panic("PCI: Invalid PCI IoAddress detected!\n");
51307 -       return DevNode;
51308 +               panic("PCI: Invalid PCI IO address detected!\n");
51309 +       return dn;
51310  }
51311  
51312  /*
51313 @@ -392,91 +613,58 @@ static inline struct device_node *xlate_
51314   * On MM I/O error, all ones are returned and iSeries_pci_IoError is cal
51315   * else, data is returned in Big Endian format.
51316   */
51317 -static u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
51318 +static u8 iseries_readb(const volatile void __iomem *addr)
51319  {
51320 -       u64 BarOffset;
51321 +       u64 bar_offset;
51322         u64 dsa;
51323         int retry = 0;
51324         struct HvCallPci_LoadReturn ret;
51325 -       struct device_node *DevNode =
51326 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51327 -
51328 -       if (DevNode == NULL) {
51329 -               static unsigned long last_jiffies;
51330 -               static int num_printed;
51331 +       struct device_node *dn =
51332 +               xlate_iomm_address(addr, &dsa, &bar_offset, "read_byte");
51333  
51334 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51335 -                       last_jiffies = jiffies;
51336 -                       num_printed = 0;
51337 -               }
51338 -               if (num_printed++ < 10)
51339 -                       printk(KERN_ERR "iSeries_Read_Byte: invalid access at IO address %p\n",
51340 -                              IoAddress);
51341 +       if (dn == NULL)
51342                 return 0xff;
51343 -       }
51344         do {
51345 -               HvCall3Ret16(HvCallPciBarLoad8, &ret, dsa, BarOffset, 0);
51346 -       } while (CheckReturnCode("RDB", DevNode, &retry, ret.rc) != 0);
51347 +               HvCall3Ret16(HvCallPciBarLoad8, &ret, dsa, bar_offset, 0);
51348 +       } while (check_return_code("RDB", dn, &retry, ret.rc) != 0);
51349  
51350         return ret.value;
51351  }
51352  
51353 -static u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
51354 +static u16 iseries_readw_be(const volatile void __iomem *addr)
51355  {
51356 -       u64 BarOffset;
51357 +       u64 bar_offset;
51358         u64 dsa;
51359         int retry = 0;
51360         struct HvCallPci_LoadReturn ret;
51361 -       struct device_node *DevNode =
51362 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51363 -
51364 -       if (DevNode == NULL) {
51365 -               static unsigned long last_jiffies;
51366 -               static int num_printed;
51367 +       struct device_node *dn =
51368 +               xlate_iomm_address(addr, &dsa, &bar_offset, "read_word");
51369  
51370 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51371 -                       last_jiffies = jiffies;
51372 -                       num_printed = 0;
51373 -               }
51374 -               if (num_printed++ < 10)
51375 -                       printk(KERN_ERR "iSeries_Read_Word: invalid access at IO address %p\n",
51376 -                              IoAddress);
51377 +       if (dn == NULL)
51378                 return 0xffff;
51379 -       }
51380         do {
51381                 HvCall3Ret16(HvCallPciBarLoad16, &ret, dsa,
51382 -                               BarOffset, 0);
51383 -       } while (CheckReturnCode("RDW", DevNode, &retry, ret.rc) != 0);
51384 +                               bar_offset, 0);
51385 +       } while (check_return_code("RDW", dn, &retry, ret.rc) != 0);
51386  
51387         return ret.value;
51388  }
51389  
51390 -static u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
51391 +static u32 iseries_readl_be(const volatile void __iomem *addr)
51392  {
51393 -       u64 BarOffset;
51394 +       u64 bar_offset;
51395         u64 dsa;
51396         int retry = 0;
51397         struct HvCallPci_LoadReturn ret;
51398 -       struct device_node *DevNode =
51399 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51400 +       struct device_node *dn =
51401 +               xlate_iomm_address(addr, &dsa, &bar_offset, "read_long");
51402  
51403 -       if (DevNode == NULL) {
51404 -               static unsigned long last_jiffies;
51405 -               static int num_printed;
51406 -
51407 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51408 -                       last_jiffies = jiffies;
51409 -                       num_printed = 0;
51410 -               }
51411 -               if (num_printed++ < 10)
51412 -                       printk(KERN_ERR "iSeries_Read_Long: invalid access at IO address %p\n",
51413 -                              IoAddress);
51414 +       if (dn == NULL)
51415                 return 0xffffffff;
51416 -       }
51417         do {
51418                 HvCall3Ret16(HvCallPciBarLoad32, &ret, dsa,
51419 -                               BarOffset, 0);
51420 -       } while (CheckReturnCode("RDL", DevNode, &retry, ret.rc) != 0);
51421 +                               bar_offset, 0);
51422 +       } while (check_return_code("RDL", dn, &retry, ret.rc) != 0);
51423  
51424         return ret.value;
51425  }
51426 @@ -485,134 +673,72 @@ static u32 iSeries_Read_Long(const volat
51427   * Write MM I/O Instructions for the iSeries
51428   *
51429   */
51430 -static void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
51431 +static void iseries_writeb(u8 data, volatile void __iomem *addr)
51432  {
51433 -       u64 BarOffset;
51434 +       u64 bar_offset;
51435         u64 dsa;
51436         int retry = 0;
51437         u64 rc;
51438 -       struct device_node *DevNode =
51439 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51440 -
51441 -       if (DevNode == NULL) {
51442 -               static unsigned long last_jiffies;
51443 -               static int num_printed;
51444 +       struct device_node *dn =
51445 +               xlate_iomm_address(addr, &dsa, &bar_offset, "write_byte");
51446  
51447 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51448 -                       last_jiffies = jiffies;
51449 -                       num_printed = 0;
51450 -               }
51451 -               if (num_printed++ < 10)
51452 -                       printk(KERN_ERR "iSeries_Write_Byte: invalid access at IO address %p\n", IoAddress);
51453 +       if (dn == NULL)
51454                 return;
51455 -       }
51456         do {
51457 -               rc = HvCall4(HvCallPciBarStore8, dsa, BarOffset, data, 0);
51458 -       } while (CheckReturnCode("WWB", DevNode, &retry, rc) != 0);
51459 +               rc = HvCall4(HvCallPciBarStore8, dsa, bar_offset, data, 0);
51460 +       } while (check_return_code("WWB", dn, &retry, rc) != 0);
51461  }
51462  
51463 -static void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
51464 +static void iseries_writew_be(u16 data, volatile void __iomem *addr)
51465  {
51466 -       u64 BarOffset;
51467 +       u64 bar_offset;
51468         u64 dsa;
51469         int retry = 0;
51470         u64 rc;
51471 -       struct device_node *DevNode =
51472 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51473 +       struct device_node *dn =
51474 +               xlate_iomm_address(addr, &dsa, &bar_offset, "write_word");
51475  
51476 -       if (DevNode == NULL) {
51477 -               static unsigned long last_jiffies;
51478 -               static int num_printed;
51479 -
51480 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51481 -                       last_jiffies = jiffies;
51482 -                       num_printed = 0;
51483 -               }
51484 -               if (num_printed++ < 10)
51485 -                       printk(KERN_ERR "iSeries_Write_Word: invalid access at IO address %p\n",
51486 -                              IoAddress);
51487 +       if (dn == NULL)
51488                 return;
51489 -       }
51490         do {
51491 -               rc = HvCall4(HvCallPciBarStore16, dsa, BarOffset, data, 0);
51492 -       } while (CheckReturnCode("WWW", DevNode, &retry, rc) != 0);
51493 +               rc = HvCall4(HvCallPciBarStore16, dsa, bar_offset, data, 0);
51494 +       } while (check_return_code("WWW", dn, &retry, rc) != 0);
51495  }
51496  
51497 -static void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
51498 +static void iseries_writel_be(u32 data, volatile void __iomem *addr)
51499  {
51500 -       u64 BarOffset;
51501 +       u64 bar_offset;
51502         u64 dsa;
51503         int retry = 0;
51504         u64 rc;
51505 -       struct device_node *DevNode =
51506 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51507 -
51508 -       if (DevNode == NULL) {
51509 -               static unsigned long last_jiffies;
51510 -               static int num_printed;
51511 +       struct device_node *dn =
51512 +               xlate_iomm_address(addr, &dsa, &bar_offset, "write_long");
51513  
51514 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51515 -                       last_jiffies = jiffies;
51516 -                       num_printed = 0;
51517 -               }
51518 -               if (num_printed++ < 10)
51519 -                       printk(KERN_ERR "iSeries_Write_Long: invalid access at IO address %p\n",
51520 -                              IoAddress);
51521 +       if (dn == NULL)
51522                 return;
51523 -       }
51524         do {
51525 -               rc = HvCall4(HvCallPciBarStore32, dsa, BarOffset, data, 0);
51526 -       } while (CheckReturnCode("WWL", DevNode, &retry, rc) != 0);
51527 -}
51528 -
51529 -static u8 iseries_readb(const volatile void __iomem *addr)
51530 -{
51531 -       return iSeries_Read_Byte(addr);
51532 +               rc = HvCall4(HvCallPciBarStore32, dsa, bar_offset, data, 0);
51533 +       } while (check_return_code("WWL", dn, &retry, rc) != 0);
51534  }
51535  
51536  static u16 iseries_readw(const volatile void __iomem *addr)
51537  {
51538 -       return le16_to_cpu(iSeries_Read_Word(addr));
51539 +       return le16_to_cpu(iseries_readw_be(addr));
51540  }
51541  
51542  static u32 iseries_readl(const volatile void __iomem *addr)
51543  {
51544 -       return le32_to_cpu(iSeries_Read_Long(addr));
51545 -}
51546 -
51547 -static u16 iseries_readw_be(const volatile void __iomem *addr)
51548 -{
51549 -       return iSeries_Read_Word(addr);
51550 -}
51551 -
51552 -static u32 iseries_readl_be(const volatile void __iomem *addr)
51553 -{
51554 -       return iSeries_Read_Long(addr);
51555 -}
51556 -
51557 -static void iseries_writeb(u8 data, volatile void __iomem *addr)
51558 -{
51559 -       iSeries_Write_Byte(data, addr);
51560 +       return le32_to_cpu(iseries_readl_be(addr));
51561  }
51562  
51563  static void iseries_writew(u16 data, volatile void __iomem *addr)
51564  {
51565 -       iSeries_Write_Word(cpu_to_le16(data), addr);
51566 +       iseries_writew_be(cpu_to_le16(data), addr);
51567  }
51568  
51569  static void iseries_writel(u32 data, volatile void __iomem *addr)
51570  {
51571 -       iSeries_Write_Long(cpu_to_le32(data), addr);
51572 -}
51573 -
51574 -static void iseries_writew_be(u16 data, volatile void __iomem *addr)
51575 -{
51576 -       iSeries_Write_Word(data, addr);
51577 -}
51578 -
51579 -static void iseries_writel_be(u32 data, volatile void __iomem *addr)
51580 -{
51581 -       iSeries_Write_Long(data, addr);
51582 +       iseries_writel(cpu_to_le32(data), addr);
51583  }
51584  
51585  static void iseries_readsb(const volatile void __iomem *addr, void *buf,
51586 @@ -620,7 +746,7 @@ static void iseries_readsb(const volatil
51587  {
51588         u8 *dst = buf;
51589         while(count-- > 0)
51590 -               *(dst++) = iSeries_Read_Byte(addr);
51591 +               *(dst++) = iseries_readb(addr);
51592  }
51593  
51594  static void iseries_readsw(const volatile void __iomem *addr, void *buf,
51595 @@ -628,7 +754,7 @@ static void iseries_readsw(const volatil
51596  {
51597         u16 *dst = buf;
51598         while(count-- > 0)
51599 -               *(dst++) = iSeries_Read_Word(addr);
51600 +               *(dst++) = iseries_readw_be(addr);
51601  }
51602  
51603  static void iseries_readsl(const volatile void __iomem *addr, void *buf,
51604 @@ -636,7 +762,7 @@ static void iseries_readsl(const volatil
51605  {
51606         u32 *dst = buf;
51607         while(count-- > 0)
51608 -               *(dst++) = iSeries_Read_Long(addr);
51609 +               *(dst++) = iseries_readl_be(addr);
51610  }
51611  
51612  static void iseries_writesb(volatile void __iomem *addr, const void *buf,
51613 @@ -644,7 +770,7 @@ static void iseries_writesb(volatile voi
51614  {
51615         const u8 *src = buf;
51616         while(count-- > 0)
51617 -               iSeries_Write_Byte(*(src++), addr);
51618 +               iseries_writeb(*(src++), addr);
51619  }
51620  
51621  static void iseries_writesw(volatile void __iomem *addr, const void *buf,
51622 @@ -652,7 +778,7 @@ static void iseries_writesw(volatile voi
51623  {
51624         const u16 *src = buf;
51625         while(count-- > 0)
51626 -               iSeries_Write_Word(*(src++), addr);
51627 +               iseries_writew_be(*(src++), addr);
51628  }
51629  
51630  static void iseries_writesl(volatile void __iomem *addr, const void *buf,
51631 @@ -660,7 +786,7 @@ static void iseries_writesl(volatile voi
51632  {
51633         const u32 *src = buf;
51634         while(count-- > 0)
51635 -               iSeries_Write_Long(*(src++), addr);
51636 +               iseries_writel_be(*(src++), addr);
51637  }
51638  
51639  static void iseries_memset_io(volatile void __iomem *addr, int c,
51640 @@ -669,7 +795,7 @@ static void iseries_memset_io(volatile v
51641         volatile char __iomem *d = addr;
51642  
51643         while (n-- > 0)
51644 -               iSeries_Write_Byte(c, d++);
51645 +               iseries_writeb(c, d++);
51646  }
51647  
51648  static void iseries_memcpy_fromio(void *dest, const volatile void __iomem *src,
51649 @@ -679,7 +805,7 @@ static void iseries_memcpy_fromio(void *
51650         const volatile char __iomem *s = src;
51651  
51652         while (n-- > 0)
51653 -               *d++ = iSeries_Read_Byte(s++);
51654 +               *d++ = iseries_readb(s++);
51655  }
51656  
51657  static void iseries_memcpy_toio(volatile void __iomem *dest, const void *src,
51658 @@ -689,7 +815,7 @@ static void iseries_memcpy_toio(volatile
51659         volatile char __iomem *d = dest;
51660  
51661         while (n-- > 0)
51662 -               iSeries_Write_Byte(*s++, d++);
51663 +               iseries_writeb(*s++, d++);
51664  }
51665  
51666  /* We only set MMIO ops. The default PIO ops will be default
51667 @@ -742,6 +868,8 @@ void __init iSeries_pcibios_init(void)
51668         /* Install IO hooks */
51669         ppc_pci_io = iseries_pci_io;
51670  
51671 +       pci_probe_only = 1;
51672 +
51673         /* iSeries has no IO space in the common sense, it needs to set
51674          * the IO base to 0
51675          */
51676 @@ -767,11 +895,21 @@ void __init iSeries_pcibios_init(void)
51677                 phb = pcibios_alloc_controller(node);
51678                 if (phb == NULL)
51679                         continue;
51680 +               /* All legacy iSeries PHBs are in domain zero */
51681 +               phb->global_number = 0;
51682  
51683 -               phb->pci_mem_offset = bus;
51684                 phb->first_busno = bus;
51685                 phb->last_busno = bus;
51686                 phb->ops = &iSeries_pci_ops;
51687 +               phb->io_base_virt = (void __iomem *)_IO_BASE;
51688 +               phb->io_resource.flags = IORESOURCE_IO;
51689 +               phb->io_resource.start = BASE_IO_MEMORY;
51690 +               phb->io_resource.end = END_IO_MEMORY;
51691 +               phb->io_resource.name = "iSeries PCI IO";
51692 +               phb->mem_resources[0].flags = IORESOURCE_MEM;
51693 +               phb->mem_resources[0].start = BASE_IO_MEMORY;
51694 +               phb->mem_resources[0].end = END_IO_MEMORY;
51695 +               phb->mem_resources[0].name = "Series PCI MEM";
51696         }
51697  
51698         of_node_put(root);
51699 Index: linux-2.6.24.7/arch/powerpc/platforms/iseries/pci.h
51700 ===================================================================
51701 --- linux-2.6.24.7.orig/arch/powerpc/platforms/iseries/pci.h
51702 +++ linux-2.6.24.7/arch/powerpc/platforms/iseries/pci.h
51703 @@ -30,10 +30,6 @@
51704   * End Change Activity
51705   */
51706  
51707 -#include <asm/pci-bridge.h>
51708 -
51709 -struct pci_dev;                                /* For Forward Reference */
51710 -
51711  /*
51712   * Decodes Linux DevFn to iSeries DevFn, bridge device, or function.
51713   * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h
51714 @@ -47,17 +43,16 @@ struct pci_dev;                             /* For Forward Refere
51715  #define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus)         ((subbus >> 5) & 0x7)
51716  #define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)       ((subbus >> 2) & 0x7)
51717  
51718 -/*
51719 - * Generate a Direct Select Address for the Hypervisor
51720 - */
51721 -static inline u64 iseries_ds_addr(struct device_node *node)
51722 -{
51723 -       struct pci_dn *pdn = PCI_DN(node);
51724 -
51725 -       return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40)
51726 -                       + ((u64)0x10 << 32);
51727 -}
51728 +struct pci_dev;
51729  
51730 -extern void    iSeries_Device_Information(struct pci_dev*, int);
51731 +#ifdef CONFIG_PCI
51732 +extern void    iSeries_pcibios_init(void);
51733 +extern void    iSeries_pci_final_fixup(void);
51734 +extern void    iSeries_pcibios_fixup_resources(struct pci_dev *dev);
51735 +#else
51736 +static inline void     iSeries_pcibios_init(void) { }
51737 +static inline void     iSeries_pci_final_fixup(void) { }
51738 +static inline void     iSeries_pcibios_fixup_resources(struct pci_dev *dev) {}
51739 +#endif
51740  
51741  #endif /* _PLATFORMS_ISERIES_PCI_H */
51742 Index: linux-2.6.24.7/arch/powerpc/platforms/iseries/setup.c
51743 ===================================================================
51744 --- linux-2.6.24.7.orig/arch/powerpc/platforms/iseries/setup.c
51745 +++ linux-2.6.24.7/arch/powerpc/platforms/iseries/setup.c
51746 @@ -63,6 +63,7 @@
51747  #include "main_store.h"
51748  #include "call_sm.h"
51749  #include "call_hpt.h"
51750 +#include "pci.h"
51751  
51752  #ifdef DEBUG
51753  #define DBG(fmt...) udbg_printf(fmt)
51754 @@ -74,11 +75,6 @@
51755  static unsigned long build_iSeries_Memory_Map(void);
51756  static void iseries_shared_idle(void);
51757  static void iseries_dedicated_idle(void);
51758 -#ifdef CONFIG_PCI
51759 -extern void iSeries_pci_final_fixup(void);
51760 -#else
51761 -static void iSeries_pci_final_fixup(void) { }
51762 -#endif
51763  
51764  
51765  struct MemoryBlock {
51766 @@ -112,13 +108,13 @@ static unsigned long iSeries_process_Con
51767          * correctly.
51768          */
51769         mb_array[0].logicalStart = 0;
51770 -       mb_array[0].logicalEnd = 0x100000000;
51771 +       mb_array[0].logicalEnd = 0x100000000UL;
51772         mb_array[0].absStart = 0;
51773 -       mb_array[0].absEnd = 0x100000000;
51774 +       mb_array[0].absEnd = 0x100000000UL;
51775  
51776         if (holeSize) {
51777                 numMemoryBlocks = 2;
51778 -               holeStart = holeStart & 0x000fffffffffffff;
51779 +               holeStart = holeStart & 0x000fffffffffffffUL;
51780                 holeStart = addr_to_chunk(holeStart);
51781                 holeFirstChunk = holeStart;
51782                 holeSize = addr_to_chunk(holeSize);
51783 @@ -128,9 +124,9 @@ static unsigned long iSeries_process_Con
51784                 mb_array[0].logicalEnd = holeFirstChunk;
51785                 mb_array[0].absEnd = holeFirstChunk;
51786                 mb_array[1].logicalStart = holeFirstChunk;
51787 -               mb_array[1].logicalEnd = 0x100000000 - holeSizeChunks;
51788 +               mb_array[1].logicalEnd = 0x100000000UL - holeSizeChunks;
51789                 mb_array[1].absStart = holeFirstChunk + holeSizeChunks;
51790 -               mb_array[1].absEnd = 0x100000000;
51791 +               mb_array[1].absEnd = 0x100000000UL;
51792         }
51793         return numMemoryBlocks;
51794  }
51795 @@ -234,9 +230,9 @@ static unsigned long iSeries_process_Reg
51796                                 mb_array[i].logicalEnd,
51797                                 mb_array[i].absStart, mb_array[i].absEnd);
51798                 mb_array[i].absStart = addr_to_chunk(mb_array[i].absStart &
51799 -                               0x000fffffffffffff);
51800 +                               0x000fffffffffffffUL);
51801                 mb_array[i].absEnd = addr_to_chunk(mb_array[i].absEnd &
51802 -                               0x000fffffffffffff);
51803 +                               0x000fffffffffffffUL);
51804                 mb_array[i].logicalStart =
51805                         addr_to_chunk(mb_array[i].logicalStart);
51806                 mb_array[i].logicalEnd = addr_to_chunk(mb_array[i].logicalEnd);
51807 @@ -320,7 +316,7 @@ struct mschunks_map mschunks_map = {
51808  };
51809  EXPORT_SYMBOL(mschunks_map);
51810  
51811 -void mschunks_alloc(unsigned long num_chunks)
51812 +static void mschunks_alloc(unsigned long num_chunks)
51813  {
51814         klimit = _ALIGN(klimit, sizeof(u32));
51815         mschunks_map.mapping = (u32 *)klimit;
51816 @@ -499,6 +495,8 @@ static void __init iSeries_setup_arch(vo
51817                         itVpdAreas.xSlicMaxLogicalProcs);
51818         printk("Max physical processors = %d\n",
51819                         itVpdAreas.xSlicMaxPhysicalProcs);
51820 +
51821 +       iSeries_pcibios_init();
51822  }
51823  
51824  static void iSeries_show_cpuinfo(struct seq_file *m)
51825 @@ -641,24 +639,25 @@ static int __init iseries_probe(void)
51826  }
51827  
51828  define_machine(iseries) {
51829 -       .name           = "iSeries",
51830 -       .setup_arch     = iSeries_setup_arch,
51831 -       .show_cpuinfo   = iSeries_show_cpuinfo,
51832 -       .init_IRQ       = iSeries_init_IRQ,
51833 -       .get_irq        = iSeries_get_irq,
51834 -       .init_early     = iSeries_init_early,
51835 -       .pcibios_fixup  = iSeries_pci_final_fixup,
51836 -       .restart        = mf_reboot,
51837 -       .power_off      = mf_power_off,
51838 -       .halt           = mf_power_off,
51839 -       .get_boot_time  = iSeries_get_boot_time,
51840 -       .set_rtc_time   = iSeries_set_rtc_time,
51841 -       .get_rtc_time   = iSeries_get_rtc_time,
51842 -       .calibrate_decr = generic_calibrate_decr,
51843 -       .progress       = iSeries_progress,
51844 -       .probe          = iseries_probe,
51845 -       .ioremap        = iseries_ioremap,
51846 -       .iounmap        = iseries_iounmap,
51847 +       .name                   = "iSeries",
51848 +       .setup_arch             = iSeries_setup_arch,
51849 +       .show_cpuinfo           = iSeries_show_cpuinfo,
51850 +       .init_IRQ               = iSeries_init_IRQ,
51851 +       .get_irq                = iSeries_get_irq,
51852 +       .init_early             = iSeries_init_early,
51853 +       .pcibios_fixup          = iSeries_pci_final_fixup,
51854 +       .pcibios_fixup_resources= iSeries_pcibios_fixup_resources,
51855 +       .restart                = mf_reboot,
51856 +       .power_off              = mf_power_off,
51857 +       .halt                   = mf_power_off,
51858 +       .get_boot_time          = iSeries_get_boot_time,
51859 +       .set_rtc_time           = iSeries_set_rtc_time,
51860 +       .get_rtc_time           = iSeries_get_rtc_time,
51861 +       .calibrate_decr         = generic_calibrate_decr,
51862 +       .progress               = iSeries_progress,
51863 +       .probe                  = iseries_probe,
51864 +       .ioremap                = iseries_ioremap,
51865 +       .iounmap                = iseries_iounmap,
51866         /* XXX Implement enable_pmcs for iSeries */
51867  };
51868  
51869 Index: linux-2.6.24.7/arch/powerpc/platforms/iseries/setup.h
51870 ===================================================================
51871 --- linux-2.6.24.7.orig/arch/powerpc/platforms/iseries/setup.h
51872 +++ linux-2.6.24.7/arch/powerpc/platforms/iseries/setup.h
51873 @@ -17,6 +17,7 @@
51874  #ifndef        __ISERIES_SETUP_H__
51875  #define        __ISERIES_SETUP_H__
51876  
51877 +extern void *iSeries_early_setup(void);
51878  extern unsigned long iSeries_get_boot_time(void);
51879  extern int iSeries_set_rtc_time(struct rtc_time *tm);
51880  extern void iSeries_get_rtc_time(struct rtc_time *tm);
51881 Index: linux-2.6.24.7/arch/powerpc/platforms/iseries/vpdinfo.c
51882 ===================================================================
51883 --- linux-2.6.24.7.orig/arch/powerpc/platforms/iseries/vpdinfo.c
51884 +++ /dev/null
51885 @@ -1,275 +0,0 @@
51886 -/*
51887 - * This code gets the card location of the hardware
51888 - * Copyright (C) 2001  <Allan H Trautman> <IBM Corp>
51889 - * Copyright (C) 2005  Stephen Rothwel, IBM Corp
51890 - *
51891 - * This program is free software; you can redistribute it and/or modify
51892 - * it under the terms of the GNU General Public License as published by
51893 - * the Free Software Foundation; either version 2 of the License, or
51894 - * (at your option) any later version.
51895 - *
51896 - * This program is distributed in the hope that it will be useful,
51897 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
51898 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
51899 - * GNU General Public License for more details.
51900 - *
51901 - * You should have received a copy of the GNU General Public License
51902 - * along with this program; if not, write to the:
51903 - * Free Software Foundation, Inc.,
51904 - * 59 Temple Place, Suite 330,
51905 - * Boston, MA  02111-1307  USA
51906 - *
51907 - * Change Activity:
51908 - *   Created, Feb 2, 2001
51909 - *   Ported to ppc64, August 20, 2001
51910 - * End Change Activity
51911 - */
51912 -#include <linux/init.h>
51913 -#include <linux/module.h>
51914 -#include <linux/pci.h>
51915 -
51916 -#include <asm/types.h>
51917 -#include <asm/resource.h>
51918 -#include <asm/abs_addr.h>
51919 -#include <asm/pci-bridge.h>
51920 -#include <asm/iseries/hv_types.h>
51921 -
51922 -#include "pci.h"
51923 -#include "call_pci.h"
51924 -
51925 -/*
51926 - * Size of Bus VPD data
51927 - */
51928 -#define BUS_VPDSIZE      1024
51929 -
51930 -/*
51931 - * Bus Vpd Tags
51932 - */
51933 -#define  VpdEndOfAreaTag   0x79
51934 -#define  VpdIdStringTag    0x82
51935 -#define  VpdVendorAreaTag  0x84
51936 -
51937 -/*
51938 - * Mfg Area Tags
51939 - */
51940 -#define  VpdFruFrameId    0x4649     // "FI"
51941 -#define  VpdSlotMapFormat 0x4D46     // "MF"
51942 -#define  VpdSlotMap       0x534D     // "SM"
51943 -
51944 -/*
51945 - * Structures of the areas
51946 - */
51947 -struct MfgVpdAreaStruct {
51948 -       u16 Tag;
51949 -       u8  TagLength;
51950 -       u8  AreaData1;
51951 -       u8  AreaData2;
51952 -};
51953 -typedef struct MfgVpdAreaStruct MfgArea;
51954 -#define MFG_ENTRY_SIZE   3
51955 -
51956 -struct SlotMapStruct {
51957 -       u8   AgentId;
51958 -       u8   SecondaryAgentId;
51959 -       u8   PhbId;
51960 -       char CardLocation[3];
51961 -       char Parms[8];
51962 -       char Reserved[2];
51963 -};
51964 -typedef struct SlotMapStruct SlotMap;
51965 -#define SLOT_ENTRY_SIZE   16
51966 -
51967 -/*
51968 - * Parse the Slot Area
51969 - */
51970 -static void __init iSeries_Parse_SlotArea(SlotMap *MapPtr, int MapLen,
51971 -               HvAgentId agent, u8 *PhbId, char card[4])
51972 -{
51973 -       int SlotMapLen = MapLen;
51974 -       SlotMap *SlotMapPtr = MapPtr;
51975 -
51976 -       /*
51977 -        * Parse Slot label until we find the one requested
51978 -        */
51979 -       while (SlotMapLen > 0) {
51980 -               if (SlotMapPtr->AgentId == agent) {
51981 -                       /*
51982 -                        * If Phb wasn't found, grab the entry first one found.
51983 -                        */
51984 -                       if (*PhbId == 0xff)
51985 -                               *PhbId = SlotMapPtr->PhbId;
51986 -                       /* Found it, extract the data. */
51987 -                       if (SlotMapPtr->PhbId == *PhbId) {
51988 -                               memcpy(card, &SlotMapPtr->CardLocation, 3);
51989 -                               card[3]  = 0;
51990 -                               break;
51991 -                       }
51992 -               }
51993 -               /* Point to the next Slot */
51994 -               SlotMapPtr = (SlotMap *)((char *)SlotMapPtr + SLOT_ENTRY_SIZE);
51995 -               SlotMapLen -= SLOT_ENTRY_SIZE;
51996 -       }
51997 -}
51998 -
51999 -/*
52000 - * Parse the Mfg Area
52001 - */
52002 -static void __init iSeries_Parse_MfgArea(u8 *AreaData, int AreaLen,
52003 -               HvAgentId agent, u8 *PhbId,
52004 -               u8 *frame, char card[4])
52005 -{
52006 -       MfgArea *MfgAreaPtr = (MfgArea *)AreaData;
52007 -       int MfgAreaLen = AreaLen;
52008 -       u16 SlotMapFmt = 0;
52009 -
52010 -       /* Parse Mfg Data */
52011 -       while (MfgAreaLen > 0) {
52012 -               int MfgTagLen = MfgAreaPtr->TagLength;
52013 -               /* Frame ID         (FI 4649020310 ) */
52014 -               if (MfgAreaPtr->Tag == VpdFruFrameId)           /* FI  */
52015 -                       *frame = MfgAreaPtr->AreaData1;
52016 -               /* Slot Map Format  (MF 4D46020004 ) */
52017 -               else if (MfgAreaPtr->Tag == VpdSlotMapFormat)   /* MF  */
52018 -                       SlotMapFmt = (MfgAreaPtr->AreaData1 * 256)
52019 -                               + MfgAreaPtr->AreaData2;
52020 -               /* Slot Map         (SM 534D90 */
52021 -               else if (MfgAreaPtr->Tag == VpdSlotMap) {       /* SM  */
52022 -                       SlotMap *SlotMapPtr;
52023 -
52024 -                       if (SlotMapFmt == 0x1004)
52025 -                               SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr
52026 -                                               + MFG_ENTRY_SIZE + 1);
52027 -                       else
52028 -                               SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr
52029 -                                               + MFG_ENTRY_SIZE);
52030 -                       iSeries_Parse_SlotArea(SlotMapPtr, MfgTagLen,
52031 -                                       agent, PhbId, card);
52032 -               }
52033 -               /*
52034 -                * Point to the next Mfg Area
52035 -                * Use defined size, sizeof give wrong answer
52036 -                */
52037 -               MfgAreaPtr = (MfgArea *)((char *)MfgAreaPtr + MfgTagLen
52038 -                               + MFG_ENTRY_SIZE);
52039 -               MfgAreaLen -= (MfgTagLen + MFG_ENTRY_SIZE);
52040 -       }
52041 -}
52042 -
52043 -/*
52044 - * Look for "BUS".. Data is not Null terminated.
52045 - * PHBID of 0xFF indicates PHB was not found in VPD Data.
52046 - */
52047 -static int __init iSeries_Parse_PhbId(u8 *AreaPtr, int AreaLength)
52048 -{
52049 -       u8 *PhbPtr = AreaPtr;
52050 -       int DataLen = AreaLength;
52051 -       char PhbId = 0xFF;
52052 -
52053 -       while (DataLen > 0) {
52054 -               if ((*PhbPtr == 'B') && (*(PhbPtr + 1) == 'U')
52055 -                               && (*(PhbPtr + 2) == 'S')) {
52056 -                       PhbPtr += 3;
52057 -                       while (*PhbPtr == ' ')
52058 -                               ++PhbPtr;
52059 -                       PhbId = (*PhbPtr & 0x0F);
52060 -                       break;
52061 -               }
52062 -               ++PhbPtr;
52063 -               --DataLen;
52064 -       }
52065 -       return PhbId;
52066 -}
52067 -
52068 -/*
52069 - * Parse out the VPD Areas
52070 - */
52071 -static void __init iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen,
52072 -               HvAgentId agent, u8 *frame, char card[4])
52073 -{
52074 -       u8 *TagPtr = VpdData;
52075 -       int DataLen = VpdDataLen - 3;
52076 -       u8 PhbId = 0xff;
52077 -
52078 -       while ((*TagPtr != VpdEndOfAreaTag) && (DataLen > 0)) {
52079 -               int AreaLen = *(TagPtr + 1) + (*(TagPtr + 2) * 256);
52080 -               u8 *AreaData  = TagPtr + 3;
52081 -
52082 -               if (*TagPtr == VpdIdStringTag)
52083 -                       PhbId = iSeries_Parse_PhbId(AreaData, AreaLen);
52084 -               else if (*TagPtr == VpdVendorAreaTag)
52085 -                       iSeries_Parse_MfgArea(AreaData, AreaLen,
52086 -                                       agent, &PhbId, frame, card);
52087 -               /* Point to next Area. */
52088 -               TagPtr  = AreaData + AreaLen;
52089 -               DataLen -= AreaLen;
52090 -       }
52091 -}
52092 -
52093 -static int __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
52094 -               u8 *frame, char card[4])
52095 -{
52096 -       int status = 0;
52097 -       int BusVpdLen = 0;
52098 -       u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL);
52099 -
52100 -       if (BusVpdPtr == NULL) {
52101 -               printk("PCI: Bus VPD Buffer allocation failure.\n");
52102 -               return 0;
52103 -       }
52104 -       BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr),
52105 -                                       BUS_VPDSIZE);
52106 -       if (BusVpdLen == 0) {
52107 -               printk("PCI: Bus VPD Buffer zero length.\n");
52108 -               goto out_free;
52109 -       }
52110 -       /* printk("PCI: BusVpdPtr: %p, %d\n",BusVpdPtr, BusVpdLen); */
52111 -       /* Make sure this is what I think it is */
52112 -       if (*BusVpdPtr != VpdIdStringTag) {     /* 0x82 */
52113 -               printk("PCI: Bus VPD Buffer missing starting tag.\n");
52114 -               goto out_free;
52115 -       }
52116 -       iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card);
52117 -       status = 1;
52118 -out_free:
52119 -       kfree(BusVpdPtr);
52120 -       return status;
52121 -}
52122 -
52123 -/*
52124 - * Prints the device information.
52125 - * - Pass in pci_dev* pointer to the device.
52126 - * - Pass in the device count
52127 - *
52128 - * Format:
52129 - * PCI: Bus  0, Device 26, Vendor 0x12AE  Frame  1, Card  C10  Ethernet
52130 - * controller
52131 - */
52132 -void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
52133 -{
52134 -       struct device_node *DevNode = PciDev->sysdata;
52135 -       struct pci_dn *pdn;
52136 -       u16 bus;
52137 -       u8 frame = 0;
52138 -       char card[4];
52139 -       HvSubBusNumber subbus;
52140 -       HvAgentId agent;
52141 -
52142 -       if (DevNode == NULL) {
52143 -               printk("%d. PCI: iSeries_Device_Information DevNode is NULL\n",
52144 -                               count);
52145 -               return;
52146 -       }
52147 -
52148 -       pdn = PCI_DN(DevNode);
52149 -       bus = pdn->busno;
52150 -       subbus = pdn->bussubno;
52151 -       agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
52152 -                       ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
52153 -
52154 -       if (iSeries_Get_Location_Code(bus, agent, &frame, card)) {
52155 -               printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, "
52156 -                       "Card %4s  0x%04X\n", count, bus,
52157 -                       PCI_SLOT(PciDev->devfn), PciDev->vendor, frame,
52158 -                       card, (int)(PciDev->class >> 8));
52159 -       }
52160 -}
52161 Index: linux-2.6.24.7/arch/powerpc/platforms/maple/Kconfig
52162 ===================================================================
52163 --- linux-2.6.24.7.orig/arch/powerpc/platforms/maple/Kconfig
52164 +++ linux-2.6.24.7/arch/powerpc/platforms/maple/Kconfig
52165 @@ -1,6 +1,7 @@
52166  config PPC_MAPLE
52167         depends on PPC_MULTIPLATFORM && PPC64
52168         bool "Maple 970FX Evaluation Board"
52169 +       select PCI
52170         select MPIC
52171         select U3_DART
52172         select MPIC_U3_HT_IRQS
52173 Index: linux-2.6.24.7/arch/powerpc/platforms/maple/pci.c
52174 ===================================================================
52175 --- linux-2.6.24.7.orig/arch/powerpc/platforms/maple/pci.c
52176 +++ linux-2.6.24.7/arch/powerpc/platforms/maple/pci.c
52177 @@ -558,7 +558,7 @@ void __init maple_pci_init(void)
52178          * safe assumptions hopefully.
52179          */
52180         if (u3_agp) {
52181 -               struct device_node *np = u3_agp->arch_data;
52182 +               struct device_node *np = u3_agp->dn;
52183                 PCI_DN(np)->busno = 0xf0;
52184                 for (np = np->child; np; np = np->sibling)
52185                         PCI_DN(np)->busno = 0xf0;
52186 Index: linux-2.6.24.7/arch/powerpc/platforms/maple/setup.c
52187 ===================================================================
52188 --- linux-2.6.24.7.orig/arch/powerpc/platforms/maple/setup.c
52189 +++ linux-2.6.24.7/arch/powerpc/platforms/maple/setup.c
52190 @@ -42,6 +42,7 @@
52191  #include <linux/serial.h>
52192  #include <linux/smp.h>
52193  #include <linux/bitops.h>
52194 +#include <linux/of_device.h>
52195  
52196  #include <asm/processor.h>
52197  #include <asm/sections.h>
52198 @@ -56,7 +57,6 @@
52199  #include <asm/dma.h>
52200  #include <asm/cputable.h>
52201  #include <asm/time.h>
52202 -#include <asm/of_device.h>
52203  #include <asm/lmb.h>
52204  #include <asm/mpic.h>
52205  #include <asm/rtas.h>
52206 Index: linux-2.6.24.7/arch/powerpc/platforms/pasemi/Kconfig
52207 ===================================================================
52208 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pasemi/Kconfig
52209 +++ linux-2.6.24.7/arch/powerpc/platforms/pasemi/Kconfig
52210 @@ -3,6 +3,7 @@ config PPC_PASEMI
52211         bool "PA Semi SoC-based platforms"
52212         default n
52213         select MPIC
52214 +       select PCI
52215         select PPC_UDBG_16550
52216         select PPC_NATIVE
52217         select MPIC_BROKEN_REGREAD
52218 @@ -17,7 +18,7 @@ config PPC_PASEMI_IOMMU
52219         bool "PA Semi IOMMU support"
52220         depends on PPC_PASEMI
52221         help
52222 -         IOMMU support for PA6T-1682M
52223 +         IOMMU support for PA Semi PWRficient
52224  
52225  config PPC_PASEMI_IOMMU_DMA_FORCE
52226         bool "Force DMA engine to use IOMMU"
52227 @@ -36,13 +37,4 @@ config PPC_PASEMI_MDIO
52228         help
52229           Driver for MDIO via GPIO on PWRficient platforms
52230  
52231 -config ELECTRA_IDE
52232 -      tristate "Electra IDE driver"
52233 -      default y
52234 -      depends on PPC_PASEMI && ATA
52235 -      select PATA_PLATFORM
52236 -      help
52237 -       This includes driver support for the Electra on-board IDE
52238 -       interface.
52239 -
52240  endmenu
52241 Index: linux-2.6.24.7/arch/powerpc/platforms/pasemi/Makefile
52242 ===================================================================
52243 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pasemi/Makefile
52244 +++ linux-2.6.24.7/arch/powerpc/platforms/pasemi/Makefile
52245 @@ -1,4 +1,3 @@
52246  obj-y  += setup.o pci.o time.o idle.o powersave.o iommu.o
52247  obj-$(CONFIG_PPC_PASEMI_MDIO)  += gpio_mdio.o
52248 -obj-$(CONFIG_ELECTRA_IDE) += electra_ide.o
52249  obj-$(CONFIG_PPC_PASEMI_CPUFREQ) += cpufreq.o
52250 Index: linux-2.6.24.7/arch/powerpc/platforms/pasemi/cpufreq.c
52251 ===================================================================
52252 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pasemi/cpufreq.c
52253 +++ linux-2.6.24.7/arch/powerpc/platforms/pasemi/cpufreq.c
52254 @@ -32,6 +32,7 @@
52255  #include <asm/io.h>
52256  #include <asm/prom.h>
52257  #include <asm/time.h>
52258 +#include <asm/smp.h>
52259  
52260  #define SDCASR_REG             0x0100
52261  #define SDCASR_REG_STRIDE      0x1000
52262 @@ -124,6 +125,11 @@ static void set_astate(int cpu, unsigned
52263         local_irq_restore(flags);
52264  }
52265  
52266 +int check_astate(void)
52267 +{
52268 +       return get_cur_astate(hard_smp_processor_id());
52269 +}
52270 +
52271  void restore_astate(int cpu)
52272  {
52273         set_astate(cpu, current_astate);
52274 @@ -147,7 +153,10 @@ static int pas_cpufreq_cpu_init(struct c
52275         if (!cpu)
52276                 goto out;
52277  
52278 -       dn = of_find_compatible_node(NULL, "sdc", "1682m-sdc");
52279 +       dn = of_find_compatible_node(NULL, NULL, "1682m-sdc");
52280 +       if (!dn)
52281 +               dn = of_find_compatible_node(NULL, NULL,
52282 +                                            "pasemi,pwrficient-sdc");
52283         if (!dn)
52284                 goto out;
52285         err = of_address_to_resource(dn, 0, &res);
52286 @@ -160,7 +169,10 @@ static int pas_cpufreq_cpu_init(struct c
52287                 goto out;
52288         }
52289  
52290 -       dn = of_find_compatible_node(NULL, "gizmo", "1682m-gizmo");
52291 +       dn = of_find_compatible_node(NULL, NULL, "1682m-gizmo");
52292 +       if (!dn)
52293 +               dn = of_find_compatible_node(NULL, NULL,
52294 +                                            "pasemi,pwrficient-gizmo");
52295         if (!dn) {
52296                 err = -ENODEV;
52297                 goto out_unmap_sdcasr;
52298 @@ -292,7 +304,8 @@ static struct cpufreq_driver pas_cpufreq
52299  
52300  static int __init pas_cpufreq_init(void)
52301  {
52302 -       if (!machine_is_compatible("PA6T-1682M"))
52303 +       if (!machine_is_compatible("PA6T-1682M") &&
52304 +           !machine_is_compatible("pasemi,pwrficient"))
52305                 return -ENODEV;
52306  
52307         return cpufreq_register_driver(&pas_cpufreq_driver);
52308 Index: linux-2.6.24.7/arch/powerpc/platforms/pasemi/electra_ide.c
52309 ===================================================================
52310 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pasemi/electra_ide.c
52311 +++ /dev/null
52312 @@ -1,96 +0,0 @@
52313 -/*
52314 - * Copyright (C) 2007 PA Semi, Inc
52315 - *
52316 - * Maintained by: Olof Johansson <olof@lixom.net>
52317 - *
52318 - * This program is free software; you can redistribute it and/or modify
52319 - * it under the terms of the GNU General Public License version 2 as
52320 - * published by the Free Software Foundation.
52321 - *
52322 - * This program is distributed in the hope that it will be useful,
52323 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
52324 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
52325 - * GNU General Public License for more details.
52326 - *
52327 - * You should have received a copy of the GNU General Public License
52328 - * along with this program; if not, write to the Free Software
52329 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
52330 - */
52331 -
52332 -#include <linux/platform_device.h>
52333 -
52334 -#include <asm/prom.h>
52335 -#include <asm/system.h>
52336 -
52337 -/* The electra IDE interface is incredibly simple: Just a device on the localbus
52338 - * with interrupts hooked up to one of the GPIOs. The device tree contains the
52339 - * address window and interrupt mappings already, and the pata_platform driver handles
52340 - * the rest. We just need to hook the two up.
52341 - */
52342 -
52343 -#define MAX_IFS        4       /* really, we have only one */
52344 -
52345 -static struct platform_device *pdevs[MAX_IFS];
52346 -
52347 -static int __devinit electra_ide_init(void)
52348 -{
52349 -       struct device_node *np;
52350 -       struct resource r[3];
52351 -       int ret = 0;
52352 -       int i;
52353 -
52354 -       np = of_find_compatible_node(NULL, "ide", "electra-ide");
52355 -       i = 0;
52356 -
52357 -       while (np && i < MAX_IFS) {
52358 -               memset(r, 0, sizeof(r));
52359 -
52360 -               /* pata_platform wants two address ranges: one for the base registers,
52361 -                * another for the control (altstatus). It's located at offset 0x3f6 in
52362 -                * the window, but the device tree only has one large register window
52363 -                * that covers both ranges. So we need to split it up by hand here:
52364 -                */
52365 -
52366 -               ret = of_address_to_resource(np, 0, &r[0]);
52367 -               if (ret)
52368 -                       goto out;
52369 -               ret = of_address_to_resource(np, 0, &r[1]);
52370 -               if (ret)
52371 -                       goto out;
52372 -
52373 -               r[1].start += 0x3f6;
52374 -               r[0].end = r[1].start-1;
52375 -
52376 -               r[2].start = irq_of_parse_and_map(np, 0);
52377 -               r[2].end = irq_of_parse_and_map(np, 0);
52378 -               r[2].flags = IORESOURCE_IRQ;
52379 -
52380 -               pr_debug("registering platform device at 0x%lx/0x%lx, irq is %ld\n",
52381 -                        r[0].start, r[1].start, r[2].start);
52382 -               pdevs[i] = platform_device_register_simple("pata_platform", i, r, 3);
52383 -               if (IS_ERR(pdevs[i])) {
52384 -                       ret = PTR_ERR(pdevs[i]);
52385 -                       pdevs[i] = NULL;
52386 -                       goto out;
52387 -               }
52388 -               np = of_find_compatible_node(np, "ide", "electra-ide");
52389 -       }
52390 -out:
52391 -       return ret;
52392 -}
52393 -module_init(electra_ide_init);
52394 -
52395 -static void __devexit electra_ide_exit(void)
52396 -{
52397 -       int i;
52398 -
52399 -       for (i = 0; i < MAX_IFS; i++)
52400 -               if (pdevs[i])
52401 -                       platform_device_unregister(pdevs[i]);
52402 -}
52403 -module_exit(electra_ide_exit);
52404 -
52405 -
52406 -MODULE_LICENSE("GPL");
52407 -MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
52408 -MODULE_DESCRIPTION("PA Semi Electra IDE driver");
52409 Index: linux-2.6.24.7/arch/powerpc/platforms/pasemi/gpio_mdio.c
52410 ===================================================================
52411 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pasemi/gpio_mdio.c
52412 +++ linux-2.6.24.7/arch/powerpc/platforms/pasemi/gpio_mdio.c
52413 @@ -30,7 +30,7 @@
52414  #include <linux/interrupt.h>
52415  #include <linux/phy.h>
52416  #include <linux/platform_device.h>
52417 -#include <asm/of_platform.h>
52418 +#include <linux/of_platform.h>
52419  
52420  #define DELAY 1
52421  
52422 @@ -218,45 +218,27 @@ static int __devinit gpio_mdio_probe(str
52423                                      const struct of_device_id *match)
52424  {
52425         struct device *dev = &ofdev->dev;
52426 -       struct device_node *np = ofdev->node;
52427 -       struct device_node *gpio_np;
52428 +       struct device_node *phy_dn, *np = ofdev->node;
52429         struct mii_bus *new_bus;
52430 -       struct resource res;
52431         struct gpio_priv *priv;
52432         const unsigned int *prop;
52433 -       int err = 0;
52434 +       int err;
52435         int i;
52436  
52437 -       gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
52438 -
52439 -       if (!gpio_np)
52440 -               return -ENODEV;
52441 -
52442 -       err = of_address_to_resource(gpio_np, 0, &res);
52443 -       of_node_put(gpio_np);
52444 -
52445 -       if (err)
52446 -               return -EINVAL;
52447 -
52448 -       if (!gpio_regs)
52449 -               gpio_regs = ioremap(res.start, 0x100);
52450 -
52451 -       if (!gpio_regs)
52452 -               return -EPERM;
52453 -
52454 +       err = -ENOMEM;
52455         priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
52456 -       if (priv == NULL)
52457 -               return -ENOMEM;
52458 +       if (!priv)
52459 +               goto out;
52460  
52461         new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
52462  
52463 -       if (new_bus == NULL)
52464 -               return -ENOMEM;
52465 +       if (!new_bus)
52466 +               goto out_free_priv;
52467  
52468 -       new_bus->name = "pasemi gpio mdio bus",
52469 -       new_bus->read = &gpio_mdio_read,
52470 -       new_bus->write = &gpio_mdio_write,
52471 -       new_bus->reset = &gpio_mdio_reset,
52472 +       new_bus->name = "pasemi gpio mdio bus";
52473 +       new_bus->read = &gpio_mdio_read;
52474 +       new_bus->write = &gpio_mdio_write;
52475 +       new_bus->reset = &gpio_mdio_reset;
52476  
52477         prop = of_get_property(np, "reg", NULL);
52478         new_bus->id = *prop;
52479 @@ -265,9 +247,24 @@ static int __devinit gpio_mdio_probe(str
52480         new_bus->phy_mask = 0;
52481  
52482         new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
52483 -       for(i = 0; i < PHY_MAX_ADDR; ++i)
52484 -               new_bus->irq[i] = irq_create_mapping(NULL, 10);
52485  
52486 +       if (!new_bus->irq)
52487 +               goto out_free_bus;
52488 +
52489 +       for (i = 0; i < PHY_MAX_ADDR; i++)
52490 +               new_bus->irq[i] = NO_IRQ;
52491 +
52492 +       for (phy_dn = of_get_next_child(np, NULL);
52493 +            phy_dn != NULL;
52494 +            phy_dn = of_get_next_child(np, phy_dn)) {
52495 +               const unsigned int *ip, *regp;
52496 +
52497 +               ip = of_get_property(phy_dn, "interrupts", NULL);
52498 +               regp = of_get_property(phy_dn, "reg", NULL);
52499 +               if (!ip || !regp || *regp >= PHY_MAX_ADDR)
52500 +                       continue;
52501 +               new_bus->irq[*regp] = irq_create_mapping(NULL, *ip);
52502 +       }
52503  
52504         prop = of_get_property(np, "mdc-pin", NULL);
52505         priv->mdc_pin = *prop;
52506 @@ -280,17 +277,21 @@ static int __devinit gpio_mdio_probe(str
52507  
52508         err = mdiobus_register(new_bus);
52509  
52510 -       if (0 != err) {
52511 +       if (err != 0) {
52512                 printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n",
52513                                 new_bus->name, err);
52514 -               goto bus_register_fail;
52515 +               goto out_free_irq;
52516         }
52517  
52518         return 0;
52519  
52520 -bus_register_fail:
52521 +out_free_irq:
52522 +       kfree(new_bus->irq);
52523 +out_free_bus:
52524         kfree(new_bus);
52525 -
52526 +out_free_priv:
52527 +       kfree(priv);
52528 +out:
52529         return err;
52530  }
52531  
52532 @@ -317,6 +318,7 @@ static struct of_device_id gpio_mdio_mat
52533         },
52534         {},
52535  };
52536 +MODULE_DEVICE_TABLE(of, gpio_mdio_match);
52537  
52538  static struct of_platform_driver gpio_mdio_driver =
52539  {
52540 @@ -330,12 +332,32 @@ static struct of_platform_driver gpio_md
52541  
52542  int gpio_mdio_init(void)
52543  {
52544 +       struct device_node *np;
52545 +
52546 +       np = of_find_compatible_node(NULL, NULL, "1682m-gpio");
52547 +       if (!np)
52548 +               np = of_find_compatible_node(NULL, NULL,
52549 +                                            "pasemi,pwrficient-gpio");
52550 +       if (!np)
52551 +               return -ENODEV;
52552 +       gpio_regs = of_iomap(np, 0);
52553 +       of_node_put(np);
52554 +
52555 +       if (!gpio_regs)
52556 +               return -ENODEV;
52557 +
52558         return of_register_platform_driver(&gpio_mdio_driver);
52559  }
52560 +module_init(gpio_mdio_init);
52561  
52562  void gpio_mdio_exit(void)
52563  {
52564         of_unregister_platform_driver(&gpio_mdio_driver);
52565 +       if (gpio_regs)
52566 +               iounmap(gpio_regs);
52567  }
52568 -device_initcall(gpio_mdio_init);
52569 +module_exit(gpio_mdio_exit);
52570  
52571 +MODULE_LICENSE("GPL");
52572 +MODULE_AUTHOR("Olof Johansson <olof@lixom.net>");
52573 +MODULE_DESCRIPTION("Driver for MDIO over GPIO on PA Semi PWRficient-based boards");
52574 Index: linux-2.6.24.7/arch/powerpc/platforms/pasemi/idle.c
52575 ===================================================================
52576 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pasemi/idle.c
52577 +++ linux-2.6.24.7/arch/powerpc/platforms/pasemi/idle.c
52578 @@ -74,9 +74,6 @@ static int pasemi_system_reset_exception
52579  
52580  static int __init pasemi_idle_init(void)
52581  {
52582 -       if (!machine_is(pasemi))
52583 -               return -ENODEV;
52584 -
52585  #ifndef CONFIG_PPC_PASEMI_CPUFREQ
52586         printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n");
52587         current_mode = 0;
52588 @@ -88,7 +85,7 @@ static int __init pasemi_idle_init(void)
52589  
52590         return 0;
52591  }
52592 -late_initcall(pasemi_idle_init);
52593 +machine_late_initcall(pasemi, pasemi_idle_init);
52594  
52595  static int __init idle_param(char *p)
52596  {
52597 Index: linux-2.6.24.7/arch/powerpc/platforms/pasemi/pasemi.h
52598 ===================================================================
52599 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pasemi/pasemi.h
52600 +++ linux-2.6.24.7/arch/powerpc/platforms/pasemi/pasemi.h
52601 @@ -16,8 +16,14 @@ extern void idle_doze(void);
52602  
52603  /* Restore astate to last set */
52604  #ifdef CONFIG_PPC_PASEMI_CPUFREQ
52605 +extern int check_astate(void);
52606  extern void restore_astate(int cpu);
52607  #else
52608 +static inline int check_astate(void)
52609 +{
52610 +       /* Always return >0 so we never power save */
52611 +       return 1;
52612 +}
52613  static inline void restore_astate(int cpu)
52614  {
52615  }
52616 Index: linux-2.6.24.7/arch/powerpc/platforms/pasemi/powersave.S
52617 ===================================================================
52618 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pasemi/powersave.S
52619 +++ linux-2.6.24.7/arch/powerpc/platforms/pasemi/powersave.S
52620 @@ -62,7 +62,16 @@ sleep_common:
52621         mflr    r0
52622         std     r0, 16(r1)
52623         stdu    r1,-64(r1)
52624 +#ifdef CONFIG_PPC_PASEMI_CPUFREQ
52625 +       std     r3, 48(r1)
52626  
52627 +       /* Only do power savings when in astate 0 */
52628 +       bl      .check_astate
52629 +       cmpwi   r3,0
52630 +       bne     1f
52631 +
52632 +       ld      r3, 48(r1)
52633 +#endif
52634         LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE)
52635         mfmsr   r4
52636         andc    r5,r4,r6
52637 @@ -73,7 +82,7 @@ sleep_common:
52638  
52639         mtmsrd  r4,0
52640  
52641 -       addi    r1,r1,64
52642 +1:     addi    r1,r1,64
52643         ld      r0,16(r1)
52644         mtlr    r0
52645         blr
52646 Index: linux-2.6.24.7/arch/powerpc/platforms/pasemi/setup.c
52647 ===================================================================
52648 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pasemi/setup.c
52649 +++ linux-2.6.24.7/arch/powerpc/platforms/pasemi/setup.c
52650 @@ -27,6 +27,7 @@
52651  #include <linux/delay.h>
52652  #include <linux/console.h>
52653  #include <linux/pci.h>
52654 +#include <linux/of_platform.h>
52655  
52656  #include <asm/prom.h>
52657  #include <asm/system.h>
52658 @@ -35,7 +36,7 @@
52659  #include <asm/mpic.h>
52660  #include <asm/smp.h>
52661  #include <asm/time.h>
52662 -#include <asm/of_platform.h>
52663 +#include <asm/mmu.h>
52664  
52665  #include <pcmcia/ss.h>
52666  #include <pcmcia/cistpl.h>
52667 @@ -43,6 +44,10 @@
52668  
52669  #include "pasemi.h"
52670  
52671 +#if !defined(CONFIG_SMP)
52672 +static void smp_send_stop(void) {}
52673 +#endif
52674 +
52675  /* SDC reset register, must be pre-mapped at reset time */
52676  static void __iomem *reset_reg;
52677  
52678 @@ -56,10 +61,14 @@ struct mce_regs {
52679  
52680  static struct mce_regs mce_regs[MAX_MCE_REGS];
52681  static int num_mce_regs;
52682 +static int nmi_virq = NO_IRQ;
52683  
52684  
52685  static void pas_restart(char *cmd)
52686  {
52687 +       /* Need to put others cpu in hold loop so they're not sleeping */
52688 +       smp_send_stop();
52689 +       udelay(10000);
52690         printk("Restarting...\n");
52691         while (1)
52692                 out_le32(reset_reg, 0x6000000);
52693 @@ -126,9 +135,6 @@ static int __init pas_setup_mce_regs(voi
52694         struct pci_dev *dev;
52695         int reg;
52696  
52697 -       if (!machine_is(pasemi))
52698 -               return -ENODEV;
52699 -
52700         /* Remap various SoC status registers for use by the MCE handler */
52701  
52702         reg = 0;
52703 @@ -172,7 +178,7 @@ static int __init pas_setup_mce_regs(voi
52704  
52705         return 0;
52706  }
52707 -device_initcall(pas_setup_mce_regs);
52708 +machine_device_initcall(pasemi, pas_setup_mce_regs);
52709  
52710  static __init void pas_init_IRQ(void)
52711  {
52712 @@ -181,6 +187,8 @@ static __init void pas_init_IRQ(void)
52713         unsigned long openpic_addr;
52714         const unsigned int *opprop;
52715         int naddr, opplen;
52716 +       int mpic_flags;
52717 +       const unsigned int *nmiprop;
52718         struct mpic *mpic;
52719  
52720         mpic_node = NULL;
52721 @@ -213,13 +221,26 @@ static __init void pas_init_IRQ(void)
52722         openpic_addr = of_read_number(opprop, naddr);
52723         printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
52724  
52725 +       mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS | MPIC_NO_BIAS;
52726 +
52727 +       nmiprop = of_get_property(mpic_node, "nmi-source", NULL);
52728 +       if (nmiprop)
52729 +               mpic_flags |= MPIC_ENABLE_MCK;
52730 +
52731         mpic = mpic_alloc(mpic_node, openpic_addr,
52732 -                         MPIC_PRIMARY|MPIC_LARGE_VECTORS,
52733 -                         0, 0, " PAS-OPIC  ");
52734 +                         mpic_flags, 0, 0, "PASEMI-OPIC");
52735         BUG_ON(!mpic);
52736  
52737         mpic_assign_isu(mpic, 0, openpic_addr + 0x10000);
52738         mpic_init(mpic);
52739 +       /* The NMI/MCK source needs to be prio 15 */
52740 +       if (nmiprop) {
52741 +               nmi_virq = irq_create_mapping(NULL, *nmiprop);
52742 +               mpic_irq_set_priority(nmi_virq, 15);
52743 +               set_irq_type(nmi_virq, IRQ_TYPE_EDGE_RISING);
52744 +               mpic_unmask_irq(nmi_virq);
52745 +       }
52746 +
52747         of_node_put(mpic_node);
52748         of_node_put(root);
52749  }
52750 @@ -239,6 +260,14 @@ static int pas_machine_check_handler(str
52751  
52752         srr0 = regs->nip;
52753         srr1 = regs->msr;
52754 +
52755 +       if (nmi_virq != NO_IRQ && mpic_get_mcirq() == nmi_virq) {
52756 +               printk(KERN_ERR "NMI delivered\n");
52757 +               debugger(regs);
52758 +               mpic_end_irq(nmi_virq);
52759 +               goto out;
52760 +       }
52761 +
52762         dsisr = mfspr(SPRN_DSISR);
52763         printk(KERN_ERR "Machine Check on CPU %d\n", cpu);
52764         printk(KERN_ERR "SRR0  0x%016lx SRR1 0x%016lx\n", srr0, srr1);
52765 @@ -295,14 +324,14 @@ static int pas_machine_check_handler(str
52766                 int i;
52767  
52768                 printk(KERN_ERR "slb contents:\n");
52769 -               for (i = 0; i < SLB_NUM_ENTRIES; i++) {
52770 +               for (i = 0; i < mmu_slb_size; i++) {
52771                         asm volatile("slbmfee  %0,%1" : "=r" (e) : "r" (i));
52772                         asm volatile("slbmfev  %0,%1" : "=r" (v) : "r" (i));
52773                         printk(KERN_ERR "%02d %016lx %016lx\n", i, e, v);
52774                 }
52775         }
52776  
52777 -
52778 +out:
52779         /* SRR1[62] is from MSR[62] if recoverable, so pass that back */
52780         return !!(srr1 & 0x2);
52781  }
52782 @@ -362,16 +391,17 @@ static inline void pasemi_pcmcia_init(vo
52783  
52784  
52785  static struct of_device_id pasemi_bus_ids[] = {
52786 +       /* Unfortunately needed for legacy firmwares */
52787         { .type = "localbus", },
52788         { .type = "sdc", },
52789 +       /* These are the proper entries, which newer firmware uses */
52790 +       { .compatible = "pasemi,localbus", },
52791 +       { .compatible = "pasemi,sdc", },
52792         {},
52793  };
52794  
52795  static int __init pasemi_publish_devices(void)
52796  {
52797 -       if (!machine_is(pasemi))
52798 -               return 0;
52799 -
52800         pasemi_pcmcia_init();
52801  
52802         /* Publish OF platform devices for SDC and other non-PCI devices */
52803 @@ -379,7 +409,7 @@ static int __init pasemi_publish_devices
52804  
52805         return 0;
52806  }
52807 -device_initcall(pasemi_publish_devices);
52808 +machine_device_initcall(pasemi, pasemi_publish_devices);
52809  
52810  
52811  /*
52812 @@ -389,7 +419,8 @@ static int __init pas_probe(void)
52813  {
52814         unsigned long root = of_get_flat_dt_root();
52815  
52816 -       if (!of_flat_dt_is_compatible(root, "PA6T-1682M"))
52817 +       if (!of_flat_dt_is_compatible(root, "PA6T-1682M") &&
52818 +           !of_flat_dt_is_compatible(root, "pasemi,pwrficient"))
52819                 return 0;
52820  
52821         hpte_init_native();
52822 @@ -400,7 +431,7 @@ static int __init pas_probe(void)
52823  }
52824  
52825  define_machine(pasemi) {
52826 -       .name                   = "PA Semi PA6T-1682M",
52827 +       .name                   = "PA Semi PWRficient",
52828         .probe                  = pas_probe,
52829         .setup_arch             = pas_setup_arch,
52830         .init_early             = pas_init_early,
52831 Index: linux-2.6.24.7/arch/powerpc/platforms/powermac/low_i2c.c
52832 ===================================================================
52833 --- linux-2.6.24.7.orig/arch/powerpc/platforms/powermac/low_i2c.c
52834 +++ linux-2.6.24.7/arch/powerpc/platforms/powermac/low_i2c.c
52835 @@ -585,8 +585,7 @@ static void __init kw_i2c_probe(void)
52836         struct device_node *np, *child, *parent;
52837  
52838         /* Probe keywest-i2c busses */
52839 -       for (np = NULL;
52840 -            (np = of_find_compatible_node(np, "i2c","keywest-i2c")) != NULL;){
52841 +       for_each_compatible_node(np, "i2c","keywest-i2c") {
52842                 struct pmac_i2c_host_kw *host;
52843                 int multibus, chans, i;
52844  
52845 @@ -1462,9 +1461,6 @@ int __init pmac_i2c_init(void)
52846                 return 0;
52847         i2c_inited = 1;
52848  
52849 -       if (!machine_is(powermac))
52850 -               return 0;
52851 -
52852         /* Probe keywest-i2c busses */
52853         kw_i2c_probe();
52854  
52855 @@ -1483,7 +1479,7 @@ int __init pmac_i2c_init(void)
52856  
52857         return 0;
52858  }
52859 -arch_initcall(pmac_i2c_init);
52860 +machine_arch_initcall(powermac, pmac_i2c_init);
52861  
52862  /* Since pmac_i2c_init can be called too early for the platform device
52863   * registration, we need to do it at a later time. In our case, subsys
52864 @@ -1515,4 +1511,4 @@ static int __init pmac_i2c_create_platfo
52865  
52866         return 0;
52867  }
52868 -subsys_initcall(pmac_i2c_create_platform_devices);
52869 +machine_subsys_initcall(powermac, pmac_i2c_create_platform_devices);
52870 Index: linux-2.6.24.7/arch/powerpc/platforms/powermac/pci.c
52871 ===================================================================
52872 --- linux-2.6.24.7.orig/arch/powerpc/platforms/powermac/pci.c
52873 +++ linux-2.6.24.7/arch/powerpc/platforms/powermac/pci.c
52874 @@ -40,8 +40,6 @@
52875  static int has_uninorth;
52876  #ifdef CONFIG_PPC64
52877  static struct pci_controller *u3_agp;
52878 -static struct pci_controller *u4_pcie;
52879 -static struct pci_controller *u3_ht;
52880  #else
52881  static int has_second_ohare;
52882  #endif /* CONFIG_PPC64 */
52883 @@ -314,12 +312,15 @@ static int u3_ht_skip_device(struct pci_
52884  
52885         /* We only allow config cycles to devices that are in OF device-tree
52886          * as we are apparently having some weird things going on with some
52887 -        * revs of K2 on recent G5s
52888 +        * revs of K2 on recent G5s, except for the host bridge itself, which
52889 +        * is missing from the tree but we know we can probe.
52890          */
52891         if (bus->self)
52892                 busdn = pci_device_to_OF_node(bus->self);
52893 +       else if (devfn == 0)
52894 +               return 0;
52895         else
52896 -               busdn = hose->arch_data;
52897 +               busdn = hose->dn;
52898         for (dn = busdn->child; dn; dn = dn->sibling)
52899                 if (PCI_DN(dn) && PCI_DN(dn)->devfn == devfn)
52900                         break;
52901 @@ -344,14 +345,15 @@ static int u3_ht_skip_device(struct pci_
52902                 + (((unsigned int)bus) << 16) \
52903                 + 0x01000000UL)
52904  
52905 -static volatile void __iomem *u3_ht_cfg_access(struct pci_controller* hose,
52906 -                                            u8 bus, u8 devfn, u8 offset)
52907 +static void __iomem *u3_ht_cfg_access(struct pci_controller *hose, u8 bus,
52908 +                                     u8 devfn, u8 offset, int *swap)
52909  {
52910 +       *swap = 1;
52911         if (bus == hose->first_busno) {
52912 -               /* For now, we don't self probe U3 HT bridge */
52913 -               if (PCI_SLOT(devfn) == 0)
52914 -                       return NULL;
52915 -               return hose->cfg_data + U3_HT_CFA0(devfn, offset);
52916 +               if (devfn != 0)
52917 +                       return hose->cfg_data + U3_HT_CFA0(devfn, offset);
52918 +               *swap = 0;
52919 +               return ((void __iomem *)hose->cfg_addr) + (offset << 2);
52920         } else
52921                 return hose->cfg_data + U3_HT_CFA1(bus, devfn, offset);
52922  }
52923 @@ -360,14 +362,15 @@ static int u3_ht_read_config(struct pci_
52924                                     int offset, int len, u32 *val)
52925  {
52926         struct pci_controller *hose;
52927 -       volatile void __iomem *addr;
52928 +       void __iomem *addr;
52929 +       int swap;
52930  
52931         hose = pci_bus_to_host(bus);
52932         if (hose == NULL)
52933                 return PCIBIOS_DEVICE_NOT_FOUND;
52934         if (offset >= 0x100)
52935                 return  PCIBIOS_BAD_REGISTER_NUMBER;
52936 -       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
52937 +       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset, &swap);
52938         if (!addr)
52939                 return PCIBIOS_DEVICE_NOT_FOUND;
52940  
52941 @@ -397,10 +400,10 @@ static int u3_ht_read_config(struct pci_
52942                 *val = in_8(addr);
52943                 break;
52944         case 2:
52945 -               *val = in_le16(addr);
52946 +               *val = swap ? in_le16(addr) : in_be16(addr);
52947                 break;
52948         default:
52949 -               *val = in_le32(addr);
52950 +               *val = swap ? in_le32(addr) : in_be32(addr);
52951                 break;
52952         }
52953         return PCIBIOS_SUCCESSFUL;
52954 @@ -410,14 +413,15 @@ static int u3_ht_write_config(struct pci
52955                                      int offset, int len, u32 val)
52956  {
52957         struct pci_controller *hose;
52958 -       volatile void __iomem *addr;
52959 +       void __iomem *addr;
52960 +       int swap;
52961  
52962         hose = pci_bus_to_host(bus);
52963         if (hose == NULL)
52964                 return PCIBIOS_DEVICE_NOT_FOUND;
52965         if (offset >= 0x100)
52966                 return  PCIBIOS_BAD_REGISTER_NUMBER;
52967 -       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
52968 +       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset, &swap);
52969         if (!addr)
52970                 return PCIBIOS_DEVICE_NOT_FOUND;
52971  
52972 @@ -439,10 +443,10 @@ static int u3_ht_write_config(struct pci
52973                 out_8(addr, val);
52974                 break;
52975         case 2:
52976 -               out_le16(addr, val);
52977 +               swap ? out_le16(addr, val) : out_be16(addr, val);
52978                 break;
52979         default:
52980 -               out_le32((u32 __iomem *)addr, val);
52981 +               swap ? out_le32(addr, val) : out_be32(addr, val);
52982                 break;
52983         }
52984         return PCIBIOS_SUCCESSFUL;
52985 @@ -725,7 +729,7 @@ static void __init setup_bandit(struct p
52986  static int __init setup_uninorth(struct pci_controller *hose,
52987                                  struct resource *addr)
52988  {
52989 -       pci_assign_all_buses = 1;
52990 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
52991         has_uninorth = 1;
52992         hose->ops = &macrisc_pci_ops;
52993         hose->cfg_addr = ioremap(addr->start + 0x800000, 0x1000);
52994 @@ -773,31 +777,72 @@ static void __init setup_u4_pcie(struct 
52995          */
52996         hose->first_busno = 0x00;
52997         hose->last_busno = 0xff;
52998 -       u4_pcie = hose;
52999  }
53000  
53001 -static void __init setup_u3_ht(struct pci_controller* hose)
53002 +static void __init parse_region_decode(struct pci_controller *hose,
53003 +                                      u32 decode)
53004  {
53005 -       struct device_node *np = (struct device_node *)hose->arch_data;
53006 -       struct pci_controller *other = NULL;
53007 -       int i, cur;
53008 +       unsigned long base, end, next = -1;
53009 +       int i, cur = -1;
53010  
53011 +       /* Iterate through all bits. We ignore the last bit as this region is
53012 +        * reserved for the ROM among other niceties
53013 +        */
53014 +       for (i = 0; i < 31; i++) {
53015 +               if ((decode & (0x80000000 >> i)) == 0)
53016 +                       continue;
53017 +               if (i < 16) {
53018 +                       base = 0xf0000000 | (((u32)i) << 24);
53019 +                       end = base + 0x00ffffff;
53020 +               } else {
53021 +                       base = ((u32)i-16) << 28;
53022 +                       end = base + 0x0fffffff;
53023 +               }
53024 +               if (base != next) {
53025 +                       if (++cur >= 3) {
53026 +                               printk(KERN_WARNING "PCI: Too many ranges !\n");
53027 +                               break;
53028 +                       }
53029 +                       hose->mem_resources[cur].flags = IORESOURCE_MEM;
53030 +                       hose->mem_resources[cur].name = hose->dn->full_name;
53031 +                       hose->mem_resources[cur].start = base;
53032 +                       hose->mem_resources[cur].end = end;
53033 +                       DBG("  %d: 0x%08lx-0x%08lx\n", cur, base, end);
53034 +               } else {
53035 +                       DBG("   :           -0x%08lx\n", end);
53036 +                       hose->mem_resources[cur].end = end;
53037 +               }
53038 +               next = end + 1;
53039 +       }
53040 +}
53041 +
53042 +static void __init setup_u3_ht(struct pci_controller* hose)
53043 +{
53044 +       struct device_node *np = hose->dn;
53045 +       struct resource cfg_res, self_res;
53046 +       u32 decode;
53047  
53048         hose->ops = &u3_ht_pci_ops;
53049  
53050 -       /* We hard code the address because of the different size of
53051 -        * the reg address cell, we shall fix that by killing struct
53052 -        * reg_property and using some accessor functions instead
53053 +       /* Get base addresses from OF tree
53054          */
53055 -       hose->cfg_data = ioremap(0xf2000000, 0x02000000);
53056 +       if (of_address_to_resource(np, 0, &cfg_res) ||
53057 +           of_address_to_resource(np, 1, &self_res)) {
53058 +               printk(KERN_ERR "PCI: Failed to get U3/U4 HT resources !\n");
53059 +               return;
53060 +       }
53061 +
53062 +       /* Map external cfg space access into cfg_data and self registers
53063 +        * into cfg_addr
53064 +        */
53065 +       hose->cfg_data = ioremap(cfg_res.start, 0x02000000);
53066 +       hose->cfg_addr = ioremap(self_res.start,
53067 +                                self_res.end - self_res.start + 1);
53068  
53069         /*
53070 -        * /ht node doesn't expose a "ranges" property, so we "remove"
53071 -        * regions that have been allocated to AGP. So far, this version of
53072 -        * the code doesn't assign any of the 0xfxxxxxxx "fine" memory regions
53073 -        * to /ht. We need to fix that sooner or later by either parsing all
53074 -        * child "ranges" properties or figuring out the U3 address space
53075 -        * decoding logic and then read its configuration register (if any).
53076 +        * /ht node doesn't expose a "ranges" property, we read the register
53077 +        * that controls the decoding logic and use that for memory regions.
53078 +        * The IO region is hard coded since it is fixed in HW as well.
53079          */
53080         hose->io_base_phys = 0xf4000000;
53081         hose->pci_io_size = 0x00400000;
53082 @@ -808,76 +853,33 @@ static void __init setup_u3_ht(struct pc
53083         hose->pci_mem_offset = 0;
53084         hose->first_busno = 0;
53085         hose->last_busno = 0xef;
53086 -       hose->mem_resources[0].name = np->full_name;
53087 -       hose->mem_resources[0].start = 0x80000000;
53088 -       hose->mem_resources[0].end = 0xefffffff;
53089 -       hose->mem_resources[0].flags = IORESOURCE_MEM;
53090 -
53091 -       u3_ht = hose;
53092 -
53093 -       if (u3_agp != NULL)
53094 -               other = u3_agp;
53095 -       else if (u4_pcie != NULL)
53096 -               other = u4_pcie;
53097  
53098 -       if (other == NULL) {
53099 -               DBG("U3/4 has no AGP/PCIE, using full resource range\n");
53100 -               return;
53101 -       }
53102 +       /* Note: fix offset when cfg_addr becomes a void * */
53103 +       decode = in_be32(hose->cfg_addr + 0x80);
53104  
53105 -       /* Fixup bus range vs. PCIE */
53106 -       if (u4_pcie)
53107 -               hose->last_busno = u4_pcie->first_busno - 1;
53108 -
53109 -       /* We "remove" the AGP resources from the resources allocated to HT,
53110 -        * that is we create "holes". However, that code does assumptions
53111 -        * that so far happen to be true (cross fingers...), typically that
53112 -        * resources in the AGP node are properly ordered
53113 -        */
53114 -       cur = 0;
53115 -       for (i=0; i<3; i++) {
53116 -               struct resource *res = &other->mem_resources[i];
53117 -               if (res->flags != IORESOURCE_MEM)
53118 -                       continue;
53119 -               /* We don't care about "fine" resources */
53120 -               if (res->start >= 0xf0000000)
53121 -                       continue;
53122 -               /* Check if it's just a matter of "shrinking" us in one
53123 -                * direction
53124 -                */
53125 -               if (hose->mem_resources[cur].start == res->start) {
53126 -                       DBG("U3/HT: shrink start of %d, %08lx -> %08lx\n",
53127 -                           cur, hose->mem_resources[cur].start,
53128 -                           res->end + 1);
53129 -                       hose->mem_resources[cur].start = res->end + 1;
53130 -                       continue;
53131 -               }
53132 -               if (hose->mem_resources[cur].end == res->end) {
53133 -                       DBG("U3/HT: shrink end of %d, %08lx -> %08lx\n",
53134 -                           cur, hose->mem_resources[cur].end,
53135 -                           res->start - 1);
53136 -                       hose->mem_resources[cur].end = res->start - 1;
53137 -                       continue;
53138 -               }
53139 -               /* No, it's not the case, we need a hole */
53140 -               if (cur == 2) {
53141 -                       /* not enough resources for a hole, we drop part
53142 -                        * of the range
53143 -                        */
53144 -                       printk(KERN_WARNING "Running out of resources"
53145 -                              " for /ht host !\n");
53146 -                       hose->mem_resources[cur].end = res->start - 1;
53147 -                       continue;
53148 -               }
53149 -               cur++;
53150 -               DBG("U3/HT: hole, %d end at %08lx, %d start at %08lx\n",
53151 -                   cur-1, res->start - 1, cur, res->end + 1);
53152 -               hose->mem_resources[cur].name = np->full_name;
53153 -               hose->mem_resources[cur].flags = IORESOURCE_MEM;
53154 -               hose->mem_resources[cur].start = res->end + 1;
53155 -               hose->mem_resources[cur].end = hose->mem_resources[cur-1].end;
53156 -               hose->mem_resources[cur-1].end = res->start - 1;
53157 -       }
53158 +       DBG("PCI: Apple HT bridge decode register: 0x%08x\n", decode);
53159 +
53160 +       /* NOTE: The decode register setup is a bit weird... region
53161 +        * 0xf8000000 for example is marked as enabled in there while it's
53162 +        & actually the memory controller registers.
53163 +        * That means that we are incorrectly attributing it to HT.
53164 +        *
53165 +        * In a similar vein, region 0xf4000000 is actually the HT IO space but
53166 +        * also marked as enabled in here and 0xf9000000 is used by some other
53167 +        * internal bits of the northbridge.
53168 +        *
53169 +        * Unfortunately, we can't just mask out those bit as we would end
53170 +        * up with more regions than we can cope (linux can only cope with
53171 +        * 3 memory regions for a PHB at this stage).
53172 +        *
53173 +        * So for now, we just do a little hack. We happen to -know- that
53174 +        * Apple firmware doesn't assign things below 0xfa000000 for that
53175 +        * bridge anyway so we mask out all bits we don't want.
53176 +        */
53177 +       decode &= 0x003fffff;
53178 +
53179 +       /* Now parse the resulting bits and build resources */
53180 +       parse_region_decode(hose, decode);
53181  }
53182  #endif /* CONFIG_PPC64 */
53183  
53184 @@ -994,6 +996,8 @@ void __init pmac_pci_init(void)
53185         struct device_node *np, *root;
53186         struct device_node *ht = NULL;
53187  
53188 +       ppc_pci_flags = PPC_PCI_CAN_SKIP_ISA_ALIGN;
53189 +
53190         root = of_find_node_by_path("/");
53191         if (root == NULL) {
53192                 printk(KERN_CRIT "pmac_pci_init: can't find root "
53193 @@ -1032,15 +1036,15 @@ void __init pmac_pci_init(void)
53194          * future though
53195          */
53196         if (u3_agp) {
53197 -               struct device_node *np = u3_agp->arch_data;
53198 +               struct device_node *np = u3_agp->dn;
53199                 PCI_DN(np)->busno = 0xf0;
53200                 for (np = np->child; np; np = np->sibling)
53201                         PCI_DN(np)->busno = 0xf0;
53202         }
53203         /* pmac_check_ht_link(); */
53204  
53205 -       /* Tell pci.c to not use the common resource allocation mechanism */
53206 -       pci_probe_only = 1;
53207 +       /* We can allocate missing resources if any */
53208 +       pci_probe_only = 0;
53209  
53210  #else /* CONFIG_PPC64 */
53211         init_p2pbridge();
53212 @@ -1051,13 +1055,13 @@ void __init pmac_pci_init(void)
53213          * some offset between bus number and domains for now when we
53214          * assign all busses should help for now
53215          */
53216 -       if (pci_assign_all_buses)
53217 +       if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_BUS)
53218                 pcibios_assign_bus_offset = 0x10;
53219  #endif
53220  }
53221  
53222 -int
53223 -pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
53224 +#ifdef CONFIG_PPC32
53225 +int pmac_pci_enable_device_hook(struct pci_dev *dev)
53226  {
53227         struct device_node* node;
53228         int updatecfg = 0;
53229 @@ -1099,24 +1103,21 @@ pmac_pci_enable_device_hook(struct pci_d
53230                 updatecfg = 1;
53231         }
53232  
53233 +       /*
53234 +        * Fixup various header fields on 32 bits. We don't do that on
53235 +        * 64 bits as some of these have strange values behind the HT
53236 +        * bridge and we must not, for example, enable MWI or set the
53237 +        * cache line size on them.
53238 +        */
53239         if (updatecfg) {
53240                 u16 cmd;
53241  
53242 -               /*
53243 -                * Make sure PCI is correctly configured
53244 -                *
53245 -                * We use old pci_bios versions of the function since, by
53246 -                * default, gmac is not powered up, and so will be absent
53247 -                * from the kernel initial PCI lookup.
53248 -                *
53249 -                * Should be replaced by 2.4 new PCI mechanisms and really
53250 -                * register the device.
53251 -                */
53252                 pci_read_config_word(dev, PCI_COMMAND, &cmd);
53253                 cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER
53254                         | PCI_COMMAND_INVALIDATE;
53255                 pci_write_config_word(dev, PCI_COMMAND, cmd);
53256                 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 16);
53257 +
53258                 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE,
53259                                       L1_CACHE_BYTES >> 2);
53260         }
53261 @@ -1124,6 +1125,18 @@ pmac_pci_enable_device_hook(struct pci_d
53262         return 0;
53263  }
53264  
53265 +void __devinit pmac_pci_fixup_ohci(struct pci_dev *dev)
53266 +{
53267 +       struct device_node *node = pci_device_to_OF_node(dev);
53268 +
53269 +       /* We don't want to assign resources to USB controllers
53270 +        * absent from the OF tree (iBook second controller)
53271 +        */
53272 +       if (dev->class == PCI_CLASS_SERIAL_USB_OHCI && !node)
53273 +               dev->resource[0].flags = 0;
53274 +}
53275 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_ANY_ID, pmac_pci_fixup_ohci);
53276 +
53277  /* We power down some devices after they have been probed. They'll
53278   * be powered back on later on
53279   */
53280 @@ -1171,7 +1184,6 @@ void __init pmac_pcibios_after_init(void
53281         of_node_put(nd);
53282  }
53283  
53284 -#ifdef CONFIG_PPC32
53285  void pmac_pci_fixup_cardbus(struct pci_dev* dev)
53286  {
53287         if (!machine_is(powermac))
53288 @@ -1259,7 +1271,7 @@ void pmac_pci_fixup_pciata(struct pci_de
53289         }
53290  }
53291  DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata);
53292 -#endif
53293 +#endif /* CONFIG_PPC32 */
53294  
53295  /*
53296   * Disable second function on K2-SATA, it's broken
53297 Index: linux-2.6.24.7/arch/powerpc/platforms/powermac/pfunc_base.c
53298 ===================================================================
53299 --- linux-2.6.24.7.orig/arch/powerpc/platforms/powermac/pfunc_base.c
53300 +++ linux-2.6.24.7/arch/powerpc/platforms/powermac/pfunc_base.c
53301 @@ -363,8 +363,7 @@ int __init pmac_pfunc_base_install(void)
53302  
53303         return 0;
53304  }
53305 -
53306 -arch_initcall(pmac_pfunc_base_install);
53307 +machine_arch_initcall(powermac, pmac_pfunc_base_install);
53308  
53309  #ifdef CONFIG_PM
53310  
53311 Index: linux-2.6.24.7/arch/powerpc/platforms/powermac/pic.c
53312 ===================================================================
53313 --- linux-2.6.24.7.orig/arch/powerpc/platforms/powermac/pic.c
53314 +++ linux-2.6.24.7/arch/powerpc/platforms/powermac/pic.c
53315 @@ -690,6 +690,5 @@ static int __init init_pmacpic_sysfs(voi
53316         sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
53317         return 0;
53318  }
53319 -
53320 -subsys_initcall(init_pmacpic_sysfs);
53321 +machine_subsys_initcall(powermac, init_pmacpic_sysfs);
53322  
53323 Index: linux-2.6.24.7/arch/powerpc/platforms/powermac/pmac.h
53324 ===================================================================
53325 --- linux-2.6.24.7.orig/arch/powerpc/platforms/powermac/pmac.h
53326 +++ linux-2.6.24.7/arch/powerpc/platforms/powermac/pmac.h
53327 @@ -26,7 +26,7 @@ extern void pmac_pci_init(void);
53328  extern void pmac_nvram_update(void);
53329  extern unsigned char pmac_nvram_read_byte(int addr);
53330  extern void pmac_nvram_write_byte(int addr, unsigned char val);
53331 -extern int pmac_pci_enable_device_hook(struct pci_dev *dev, int initial);
53332 +extern int pmac_pci_enable_device_hook(struct pci_dev *dev);
53333  extern void pmac_pcibios_after_init(void);
53334  extern int of_show_percpuinfo(struct seq_file *m, int i);
53335  
53336 Index: linux-2.6.24.7/arch/powerpc/platforms/powermac/setup.c
53337 ===================================================================
53338 --- linux-2.6.24.7.orig/arch/powerpc/platforms/powermac/setup.c
53339 +++ linux-2.6.24.7/arch/powerpc/platforms/powermac/setup.c
53340 @@ -51,6 +51,8 @@
53341  #include <linux/root_dev.h>
53342  #include <linux/bitops.h>
53343  #include <linux/suspend.h>
53344 +#include <linux/of_device.h>
53345 +#include <linux/of_platform.h>
53346  
53347  #include <asm/reg.h>
53348  #include <asm/sections.h>
53349 @@ -68,8 +70,6 @@
53350  #include <asm/btext.h>
53351  #include <asm/pmac_feature.h>
53352  #include <asm/time.h>
53353 -#include <asm/of_device.h>
53354 -#include <asm/of_platform.h>
53355  #include <asm/mmu_context.h>
53356  #include <asm/iommu.h>
53357  #include <asm/smu.h>
53358 @@ -94,7 +94,6 @@ extern struct machdep_calls pmac_md;
53359  #define DEFAULT_ROOT_DEVICE Root_SDA1  /* sda1 - slightly silly choice */
53360  
53361  #ifdef CONFIG_PPC64
53362 -#include <asm/udbg.h>
53363  int sccdbg;
53364  #endif
53365  
53366 @@ -398,17 +397,13 @@ static int initializing = 1;
53367  
53368  static int pmac_late_init(void)
53369  {
53370 -       if (!machine_is(powermac))
53371 -               return -ENODEV;
53372 -
53373         initializing = 0;
53374         /* this is udbg (which is __init) and we can later use it during
53375          * cpu hotplug (in smp_core99_kick_cpu) */
53376         ppc_md.progress = NULL;
53377         return 0;
53378  }
53379 -
53380 -late_initcall(pmac_late_init);
53381 +machine_late_initcall(powermac, pmac_late_init);
53382  
53383  /*
53384   * This is __init_refok because we check for "initializing" before
53385 @@ -535,9 +530,6 @@ static int __init pmac_declare_of_platfo
53386         if (machine_is(chrp))
53387                 return -1;
53388  
53389 -       if (!machine_is(powermac))
53390 -               return 0;
53391 -
53392         np = of_find_node_by_name(NULL, "valkyrie");
53393         if (np)
53394                 of_platform_device_create(np, "valkyrie", NULL);
53395 @@ -552,8 +544,7 @@ static int __init pmac_declare_of_platfo
53396  
53397         return 0;
53398  }
53399 -
53400 -device_initcall(pmac_declare_of_platform_devices);
53401 +machine_device_initcall(powermac, pmac_declare_of_platform_devices);
53402  
53403  /*
53404   * Called very early, MMU is off, device-tree isn't unflattened
53405 @@ -613,9 +604,11 @@ static int pmac_pci_probe_mode(struct pc
53406  
53407         /* We need to use normal PCI probing for the AGP bus,
53408          * since the device for the AGP bridge isn't in the tree.
53409 +        * Same for the PCIe host on U4 and the HT host bridge.
53410          */
53411         if (bus->self == NULL && (of_device_is_compatible(node, "u3-agp") ||
53412 -                                 of_device_is_compatible(node, "u4-pcie")))
53413 +                                 of_device_is_compatible(node, "u4-pcie") ||
53414 +                                 of_device_is_compatible(node, "u3-ht")))
53415                 return PCI_PROBE_NORMAL;
53416         return PCI_PROBE_DEVTREE;
53417  }
53418 Index: linux-2.6.24.7/arch/powerpc/platforms/powermac/time.c
53419 ===================================================================
53420 --- linux-2.6.24.7.orig/arch/powerpc/platforms/powermac/time.c
53421 +++ linux-2.6.24.7/arch/powerpc/platforms/powermac/time.c
53422 @@ -84,12 +84,14 @@ long __init pmac_time_init(void)
53423         return delta;
53424  }
53425  
53426 +#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
53427  static void to_rtc_time(unsigned long now, struct rtc_time *tm)
53428  {
53429         to_tm(now, tm);
53430         tm->tm_year -= 1900;
53431         tm->tm_mon -= 1;
53432  }
53433 +#endif
53434  
53435  static unsigned long from_rtc_time(struct rtc_time *tm)
53436  {
53437 Index: linux-2.6.24.7/arch/powerpc/platforms/ps3/Kconfig
53438 ===================================================================
53439 --- linux-2.6.24.7.orig/arch/powerpc/platforms/ps3/Kconfig
53440 +++ linux-2.6.24.7/arch/powerpc/platforms/ps3/Kconfig
53441 @@ -61,17 +61,6 @@ config PS3_DYNAMIC_DMA
53442           This support is mainly for Linux kernel development.  If unsure,
53443           say N.
53444  
53445 -config PS3_USE_LPAR_ADDR
53446 -       depends on PPC_PS3 && EXPERIMENTAL
53447 -       bool "PS3 use lpar address space"
53448 -       default y
53449 -       help
53450 -         This option is solely for experimentation by experts.  Disables
53451 -         translation of lpar addresses.  SPE support currently won't work
53452 -         without this set to y.
53453 -
53454 -         If you have any doubt, choose the default y.
53455 -
53456  config PS3_VUART
53457         depends on PPC_PS3
53458         tristate
53459 @@ -138,4 +127,17 @@ config PS3_FLASH
53460           be disabled on the kernel command line using "ps3flash=off", to
53461           not allocate this fixed buffer.
53462  
53463 +config PS3_LPM
53464 +       tristate "PS3 Logical Performance Monitor support"
53465 +       depends on PPC_PS3
53466 +       help
53467 +         Include support for the PS3 Logical Performance Monitor.
53468 +
53469 +         This support is required to use the logical performance monitor
53470 +         of the PS3's LV1 hypervisor.
53471 +
53472 +         If you intend to use the advanced performance monitoring and
53473 +         profiling support of the Cell processor with programs like
53474 +         oprofile and perfmon2, then say Y or M, otherwise say N.
53475 +
53476  endmenu
53477 Index: linux-2.6.24.7/arch/powerpc/platforms/ps3/device-init.c
53478 ===================================================================
53479 --- linux-2.6.24.7.orig/arch/powerpc/platforms/ps3/device-init.c
53480 +++ linux-2.6.24.7/arch/powerpc/platforms/ps3/device-init.c
53481 @@ -23,6 +23,7 @@
53482  #include <linux/kernel.h>
53483  #include <linux/kthread.h>
53484  #include <linux/init.h>
53485 +#include <linux/reboot.h>
53486  
53487  #include <asm/firmware.h>
53488  #include <asm/lv1call.h>
53489 @@ -30,6 +31,89 @@
53490  
53491  #include "platform.h"
53492  
53493 +static int __init ps3_register_lpm_devices(void)
53494 +{
53495 +       int result;
53496 +       u64 tmp1;
53497 +       u64 tmp2;
53498 +       struct ps3_system_bus_device *dev;
53499 +
53500 +       pr_debug(" -> %s:%d\n", __func__, __LINE__);
53501 +
53502 +       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
53503 +       if (!dev)
53504 +               return -ENOMEM;
53505 +
53506 +       dev->match_id = PS3_MATCH_ID_LPM;
53507 +       dev->dev_type = PS3_DEVICE_TYPE_LPM;
53508 +
53509 +       /* The current lpm driver only supports a single BE processor. */
53510 +
53511 +       result = ps3_repository_read_be_node_id(0, &dev->lpm.node_id);
53512 +
53513 +       if (result) {
53514 +               pr_debug("%s:%d: ps3_repository_read_be_node_id failed \n",
53515 +                       __func__, __LINE__);
53516 +               goto fail_read_repo;
53517 +       }
53518 +
53519 +       result = ps3_repository_read_lpm_privileges(dev->lpm.node_id, &tmp1,
53520 +               &dev->lpm.rights);
53521 +
53522 +       if (result) {
53523 +               pr_debug("%s:%d: ps3_repository_read_lpm_privleges failed \n",
53524 +                       __func__, __LINE__);
53525 +               goto fail_read_repo;
53526 +       }
53527 +
53528 +       lv1_get_logical_partition_id(&tmp2);
53529 +
53530 +       if (tmp1 != tmp2) {
53531 +               pr_debug("%s:%d: wrong lpar\n",
53532 +                       __func__, __LINE__);
53533 +               result = -ENODEV;
53534 +               goto fail_rights;
53535 +       }
53536 +
53537 +       if (!(dev->lpm.rights & PS3_LPM_RIGHTS_USE_LPM)) {
53538 +               pr_debug("%s:%d: don't have rights to use lpm\n",
53539 +                       __func__, __LINE__);
53540 +               result = -EPERM;
53541 +               goto fail_rights;
53542 +       }
53543 +
53544 +       pr_debug("%s:%d: pu_id %lu, rights %lu(%lxh)\n",
53545 +               __func__, __LINE__, dev->lpm.pu_id, dev->lpm.rights,
53546 +               dev->lpm.rights);
53547 +
53548 +       result = ps3_repository_read_pu_id(0, &dev->lpm.pu_id);
53549 +
53550 +       if (result) {
53551 +               pr_debug("%s:%d: ps3_repository_read_pu_id failed \n",
53552 +                       __func__, __LINE__);
53553 +               goto fail_read_repo;
53554 +       }
53555 +
53556 +       result = ps3_system_bus_device_register(dev);
53557 +
53558 +       if (result) {
53559 +               pr_debug("%s:%d ps3_system_bus_device_register failed\n",
53560 +                       __func__, __LINE__);
53561 +               goto fail_register;
53562 +       }
53563 +
53564 +       pr_debug(" <- %s:%d\n", __func__, __LINE__);
53565 +       return 0;
53566 +
53567 +
53568 +fail_register:
53569 +fail_rights:
53570 +fail_read_repo:
53571 +       kfree(dev);
53572 +       pr_debug(" <- %s:%d: failed\n", __func__, __LINE__);
53573 +       return result;
53574 +}
53575 +
53576  /**
53577   * ps3_setup_gelic_device - Setup and register a gelic device instance.
53578   *
53579 @@ -238,166 +322,6 @@ static int __init ps3_setup_vuart_device
53580         return result;
53581  }
53582  
53583 -static int ps3stor_wait_for_completion(u64 dev_id, u64 tag,
53584 -                                      unsigned int timeout)
53585 -{
53586 -       int result = -1;
53587 -       unsigned int retries = 0;
53588 -       u64 status;
53589 -
53590 -       for (retries = 0; retries < timeout; retries++) {
53591 -               result = lv1_storage_check_async_status(dev_id, tag, &status);
53592 -               if (!result)
53593 -                       break;
53594 -
53595 -               msleep(1);
53596 -       }
53597 -
53598 -       if (result)
53599 -               pr_debug("%s:%u: check_async_status: %s, status %lx\n",
53600 -                        __func__, __LINE__, ps3_result(result), status);
53601 -
53602 -       return result;
53603 -}
53604 -
53605 -/**
53606 - * ps3_storage_wait_for_device - Wait for a storage device to become ready.
53607 - * @repo: The repository device to wait for.
53608 - *
53609 - * Uses the hypervisor's storage device notification mechanism to wait until
53610 - * a storage device is ready.  The device notification mechanism uses a
53611 - * psuedo device (id = -1) to asynchronously notify the guest when storage
53612 - * devices become ready.  The notification device has a block size of 512
53613 - * bytes.
53614 - */
53615 -
53616 -static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
53617 -{
53618 -       int error = -ENODEV;
53619 -       int result;
53620 -       const u64 notification_dev_id = (u64)-1LL;
53621 -       const unsigned int timeout = HZ;
53622 -       u64 lpar;
53623 -       u64 tag;
53624 -       void *buf;
53625 -       enum ps3_notify_type {
53626 -               notify_device_ready = 0,
53627 -               notify_region_probe = 1,
53628 -               notify_region_update = 2,
53629 -       };
53630 -       struct {
53631 -               u64 operation_code;     /* must be zero */
53632 -               u64 event_mask;         /* OR of 1UL << enum ps3_notify_type */
53633 -       } *notify_cmd;
53634 -       struct {
53635 -               u64 event_type;         /* enum ps3_notify_type */
53636 -               u64 bus_id;
53637 -               u64 dev_id;
53638 -               u64 dev_type;
53639 -               u64 dev_port;
53640 -       } *notify_event;
53641 -
53642 -       pr_debug(" -> %s:%u: (%u:%u:%u)\n", __func__, __LINE__, repo->bus_id,
53643 -                repo->dev_id, repo->dev_type);
53644 -
53645 -       buf = kzalloc(512, GFP_KERNEL);
53646 -       if (!buf)
53647 -               return -ENOMEM;
53648 -
53649 -       lpar = ps3_mm_phys_to_lpar(__pa(buf));
53650 -       notify_cmd = buf;
53651 -       notify_event = buf;
53652 -
53653 -       result = lv1_open_device(repo->bus_id, notification_dev_id, 0);
53654 -       if (result) {
53655 -               printk(KERN_ERR "%s:%u: lv1_open_device %s\n", __func__,
53656 -                      __LINE__, ps3_result(result));
53657 -               goto fail_free;
53658 -       }
53659 -
53660 -       /* Setup and write the request for device notification. */
53661 -
53662 -       notify_cmd->operation_code = 0; /* must be zero */
53663 -       notify_cmd->event_mask = 1UL << notify_region_probe;
53664 -
53665 -       result = lv1_storage_write(notification_dev_id, 0, 0, 1, 0, lpar,
53666 -                                  &tag);
53667 -       if (result) {
53668 -               printk(KERN_ERR "%s:%u: write failed %s\n", __func__, __LINE__,
53669 -                      ps3_result(result));
53670 -               goto fail_close;
53671 -       }
53672 -
53673 -       /* Wait for the write completion */
53674 -
53675 -       result = ps3stor_wait_for_completion(notification_dev_id, tag,
53676 -                                            timeout);
53677 -       if (result) {
53678 -               printk(KERN_ERR "%s:%u: write not completed %s\n", __func__,
53679 -                      __LINE__, ps3_result(result));
53680 -               goto fail_close;
53681 -       }
53682 -
53683 -       /* Loop here processing the requested notification events. */
53684 -
53685 -       while (1) {
53686 -               memset(notify_event, 0, sizeof(*notify_event));
53687 -
53688 -               result = lv1_storage_read(notification_dev_id, 0, 0, 1, 0,
53689 -                                         lpar, &tag);
53690 -               if (result) {
53691 -                       printk(KERN_ERR "%s:%u: write failed %s\n", __func__,
53692 -                              __LINE__, ps3_result(result));
53693 -                       break;
53694 -               }
53695 -
53696 -               result = ps3stor_wait_for_completion(notification_dev_id, tag,
53697 -                                                    timeout);
53698 -               if (result) {
53699 -                       printk(KERN_ERR "%s:%u: read not completed %s\n",
53700 -                              __func__, __LINE__, ps3_result(result));
53701 -                       break;
53702 -               }
53703 -
53704 -               pr_debug("%s:%d: notify event (%u:%u:%u): event_type 0x%lx, "
53705 -                        "port %lu\n", __func__, __LINE__, repo->bus_index,
53706 -                        repo->dev_index, repo->dev_type,
53707 -                        notify_event->event_type, notify_event->dev_port);
53708 -
53709 -               if (notify_event->event_type != notify_region_probe ||
53710 -                   notify_event->bus_id != repo->bus_id) {
53711 -                       pr_debug("%s:%u: bad notify_event: event %lu, "
53712 -                                "dev_id %lu, dev_type %lu\n",
53713 -                                __func__, __LINE__, notify_event->event_type,
53714 -                                notify_event->dev_id, notify_event->dev_type);
53715 -                       break;
53716 -               }
53717 -
53718 -               if (notify_event->dev_id == repo->dev_id &&
53719 -                   notify_event->dev_type == repo->dev_type) {
53720 -                       pr_debug("%s:%u: device ready (%u:%u:%u)\n", __func__,
53721 -                                __LINE__, repo->bus_index, repo->dev_index,
53722 -                                repo->dev_type);
53723 -                       error = 0;
53724 -                       break;
53725 -               }
53726 -
53727 -               if (notify_event->dev_id == repo->dev_id &&
53728 -                   notify_event->dev_type == PS3_DEV_TYPE_NOACCESS) {
53729 -                       pr_debug("%s:%u: no access: dev_id %u\n", __func__,
53730 -                                __LINE__, repo->dev_id);
53731 -                       break;
53732 -               }
53733 -       }
53734 -
53735 -fail_close:
53736 -       lv1_close_device(repo->bus_id, notification_dev_id);
53737 -fail_free:
53738 -       kfree(buf);
53739 -       pr_debug(" <- %s:%u\n", __func__, __LINE__);
53740 -       return error;
53741 -}
53742 -
53743  static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
53744                                  enum ps3_match_id match_id)
53745  {
53746 @@ -449,16 +373,6 @@ static int ps3_setup_storage_dev(const s
53747                 goto fail_find_interrupt;
53748         }
53749  
53750 -       /* FIXME: Arrange to only do this on a 'cold' boot */
53751 -
53752 -       result = ps3_storage_wait_for_device(repo);
53753 -       if (result) {
53754 -               printk(KERN_ERR "%s:%u: storage_notification failed %d\n",
53755 -                      __func__, __LINE__, result);
53756 -               result = -ENODEV;
53757 -               goto fail_probe_notification;
53758 -       }
53759 -
53760         for (i = 0; i < num_regions; i++) {
53761                 unsigned int id;
53762                 u64 start, size;
53763 @@ -494,7 +408,6 @@ static int ps3_setup_storage_dev(const s
53764  
53765  fail_device_register:
53766  fail_read_region:
53767 -fail_probe_notification:
53768  fail_find_interrupt:
53769         kfree(p);
53770  fail_malloc:
53771 @@ -659,62 +572,268 @@ static int ps3_register_repository_devic
53772         return result;
53773  }
53774  
53775 +static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
53776 +{
53777 +       struct ps3_repository_device repo;
53778 +       int res;
53779 +       unsigned int retries;
53780 +       unsigned long rem;
53781 +
53782 +       /*
53783 +        * On some firmware versions (e.g. 1.90), the device may not show up
53784 +        * in the repository immediately
53785 +        */
53786 +       for (retries = 0; retries < 10; retries++) {
53787 +               res = ps3_repository_find_device_by_id(&repo, bus_id, dev_id);
53788 +               if (!res)
53789 +                       goto found;
53790 +
53791 +               rem = msleep_interruptible(100);
53792 +               if (rem)
53793 +                       break;
53794 +       }
53795 +       pr_warning("%s:%u: device %lu:%lu not found\n", __func__, __LINE__,
53796 +                  bus_id, dev_id);
53797 +       return;
53798 +
53799 +found:
53800 +       if (retries)
53801 +               pr_debug("%s:%u: device %lu:%lu found after %u retries\n",
53802 +                        __func__, __LINE__, bus_id, dev_id, retries);
53803 +
53804 +       ps3_register_repository_device(&repo);
53805 +       return;
53806 +}
53807 +
53808 +#define PS3_NOTIFICATION_DEV_ID                ULONG_MAX
53809 +#define PS3_NOTIFICATION_INTERRUPT_ID  0
53810 +
53811 +struct ps3_notification_device {
53812 +       struct ps3_system_bus_device sbd;
53813 +       spinlock_t lock;
53814 +       u64 tag;
53815 +       u64 lv1_status;
53816 +       struct completion done;
53817 +};
53818 +
53819 +enum ps3_notify_type {
53820 +       notify_device_ready = 0,
53821 +       notify_region_probe = 1,
53822 +       notify_region_update = 2,
53823 +};
53824 +
53825 +struct ps3_notify_cmd {
53826 +       u64 operation_code;             /* must be zero */
53827 +       u64 event_mask;                 /* OR of 1UL << enum ps3_notify_type */
53828 +};
53829 +
53830 +struct ps3_notify_event {
53831 +       u64 event_type;                 /* enum ps3_notify_type */
53832 +       u64 bus_id;
53833 +       u64 dev_id;
53834 +       u64 dev_type;
53835 +       u64 dev_port;
53836 +};
53837 +
53838 +static irqreturn_t ps3_notification_interrupt(int irq, void *data)
53839 +{
53840 +       struct ps3_notification_device *dev = data;
53841 +       int res;
53842 +       u64 tag, status;
53843 +
53844 +       spin_lock(&dev->lock);
53845 +       res = lv1_storage_get_async_status(PS3_NOTIFICATION_DEV_ID, &tag,
53846 +                                          &status);
53847 +       if (tag != dev->tag)
53848 +               pr_err("%s:%u: tag mismatch, got %lx, expected %lx\n",
53849 +                      __func__, __LINE__, tag, dev->tag);
53850 +
53851 +       if (res) {
53852 +               pr_err("%s:%u: res %d status 0x%lx\n", __func__, __LINE__, res,
53853 +                      status);
53854 +       } else {
53855 +               pr_debug("%s:%u: completed, status 0x%lx\n", __func__,
53856 +                        __LINE__, status);
53857 +               dev->lv1_status = status;
53858 +               complete(&dev->done);
53859 +       }
53860 +       spin_unlock(&dev->lock);
53861 +       return IRQ_HANDLED;
53862 +}
53863 +
53864 +static int ps3_notification_read_write(struct ps3_notification_device *dev,
53865 +                                      u64 lpar, int write)
53866 +{
53867 +       const char *op = write ? "write" : "read";
53868 +       unsigned long flags;
53869 +       int res;
53870 +
53871 +       init_completion(&dev->done);
53872 +       spin_lock_irqsave(&dev->lock, flags);
53873 +       res = write ? lv1_storage_write(dev->sbd.dev_id, 0, 0, 1, 0, lpar,
53874 +                                       &dev->tag)
53875 +                   : lv1_storage_read(dev->sbd.dev_id, 0, 0, 1, 0, lpar,
53876 +                                      &dev->tag);
53877 +       spin_unlock_irqrestore(&dev->lock, flags);
53878 +       if (res) {
53879 +               pr_err("%s:%u: %s failed %d\n", __func__, __LINE__, op, res);
53880 +               return -EPERM;
53881 +       }
53882 +       pr_debug("%s:%u: notification %s issued\n", __func__, __LINE__, op);
53883 +
53884 +       res = wait_event_interruptible(dev->done.wait,
53885 +                                      dev->done.done || kthread_should_stop());
53886 +       if (kthread_should_stop())
53887 +               res = -EINTR;
53888 +       if (res) {
53889 +               pr_debug("%s:%u: interrupted %s\n", __func__, __LINE__, op);
53890 +               return res;
53891 +       }
53892 +
53893 +       if (dev->lv1_status) {
53894 +               pr_err("%s:%u: %s not completed, status 0x%lx\n", __func__,
53895 +                      __LINE__, op, dev->lv1_status);
53896 +               return -EIO;
53897 +       }
53898 +       pr_debug("%s:%u: notification %s completed\n", __func__, __LINE__, op);
53899 +
53900 +       return 0;
53901 +}
53902 +
53903 +static struct task_struct *probe_task;
53904 +
53905  /**
53906   * ps3_probe_thread - Background repository probing at system startup.
53907   *
53908   * This implementation only supports background probing on a single bus.
53909 + * It uses the hypervisor's storage device notification mechanism to wait until
53910 + * a storage device is ready.  The device notification mechanism uses a
53911 + * pseudo device to asynchronously notify the guest when storage devices become
53912 + * ready.  The notification device has a block size of 512 bytes.
53913   */
53914  
53915  static int ps3_probe_thread(void *data)
53916  {
53917 -       struct ps3_repository_device *repo = data;
53918 -       int result;
53919 -       unsigned int ms = 250;
53920 +       struct ps3_notification_device dev;
53921 +       int res;
53922 +       unsigned int irq;
53923 +       u64 lpar;
53924 +       void *buf;
53925 +       struct ps3_notify_cmd *notify_cmd;
53926 +       struct ps3_notify_event *notify_event;
53927  
53928         pr_debug(" -> %s:%u: kthread started\n", __func__, __LINE__);
53929  
53930 -       do {
53931 -               try_to_freeze();
53932 +       buf = kzalloc(512, GFP_KERNEL);
53933 +       if (!buf)
53934 +               return -ENOMEM;
53935  
53936 -               pr_debug("%s:%u: probing...\n", __func__, __LINE__);
53937 +       lpar = ps3_mm_phys_to_lpar(__pa(buf));
53938 +       notify_cmd = buf;
53939 +       notify_event = buf;
53940 +
53941 +       /* dummy system bus device */
53942 +       dev.sbd.bus_id = (u64)data;
53943 +       dev.sbd.dev_id = PS3_NOTIFICATION_DEV_ID;
53944 +       dev.sbd.interrupt_id = PS3_NOTIFICATION_INTERRUPT_ID;
53945 +
53946 +       res = lv1_open_device(dev.sbd.bus_id, dev.sbd.dev_id, 0);
53947 +       if (res) {
53948 +               pr_err("%s:%u: lv1_open_device failed %s\n", __func__,
53949 +                      __LINE__, ps3_result(res));
53950 +               goto fail_free;
53951 +       }
53952 +
53953 +       res = ps3_sb_event_receive_port_setup(&dev.sbd, PS3_BINDING_CPU_ANY,
53954 +                                             &irq);
53955 +       if (res) {
53956 +               pr_err("%s:%u: ps3_sb_event_receive_port_setup failed %d\n",
53957 +                      __func__, __LINE__, res);
53958 +              goto fail_close_device;
53959 +       }
53960 +
53961 +       spin_lock_init(&dev.lock);
53962 +
53963 +       res = request_irq(irq, ps3_notification_interrupt, IRQF_DISABLED,
53964 +                         "ps3_notification", &dev);
53965 +       if (res) {
53966 +               pr_err("%s:%u: request_irq failed %d\n", __func__, __LINE__,
53967 +                      res);
53968 +               goto fail_sb_event_receive_port_destroy;
53969 +       }
53970 +
53971 +       /* Setup and write the request for device notification. */
53972 +       notify_cmd->operation_code = 0; /* must be zero */
53973 +       notify_cmd->event_mask = 1UL << notify_region_probe;
53974  
53975 -               do {
53976 -                       result = ps3_repository_find_device(repo);
53977 +       res = ps3_notification_read_write(&dev, lpar, 1);
53978 +       if (res)
53979 +               goto fail_free_irq;
53980  
53981 -                       if (result == -ENODEV)
53982 -                               pr_debug("%s:%u: nothing new\n", __func__,
53983 -                                       __LINE__);
53984 -                       else if (result)
53985 -                               pr_debug("%s:%u: find device error.\n",
53986 -                                       __func__, __LINE__);
53987 -                       else {
53988 -                               pr_debug("%s:%u: found device (%u:%u:%u)\n",
53989 -                                        __func__, __LINE__, repo->bus_index,
53990 -                                        repo->dev_index, repo->dev_type);
53991 -                               ps3_register_repository_device(repo);
53992 -                               ps3_repository_bump_device(repo);
53993 -                               ms = 250;
53994 -                       }
53995 -               } while (!result);
53996 +       /* Loop here processing the requested notification events. */
53997 +       do {
53998 +               try_to_freeze();
53999  
54000 -               pr_debug("%s:%u: ms %u\n", __func__, __LINE__, ms);
54001 +               memset(notify_event, 0, sizeof(*notify_event));
54002  
54003 -               if ( ms > 60000)
54004 +               res = ps3_notification_read_write(&dev, lpar, 0);
54005 +               if (res)
54006                         break;
54007  
54008 -               msleep_interruptible(ms);
54009 +               pr_debug("%s:%u: notify event type 0x%lx bus id %lu dev id %lu"
54010 +                        " type %lu port %lu\n", __func__, __LINE__,
54011 +                        notify_event->event_type, notify_event->bus_id,
54012 +                        notify_event->dev_id, notify_event->dev_type,
54013 +                        notify_event->dev_port);
54014 +
54015 +               if (notify_event->event_type != notify_region_probe ||
54016 +                   notify_event->bus_id != dev.sbd.bus_id) {
54017 +                       pr_warning("%s:%u: bad notify_event: event %lu, "
54018 +                                  "dev_id %lu, dev_type %lu\n",
54019 +                                  __func__, __LINE__, notify_event->event_type,
54020 +                                  notify_event->dev_id,
54021 +                                  notify_event->dev_type);
54022 +                       continue;
54023 +               }
54024  
54025 -               /* An exponential backoff. */
54026 -               ms <<= 1;
54027 +               ps3_find_and_add_device(dev.sbd.bus_id, notify_event->dev_id);
54028  
54029         } while (!kthread_should_stop());
54030  
54031 +fail_free_irq:
54032 +       free_irq(irq, &dev);
54033 +fail_sb_event_receive_port_destroy:
54034 +       ps3_sb_event_receive_port_destroy(&dev.sbd, irq);
54035 +fail_close_device:
54036 +       lv1_close_device(dev.sbd.bus_id, dev.sbd.dev_id);
54037 +fail_free:
54038 +       kfree(buf);
54039 +
54040 +       probe_task = NULL;
54041 +
54042         pr_debug(" <- %s:%u: kthread finished\n", __func__, __LINE__);
54043  
54044         return 0;
54045  }
54046  
54047  /**
54048 + * ps3_stop_probe_thread - Stops the background probe thread.
54049 + *
54050 + */
54051 +
54052 +static int ps3_stop_probe_thread(struct notifier_block *nb, unsigned long code,
54053 +                                void *data)
54054 +{
54055 +       if (probe_task)
54056 +               kthread_stop(probe_task);
54057 +       return 0;
54058 +}
54059 +
54060 +static struct notifier_block nb = {
54061 +       .notifier_call = ps3_stop_probe_thread
54062 +};
54063 +
54064 +/**
54065   * ps3_start_probe_thread - Starts the background probe thread.
54066   *
54067   */
54068 @@ -723,7 +842,7 @@ static int __init ps3_start_probe_thread
54069  {
54070         int result;
54071         struct task_struct *task;
54072 -       static struct ps3_repository_device repo; /* must be static */
54073 +       struct ps3_repository_device repo;
54074  
54075         pr_debug(" -> %s:%d\n", __func__, __LINE__);
54076  
54077 @@ -746,7 +865,8 @@ static int __init ps3_start_probe_thread
54078                 return -ENODEV;
54079         }
54080  
54081 -       task = kthread_run(ps3_probe_thread, &repo, "ps3-probe-%u", bus_type);
54082 +       task = kthread_run(ps3_probe_thread, (void *)repo.bus_id,
54083 +                          "ps3-probe-%u", bus_type);
54084  
54085         if (IS_ERR(task)) {
54086                 result = PTR_ERR(task);
54087 @@ -755,6 +875,9 @@ static int __init ps3_start_probe_thread
54088                 return result;
54089         }
54090  
54091 +       probe_task = task;
54092 +       register_reboot_notifier(&nb);
54093 +
54094         pr_debug(" <- %s:%d\n", __func__, __LINE__);
54095         return 0;
54096  }
54097 @@ -787,6 +910,8 @@ static int __init ps3_register_devices(v
54098  
54099         ps3_register_sound_devices();
54100  
54101 +       ps3_register_lpm_devices();
54102 +
54103         pr_debug(" <- %s:%d\n", __func__, __LINE__);
54104         return 0;
54105  }
54106 Index: linux-2.6.24.7/arch/powerpc/platforms/ps3/mm.c
54107 ===================================================================
54108 --- linux-2.6.24.7.orig/arch/powerpc/platforms/ps3/mm.c
54109 +++ linux-2.6.24.7/arch/powerpc/platforms/ps3/mm.c
54110 @@ -36,11 +36,6 @@
54111  #endif
54112  
54113  enum {
54114 -#if defined(CONFIG_PS3_USE_LPAR_ADDR)
54115 -       USE_LPAR_ADDR = 1,
54116 -#else
54117 -       USE_LPAR_ADDR = 0,
54118 -#endif
54119  #if defined(CONFIG_PS3_DYNAMIC_DMA)
54120         USE_DYNAMIC_DMA = 1,
54121  #else
54122 @@ -137,11 +132,8 @@ static struct map map;
54123  unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr)
54124  {
54125         BUG_ON(is_kernel_addr(phys_addr));
54126 -       if (USE_LPAR_ADDR)
54127 -               return phys_addr;
54128 -       else
54129 -               return (phys_addr < map.rm.size || phys_addr >= map.total)
54130 -                       ? phys_addr : phys_addr + map.r1.offset;
54131 +       return (phys_addr < map.rm.size || phys_addr >= map.total)
54132 +               ? phys_addr : phys_addr + map.r1.offset;
54133  }
54134  
54135  EXPORT_SYMBOL(ps3_mm_phys_to_lpar);
54136 @@ -309,7 +301,7 @@ static int __init ps3_mm_add_memory(void
54137  
54138         BUG_ON(!mem_init_done);
54139  
54140 -       start_addr = USE_LPAR_ADDR ? map.r1.base : map.rm.size;
54141 +       start_addr = map.rm.size;
54142         start_pfn = start_addr >> PAGE_SHIFT;
54143         nr_pages = (map.r1.size + PAGE_SIZE - 1) >> PAGE_SHIFT;
54144  
54145 @@ -359,7 +351,7 @@ static unsigned long dma_sb_lpar_to_bus(
54146  static void  __maybe_unused _dma_dump_region(const struct ps3_dma_region *r,
54147         const char *func, int line)
54148  {
54149 -       DBG("%s:%d: dev        %u:%u\n", func, line, r->dev->bus_id,
54150 +       DBG("%s:%d: dev        %lu:%lu\n", func, line, r->dev->bus_id,
54151                 r->dev->dev_id);
54152         DBG("%s:%d: page_size  %u\n", func, line, r->page_size);
54153         DBG("%s:%d: bus_addr   %lxh\n", func, line, r->bus_addr);
54154 @@ -394,7 +386,7 @@ struct dma_chunk {
54155  static void _dma_dump_chunk (const struct dma_chunk* c, const char* func,
54156         int line)
54157  {
54158 -       DBG("%s:%d: r.dev        %u:%u\n", func, line,
54159 +       DBG("%s:%d: r.dev        %lu:%lu\n", func, line,
54160                 c->region->dev->bus_id, c->region->dev->dev_id);
54161         DBG("%s:%d: r.bus_addr   %lxh\n", func, line, c->region->bus_addr);
54162         DBG("%s:%d: r.page_size  %u\n", func, line, c->region->page_size);
54163 @@ -658,7 +650,7 @@ static int dma_sb_region_create(struct p
54164         BUG_ON(!r);
54165  
54166         if (!r->dev->bus_id) {
54167 -               pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__,
54168 +               pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__,
54169                         r->dev->bus_id, r->dev->dev_id);
54170                 return 0;
54171         }
54172 @@ -724,7 +716,7 @@ static int dma_sb_region_free(struct ps3
54173         BUG_ON(!r);
54174  
54175         if (!r->dev->bus_id) {
54176 -               pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__,
54177 +               pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__,
54178                         r->dev->bus_id, r->dev->dev_id);
54179                 return 0;
54180         }
54181 @@ -1007,7 +999,7 @@ static int dma_sb_region_create_linear(s
54182  
54183         if (r->offset + r->len > map.rm.size) {
54184                 /* Map (part of) 2nd RAM chunk */
54185 -               virt_addr = USE_LPAR_ADDR ? map.r1.base : map.rm.size;
54186 +               virt_addr = map.rm.size;
54187                 len = r->len;
54188                 if (r->offset >= map.rm.size)
54189                         virt_addr += r->offset - map.rm.size;
54190 Index: linux-2.6.24.7/arch/powerpc/platforms/ps3/platform.h
54191 ===================================================================
54192 --- linux-2.6.24.7.orig/arch/powerpc/platforms/ps3/platform.h
54193 +++ linux-2.6.24.7/arch/powerpc/platforms/ps3/platform.h
54194 @@ -89,13 +89,11 @@ enum ps3_dev_type {
54195         PS3_DEV_TYPE_STOR_ROM = TYPE_ROM,       /* 5 */
54196         PS3_DEV_TYPE_SB_GPIO = 6,
54197         PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC,     /* 14 */
54198 -       PS3_DEV_TYPE_STOR_DUMMY = 32,
54199 -       PS3_DEV_TYPE_NOACCESS = 255,
54200  };
54201  
54202  int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str,
54203         u64 *value);
54204 -int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id);
54205 +int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id);
54206  int ps3_repository_read_bus_type(unsigned int bus_index,
54207         enum ps3_bus_type *bus_type);
54208  int ps3_repository_read_bus_num_dev(unsigned int bus_index,
54209 @@ -119,7 +117,7 @@ enum ps3_reg_type {
54210  int ps3_repository_read_dev_str(unsigned int bus_index,
54211         unsigned int dev_index, const char *dev_str, u64 *value);
54212  int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index,
54213 -       unsigned int *dev_id);
54214 +       u64 *dev_id);
54215  int ps3_repository_read_dev_type(unsigned int bus_index,
54216         unsigned int dev_index, enum ps3_dev_type *dev_type);
54217  int ps3_repository_read_dev_intr(unsigned int bus_index,
54218 @@ -138,21 +136,17 @@ int ps3_repository_read_dev_reg(unsigned
54219  /* repository bus enumerators */
54220  
54221  struct ps3_repository_device {
54222 -       enum ps3_bus_type bus_type;
54223         unsigned int bus_index;
54224 -       unsigned int bus_id;
54225 -       enum ps3_dev_type dev_type;
54226         unsigned int dev_index;
54227 -       unsigned int dev_id;
54228 +       enum ps3_bus_type bus_type;
54229 +       enum ps3_dev_type dev_type;
54230 +       u64 bus_id;
54231 +       u64 dev_id;
54232  };
54233  
54234 -static inline struct ps3_repository_device *ps3_repository_bump_device(
54235 -       struct ps3_repository_device *repo)
54236 -{
54237 -       repo->dev_index++;
54238 -       return repo;
54239 -}
54240  int ps3_repository_find_device(struct ps3_repository_device *repo);
54241 +int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
54242 +                                    u64 bus_id, u64 dev_id);
54243  int ps3_repository_find_devices(enum ps3_bus_type bus_type,
54244         int (*callback)(const struct ps3_repository_device *repo));
54245  int ps3_repository_find_bus(enum ps3_bus_type bus_type, unsigned int from,
54246 @@ -186,10 +180,10 @@ int ps3_repository_read_stor_dev_region(
54247         unsigned int dev_index, unsigned int region_index,
54248         unsigned int *region_id, u64 *region_start, u64 *region_size);
54249  
54250 -/* repository pu and memory info */
54251 +/* repository logical pu and memory info */
54252  
54253 -int ps3_repository_read_num_pu(unsigned int *num_pu);
54254 -int ps3_repository_read_ppe_id(unsigned int *pu_index, unsigned int *ppe_id);
54255 +int ps3_repository_read_num_pu(u64 *num_pu);
54256 +int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id);
54257  int ps3_repository_read_rm_base(unsigned int ppe_id, u64 *rm_base);
54258  int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size);
54259  int ps3_repository_read_region_total(u64 *region_total);
54260 @@ -200,9 +194,15 @@ int ps3_repository_read_mm_info(u64 *rm_
54261  
54262  int ps3_repository_read_num_be(unsigned int *num_be);
54263  int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id);
54264 +int ps3_repository_read_be_id(u64 node_id, u64 *be_id);
54265  int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq);
54266  int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq);
54267  
54268 +/* repository performance monitor info */
54269 +
54270 +int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
54271 +       u64 *rights);
54272 +
54273  /* repository 'Other OS' area */
54274  
54275  int ps3_repository_read_boot_dat_addr(u64 *lpar_addr);
54276 Index: linux-2.6.24.7/arch/powerpc/platforms/ps3/repository.c
54277 ===================================================================
54278 --- linux-2.6.24.7.orig/arch/powerpc/platforms/ps3/repository.c
54279 +++ linux-2.6.24.7/arch/powerpc/platforms/ps3/repository.c
54280 @@ -33,7 +33,7 @@ enum ps3_lpar_id {
54281  };
54282  
54283  #define dump_field(_a, _b) _dump_field(_a, _b, __func__, __LINE__)
54284 -static void _dump_field(const char *hdr, u64 n, const char* func, int line)
54285 +static void _dump_field(const char *hdr, u64 n, const char *func, int line)
54286  {
54287  #if defined(DEBUG)
54288         char s[16];
54289 @@ -50,8 +50,8 @@ static void _dump_field(const char *hdr,
54290  
54291  #define dump_node_name(_a, _b, _c, _d, _e) \
54292         _dump_node_name(_a, _b, _c, _d, _e, __func__, __LINE__)
54293 -static void _dump_node_name (unsigned int lpar_id, u64 n1, u64 n2, u64 n3,
54294 -       u64 n4, const char* func, int line)
54295 +static void _dump_node_name(unsigned int lpar_id, u64 n1, u64 n2, u64 n3,
54296 +       u64 n4, const char *func, int line)
54297  {
54298         pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id);
54299         _dump_field("n1: ", n1, func, line);
54300 @@ -63,7 +63,7 @@ static void _dump_node_name (unsigned in
54301  #define dump_node(_a, _b, _c, _d, _e, _f, _g) \
54302         _dump_node(_a, _b, _c, _d, _e, _f, _g, __func__, __LINE__)
54303  static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
54304 -       u64 v1, u64 v2, const char* func, int line)
54305 +       u64 v1, u64 v2, const char *func, int line)
54306  {
54307         pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id);
54308         _dump_field("n1: ", n1, func, line);
54309 @@ -165,21 +165,18 @@ int ps3_repository_read_bus_str(unsigned
54310                 make_first_field("bus", bus_index),
54311                 make_field(bus_str, 0),
54312                 0, 0,
54313 -               value, 0);
54314 +               value, NULL);
54315  }
54316  
54317 -int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id)
54318 +int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id)
54319  {
54320         int result;
54321 -       u64 v1;
54322 -       u64 v2; /* unused */
54323  
54324         result = read_node(PS3_LPAR_ID_PME,
54325                 make_first_field("bus", bus_index),
54326                 make_field("id", 0),
54327                 0, 0,
54328 -               &v1, &v2);
54329 -       *bus_id = v1;
54330 +               bus_id, NULL);
54331         return result;
54332  }
54333  
54334 @@ -193,7 +190,7 @@ int ps3_repository_read_bus_type(unsigne
54335                 make_first_field("bus", bus_index),
54336                 make_field("type", 0),
54337                 0, 0,
54338 -               &v1, 0);
54339 +               &v1, NULL);
54340         *bus_type = v1;
54341         return result;
54342  }
54343 @@ -208,7 +205,7 @@ int ps3_repository_read_bus_num_dev(unsi
54344                 make_first_field("bus", bus_index),
54345                 make_field("num_dev", 0),
54346                 0, 0,
54347 -               &v1, 0);
54348 +               &v1, NULL);
54349         *num_dev = v1;
54350         return result;
54351  }
54352 @@ -221,22 +218,20 @@ int ps3_repository_read_dev_str(unsigned
54353                 make_field("dev", dev_index),
54354                 make_field(dev_str, 0),
54355                 0,
54356 -               value, 0);
54357 +               value, NULL);
54358  }
54359  
54360  int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index,
54361 -       unsigned int *dev_id)
54362 +       u64 *dev_id)
54363  {
54364         int result;
54365 -       u64 v1;
54366  
54367         result = read_node(PS3_LPAR_ID_PME,
54368                 make_first_field("bus", bus_index),
54369                 make_field("dev", dev_index),
54370                 make_field("id", 0),
54371                 0,
54372 -               &v1, 0);
54373 -       *dev_id = v1;
54374 +               dev_id, NULL);
54375         return result;
54376  }
54377  
54378 @@ -251,14 +246,14 @@ int ps3_repository_read_dev_type(unsigne
54379                 make_field("dev", dev_index),
54380                 make_field("type", 0),
54381                 0,
54382 -               &v1, 0);
54383 +               &v1, NULL);
54384         *dev_type = v1;
54385         return result;
54386  }
54387  
54388  int ps3_repository_read_dev_intr(unsigned int bus_index,
54389         unsigned int dev_index, unsigned int intr_index,
54390 -       enum ps3_interrupt_type *intr_type, unsigned int* interrupt_id)
54391 +       enum ps3_interrupt_type *intr_type, unsigned int *interrupt_id)
54392  {
54393         int result;
54394         u64 v1;
54395 @@ -287,7 +282,7 @@ int ps3_repository_read_dev_reg_type(uns
54396                 make_field("dev", dev_index),
54397                 make_field("reg", reg_index),
54398                 make_field("type", 0),
54399 -               &v1, 0);
54400 +               &v1, NULL);
54401         *reg_type = v1;
54402         return result;
54403  }
54404 @@ -332,7 +327,7 @@ int ps3_repository_find_device(struct ps
54405                 return result;
54406         }
54407  
54408 -       pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %u, num_dev %u\n",
54409 +       pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %lu, num_dev %u\n",
54410                 __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id,
54411                 num_dev);
54412  
54413 @@ -349,47 +344,95 @@ int ps3_repository_find_device(struct ps
54414                 return result;
54415         }
54416  
54417 -       if (tmp.bus_type == PS3_BUS_TYPE_STORAGE) {
54418 -               /*
54419 -                * A storage device may show up in the repository before the
54420 -                * hypervisor has finished probing its type and regions
54421 -                */
54422 -               unsigned int num_regions;
54423 -
54424 -               if (tmp.dev_type == PS3_DEV_TYPE_STOR_DUMMY) {
54425 -                       pr_debug("%s:%u storage device not ready\n", __func__,
54426 -                                __LINE__);
54427 -                       return -ENODEV;
54428 -               }
54429 +       result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index,
54430 +               &tmp.dev_id);
54431  
54432 -               result = ps3_repository_read_stor_dev_num_regions(tmp.bus_index,
54433 -                                                                 tmp.dev_index,
54434 -                                                                 &num_regions);
54435 +       if (result) {
54436 +               pr_debug("%s:%d ps3_repository_read_dev_id failed\n", __func__,
54437 +               __LINE__);
54438 +               return result;
54439 +       }
54440 +
54441 +       pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %lu\n",
54442 +               __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
54443 +
54444 +       *repo = tmp;
54445 +       return 0;
54446 +}
54447 +
54448 +int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
54449 +                                    u64 bus_id, u64 dev_id)
54450 +{
54451 +       int result = -ENODEV;
54452 +       struct ps3_repository_device tmp;
54453 +       unsigned int num_dev;
54454 +
54455 +       pr_debug(" -> %s:%u: find device by id %lu:%lu\n", __func__, __LINE__,
54456 +                bus_id, dev_id);
54457 +
54458 +       for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) {
54459 +               result = ps3_repository_read_bus_id(tmp.bus_index,
54460 +                                                   &tmp.bus_id);
54461                 if (result) {
54462 -                       pr_debug("%s:%d read_stor_dev_num_regions failed\n",
54463 -                                __func__, __LINE__);
54464 +                       pr_debug("%s:%u read_bus_id(%u) failed\n", __func__,
54465 +                                __LINE__, tmp.bus_index);
54466                         return result;
54467                 }
54468  
54469 -               if (!num_regions) {
54470 -                       pr_debug("%s:%u storage device has no regions yet\n",
54471 -                                __func__, __LINE__);
54472 -                       return -ENODEV;
54473 -               }
54474 +               if (tmp.bus_id == bus_id)
54475 +                       goto found_bus;
54476 +
54477 +               pr_debug("%s:%u: skip, bus_id %lu\n", __func__, __LINE__,
54478 +                        tmp.bus_id);
54479         }
54480 +       pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__);
54481 +       return result;
54482  
54483 -       result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index,
54484 -               &tmp.dev_id);
54485 +found_bus:
54486 +       result = ps3_repository_read_bus_type(tmp.bus_index, &tmp.bus_type);
54487 +       if (result) {
54488 +               pr_debug("%s:%u read_bus_type(%u) failed\n", __func__,
54489 +                        __LINE__, tmp.bus_index);
54490 +               return result;
54491 +       }
54492  
54493 +       result = ps3_repository_read_bus_num_dev(tmp.bus_index, &num_dev);
54494         if (result) {
54495 -               pr_debug("%s:%d ps3_repository_read_dev_id failed\n", __func__,
54496 -               __LINE__);
54497 +               pr_debug("%s:%u read_bus_num_dev failed\n", __func__,
54498 +                        __LINE__);
54499                 return result;
54500         }
54501  
54502 -       pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %u\n",
54503 -               __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
54504 +       for (tmp.dev_index = 0; tmp.dev_index < num_dev; tmp.dev_index++) {
54505 +               result = ps3_repository_read_dev_id(tmp.bus_index,
54506 +                                                   tmp.dev_index,
54507 +                                                   &tmp.dev_id);
54508 +               if (result) {
54509 +                       pr_debug("%s:%u read_dev_id(%u:%u) failed\n", __func__,
54510 +                                __LINE__, tmp.bus_index, tmp.dev_index);
54511 +                       return result;
54512 +               }
54513 +
54514 +               if (tmp.dev_id == dev_id)
54515 +                       goto found_dev;
54516 +
54517 +               pr_debug("%s:%u: skip, dev_id %lu\n", __func__, __LINE__,
54518 +                        tmp.dev_id);
54519 +       }
54520 +       pr_debug(" <- %s:%u: dev not found\n", __func__, __LINE__);
54521 +       return result;
54522 +
54523 +found_dev:
54524 +       result = ps3_repository_read_dev_type(tmp.bus_index, tmp.dev_index,
54525 +                                             &tmp.dev_type);
54526 +       if (result) {
54527 +               pr_debug("%s:%u read_dev_type failed\n", __func__, __LINE__);
54528 +               return result;
54529 +       }
54530  
54531 +       pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%lu:%lu)\n",
54532 +                __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index,
54533 +                tmp.dev_index, tmp.bus_id, tmp.dev_id);
54534         *repo = tmp;
54535         return 0;
54536  }
54537 @@ -402,50 +445,34 @@ int __devinit ps3_repository_find_device
54538  
54539         pr_debug(" -> %s:%d: find bus_type %u\n", __func__, __LINE__, bus_type);
54540  
54541 -       for (repo.bus_index = 0; repo.bus_index < 10; repo.bus_index++) {
54542 +       repo.bus_type = bus_type;
54543 +       result = ps3_repository_find_bus(repo.bus_type, 0, &repo.bus_index);
54544 +       if (result) {
54545 +               pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__);
54546 +               return result;
54547 +       }
54548  
54549 -               result = ps3_repository_read_bus_type(repo.bus_index,
54550 -                       &repo.bus_type);
54551 +       result = ps3_repository_read_bus_id(repo.bus_index, &repo.bus_id);
54552 +       if (result) {
54553 +               pr_debug("%s:%d read_bus_id(%u) failed\n", __func__, __LINE__,
54554 +                        repo.bus_index);
54555 +               return result;
54556 +       }
54557  
54558 -               if (result) {
54559 -                       pr_debug("%s:%d read_bus_type(%u) failed\n",
54560 -                               __func__, __LINE__, repo.bus_index);
54561 +       for (repo.dev_index = 0; ; repo.dev_index++) {
54562 +               result = ps3_repository_find_device(&repo);
54563 +               if (result == -ENODEV) {
54564 +                       result = 0;
54565 +                       break;
54566 +               } else if (result)
54567                         break;
54568 -               }
54569 -
54570 -               if (repo.bus_type != bus_type) {
54571 -                       pr_debug("%s:%d: skip, bus_type %u\n", __func__,
54572 -                               __LINE__, repo.bus_type);
54573 -                       continue;
54574 -               }
54575 -
54576 -               result = ps3_repository_read_bus_id(repo.bus_index,
54577 -                       &repo.bus_id);
54578  
54579 +               result = callback(&repo);
54580                 if (result) {
54581 -                       pr_debug("%s:%d read_bus_id(%u) failed\n",
54582 -                               __func__, __LINE__, repo.bus_index);
54583 -                       continue;
54584 -               }
54585 -
54586 -               for (repo.dev_index = 0; ; repo.dev_index++) {
54587 -                       result = ps3_repository_find_device(&repo);
54588 -
54589 -                       if (result == -ENODEV) {
54590 -                               result = 0;
54591 -                               break;
54592 -                       } else if (result)
54593 -                               break;
54594 -
54595 -                       result = callback(&repo);
54596 -
54597 -                       if (result) {
54598 -                               pr_debug("%s:%d: abort at callback\n", __func__,
54599 -                                       __LINE__);
54600 -                               break;
54601 -                       }
54602 +                       pr_debug("%s:%d: abort at callback\n", __func__,
54603 +                               __LINE__);
54604 +                       break;
54605                 }
54606 -               break;
54607         }
54608  
54609         pr_debug(" <- %s:%d\n", __func__, __LINE__);
54610 @@ -561,7 +588,7 @@ int ps3_repository_read_stor_dev_port(un
54611                 make_first_field("bus", bus_index),
54612                 make_field("dev", dev_index),
54613                 make_field("port", 0),
54614 -               0, port, 0);
54615 +               0, port, NULL);
54616  }
54617  
54618  int ps3_repository_read_stor_dev_blk_size(unsigned int bus_index,
54619 @@ -571,7 +598,7 @@ int ps3_repository_read_stor_dev_blk_siz
54620                 make_first_field("bus", bus_index),
54621                 make_field("dev", dev_index),
54622                 make_field("blk_size", 0),
54623 -               0, blk_size, 0);
54624 +               0, blk_size, NULL);
54625  }
54626  
54627  int ps3_repository_read_stor_dev_num_blocks(unsigned int bus_index,
54628 @@ -581,7 +608,7 @@ int ps3_repository_read_stor_dev_num_blo
54629                 make_first_field("bus", bus_index),
54630                 make_field("dev", dev_index),
54631                 make_field("n_blocks", 0),
54632 -               0, num_blocks, 0);
54633 +               0, num_blocks, NULL);
54634  }
54635  
54636  int ps3_repository_read_stor_dev_num_regions(unsigned int bus_index,
54637 @@ -594,7 +621,7 @@ int ps3_repository_read_stor_dev_num_reg
54638                 make_first_field("bus", bus_index),
54639                 make_field("dev", dev_index),
54640                 make_field("n_regs", 0),
54641 -               0, &v1, 0);
54642 +               0, &v1, NULL);
54643         *num_regions = v1;
54644         return result;
54645  }
54646 @@ -611,7 +638,7 @@ int ps3_repository_read_stor_dev_region_
54647             make_field("dev", dev_index),
54648             make_field("region", region_index),
54649             make_field("id", 0),
54650 -           &v1, 0);
54651 +           &v1, NULL);
54652         *region_id = v1;
54653         return result;
54654  }
54655 @@ -624,7 +651,7 @@ int ps3_repository_read_stor_dev_region_
54656             make_field("dev", dev_index),
54657             make_field("region", region_index),
54658             make_field("size", 0),
54659 -           region_size, 0);
54660 +           region_size, NULL);
54661  }
54662  
54663  int ps3_repository_read_stor_dev_region_start(unsigned int bus_index,
54664 @@ -635,7 +662,7 @@ int ps3_repository_read_stor_dev_region_
54665             make_field("dev", dev_index),
54666             make_field("region", region_index),
54667             make_field("start", 0),
54668 -           region_start, 0);
54669 +           region_start, NULL);
54670  }
54671  
54672  int ps3_repository_read_stor_dev_info(unsigned int bus_index,
54673 @@ -684,6 +711,35 @@ int ps3_repository_read_stor_dev_region(
54674         return result;
54675  }
54676  
54677 +/**
54678 + * ps3_repository_read_num_pu - Number of logical PU processors for this lpar.
54679 + */
54680 +
54681 +int ps3_repository_read_num_pu(u64 *num_pu)
54682 +{
54683 +       *num_pu = 0;
54684 +       return read_node(PS3_LPAR_ID_CURRENT,
54685 +                          make_first_field("bi", 0),
54686 +                          make_field("pun", 0),
54687 +                          0, 0,
54688 +                          num_pu, NULL);
54689 +}
54690 +
54691 +/**
54692 + * ps3_repository_read_pu_id - Read the logical PU id.
54693 + * @pu_index: Zero based index.
54694 + * @pu_id: The logical PU id.
54695 + */
54696 +
54697 +int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id)
54698 +{
54699 +       return read_node(PS3_LPAR_ID_CURRENT,
54700 +               make_first_field("bi", 0),
54701 +               make_field("pu", pu_index),
54702 +               0, 0,
54703 +               pu_id, NULL);
54704 +}
54705 +
54706  int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size)
54707  {
54708         return read_node(PS3_LPAR_ID_CURRENT,
54709 @@ -691,7 +747,7 @@ int ps3_repository_read_rm_size(unsigned
54710                 make_field("pu", 0),
54711                 ppe_id,
54712                 make_field("rm_size", 0),
54713 -               rm_size, 0);
54714 +               rm_size, NULL);
54715  }
54716  
54717  int ps3_repository_read_region_total(u64 *region_total)
54718 @@ -700,7 +756,7 @@ int ps3_repository_read_region_total(u64
54719                 make_first_field("bi", 0),
54720                 make_field("rgntotal", 0),
54721                 0, 0,
54722 -               region_total, 0);
54723 +               region_total, NULL);
54724  }
54725  
54726  /**
54727 @@ -736,7 +792,7 @@ int ps3_repository_read_num_spu_reserved
54728                 make_first_field("bi", 0),
54729                 make_field("spun", 0),
54730                 0, 0,
54731 -               &v1, 0);
54732 +               &v1, NULL);
54733         *num_spu_reserved = v1;
54734         return result;
54735  }
54736 @@ -755,7 +811,7 @@ int ps3_repository_read_num_spu_resource
54737                 make_first_field("bi", 0),
54738                 make_field("spursvn", 0),
54739                 0, 0,
54740 -               &v1, 0);
54741 +               &v1, NULL);
54742         *num_resource_id = v1;
54743         return result;
54744  }
54745 @@ -768,7 +824,7 @@ int ps3_repository_read_num_spu_resource
54746   */
54747  
54748  int ps3_repository_read_spu_resource_id(unsigned int res_index,
54749 -       enum ps3_spu_resource_type* resource_type, unsigned int *resource_id)
54750 +       enum ps3_spu_resource_type *resource_type, unsigned int *resource_id)
54751  {
54752         int result;
54753         u64 v1;
54754 @@ -785,14 +841,14 @@ int ps3_repository_read_spu_resource_id(
54755         return result;
54756  }
54757  
54758 -int ps3_repository_read_boot_dat_address(u64 *address)
54759 +static int ps3_repository_read_boot_dat_address(u64 *address)
54760  {
54761         return read_node(PS3_LPAR_ID_CURRENT,
54762                 make_first_field("bi", 0),
54763                 make_field("boot_dat", 0),
54764                 make_field("address", 0),
54765                 0,
54766 -               address, 0);
54767 +               address, NULL);
54768  }
54769  
54770  int ps3_repository_read_boot_dat_size(unsigned int *size)
54771 @@ -805,7 +861,7 @@ int ps3_repository_read_boot_dat_size(un
54772                 make_field("boot_dat", 0),
54773                 make_field("size", 0),
54774                 0,
54775 -               &v1, 0);
54776 +               &v1, NULL);
54777         *size = v1;
54778         return result;
54779  }
54780 @@ -820,7 +876,7 @@ int ps3_repository_read_vuart_av_port(un
54781                 make_field("vir_uart", 0),
54782                 make_field("port", 0),
54783                 make_field("avset", 0),
54784 -               &v1, 0);
54785 +               &v1, NULL);
54786         *port = v1;
54787         return result;
54788  }
54789 @@ -835,7 +891,7 @@ int ps3_repository_read_vuart_sysmgr_por
54790                 make_field("vir_uart", 0),
54791                 make_field("port", 0),
54792                 make_field("sysmgr", 0),
54793 -               &v1, 0);
54794 +               &v1, NULL);
54795         *port = v1;
54796         return result;
54797  }
54798 @@ -856,6 +912,10 @@ int ps3_repository_read_boot_dat_info(u6
54799                 : ps3_repository_read_boot_dat_size(size);
54800  }
54801  
54802 +/**
54803 + * ps3_repository_read_num_be - Number of physical BE processors in the system.
54804 + */
54805 +
54806  int ps3_repository_read_num_be(unsigned int *num_be)
54807  {
54808         int result;
54809 @@ -866,11 +926,17 @@ int ps3_repository_read_num_be(unsigned 
54810                 0,
54811                 0,
54812                 0,
54813 -               &v1, 0);
54814 +               &v1, NULL);
54815         *num_be = v1;
54816         return result;
54817  }
54818  
54819 +/**
54820 + * ps3_repository_read_be_node_id - Read the physical BE processor node id.
54821 + * @be_index: Zero based index.
54822 + * @node_id: The BE processor node id.
54823 + */
54824 +
54825  int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id)
54826  {
54827         return read_node(PS3_LPAR_ID_PME,
54828 @@ -878,7 +944,23 @@ int ps3_repository_read_be_node_id(unsig
54829                 0,
54830                 0,
54831                 0,
54832 -               node_id, 0);
54833 +               node_id, NULL);
54834 +}
54835 +
54836 +/**
54837 + * ps3_repository_read_be_id - Read the physical BE processor id.
54838 + * @node_id: The BE processor node id.
54839 + * @be_id: The BE processor id.
54840 + */
54841 +
54842 +int ps3_repository_read_be_id(u64 node_id, u64 *be_id)
54843 +{
54844 +       return read_node(PS3_LPAR_ID_PME,
54845 +               make_first_field("be", 0),
54846 +               node_id,
54847 +               0,
54848 +               0,
54849 +               be_id, NULL);
54850  }
54851  
54852  int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq)
54853 @@ -888,7 +970,7 @@ int ps3_repository_read_tb_freq(u64 node
54854                 node_id,
54855                 make_field("clock", 0),
54856                 0,
54857 -               tb_freq, 0);
54858 +               tb_freq, NULL);
54859  }
54860  
54861  int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq)
54862 @@ -897,11 +979,29 @@ int ps3_repository_read_be_tb_freq(unsig
54863         u64 node_id;
54864  
54865         *tb_freq = 0;
54866 -       result = ps3_repository_read_be_node_id(0, &node_id);
54867 +       result = ps3_repository_read_be_node_id(be_index, &node_id);
54868         return result ? result
54869                 : ps3_repository_read_tb_freq(node_id, tb_freq);
54870  }
54871  
54872 +int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
54873 +       u64 *rights)
54874 +{
54875 +       int result;
54876 +       u64 node_id;
54877 +
54878 +       *lpar = 0;
54879 +       *rights = 0;
54880 +       result = ps3_repository_read_be_node_id(be_index, &node_id);
54881 +       return result ? result
54882 +               : read_node(PS3_LPAR_ID_PME,
54883 +                           make_first_field("be", 0),
54884 +                           node_id,
54885 +                           make_field("lpm", 0),
54886 +                           make_field("priv", 0),
54887 +                           lpar, rights);
54888 +}
54889 +
54890  #if defined(DEBUG)
54891  
54892  int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
54893 @@ -1034,7 +1134,7 @@ static int dump_device_info(struct ps3_r
54894                         continue;
54895                 }
54896  
54897 -               pr_debug("%s:%d  (%u:%u): dev_type %u, dev_id %u\n", __func__,
54898 +               pr_debug("%s:%d  (%u:%u): dev_type %u, dev_id %lu\n", __func__,
54899                         __LINE__, repo->bus_index, repo->dev_index,
54900                         repo->dev_type, repo->dev_id);
54901  
54902 @@ -1091,7 +1191,7 @@ int ps3_repository_dump_bus_info(void)
54903                         continue;
54904                 }
54905  
54906 -               pr_debug("%s:%d bus_%u: bus_type %u, bus_id %u, num_dev %u\n",
54907 +               pr_debug("%s:%d bus_%u: bus_type %u, bus_id %lu, num_dev %u\n",
54908                         __func__, __LINE__, repo.bus_index, repo.bus_type,
54909                         repo.bus_id, num_dev);
54910  
54911 Index: linux-2.6.24.7/arch/powerpc/platforms/ps3/spu.c
54912 ===================================================================
54913 --- linux-2.6.24.7.orig/arch/powerpc/platforms/ps3/spu.c
54914 +++ linux-2.6.24.7/arch/powerpc/platforms/ps3/spu.c
54915 @@ -28,6 +28,7 @@
54916  #include <asm/spu_priv1.h>
54917  #include <asm/lv1call.h>
54918  
54919 +#include "../cell/spufs/spufs.h"
54920  #include "platform.h"
54921  
54922  /* spu_management_ops */
54923 @@ -419,10 +420,34 @@ static int ps3_init_affinity(void)
54924         return 0;
54925  }
54926  
54927 +/**
54928 + * ps3_enable_spu - Enable SPU run control.
54929 + *
54930 + * An outstanding enhancement for the PS3 would be to add a guard to check
54931 + * for incorrect access to the spu problem state when the spu context is
54932 + * disabled.  This check could be implemented with a flag added to the spu
54933 + * context that would inhibit mapping problem state pages, and a routine
54934 + * to unmap spu problem state pages.  When the spu is enabled with
54935 + * ps3_enable_spu() the flag would be set allowing pages to be mapped,
54936 + * and when the spu is disabled with ps3_disable_spu() the flag would be
54937 + * cleared and the mapped problem state pages would be unmapped.
54938 + */
54939 +
54940 +static void ps3_enable_spu(struct spu_context *ctx)
54941 +{
54942 +}
54943 +
54944 +static void ps3_disable_spu(struct spu_context *ctx)
54945 +{
54946 +       ctx->ops->runcntl_stop(ctx);
54947 +}
54948 +
54949  const struct spu_management_ops spu_management_ps3_ops = {
54950         .enumerate_spus = ps3_enumerate_spus,
54951         .create_spu = ps3_create_spu,
54952         .destroy_spu = ps3_destroy_spu,
54953 +       .enable_spu = ps3_enable_spu,
54954 +       .disable_spu = ps3_disable_spu,
54955         .init_affinity = ps3_init_affinity,
54956  };
54957  
54958 @@ -505,8 +530,6 @@ static void mfc_sr1_set(struct spu *spu,
54959         static const u64 allowed = ~(MFC_STATE1_LOCAL_STORAGE_DECODE_MASK
54960                 | MFC_STATE1_PROBLEM_STATE_MASK);
54961  
54962 -       sr1 |= MFC_STATE1_MASTER_RUN_CONTROL_MASK;
54963 -
54964         BUG_ON((sr1 & allowed) != (spu_pdata(spu)->cache.sr1 & allowed));
54965  
54966         spu_pdata(spu)->cache.sr1 = sr1;
54967 Index: linux-2.6.24.7/arch/powerpc/platforms/ps3/system-bus.c
54968 ===================================================================
54969 --- linux-2.6.24.7.orig/arch/powerpc/platforms/ps3/system-bus.c
54970 +++ linux-2.6.24.7/arch/powerpc/platforms/ps3/system-bus.c
54971 @@ -42,8 +42,8 @@ struct {
54972         int gpu;
54973  } static usage_hack;
54974  
54975 -static int ps3_is_device(struct ps3_system_bus_device *dev,
54976 -                        unsigned int bus_id, unsigned int dev_id)
54977 +static int ps3_is_device(struct ps3_system_bus_device *dev, u64 bus_id,
54978 +                        u64 dev_id)
54979  {
54980         return dev->bus_id == bus_id && dev->dev_id == dev_id;
54981  }
54982 @@ -182,8 +182,8 @@ int ps3_open_hv_device(struct ps3_system
54983         case PS3_MATCH_ID_SYSTEM_MANAGER:
54984                 pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
54985                         __LINE__, dev->match_id);
54986 -               pr_debug("%s:%d: bus_id: %u\n", __func__,
54987 -                       __LINE__, dev->bus_id);
54988 +               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
54989 +                       dev->bus_id);
54990                 BUG();
54991                 return -EINVAL;
54992  
54993 @@ -220,8 +220,8 @@ int ps3_close_hv_device(struct ps3_syste
54994         case PS3_MATCH_ID_SYSTEM_MANAGER:
54995                 pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
54996                         __LINE__, dev->match_id);
54997 -               pr_debug("%s:%d: bus_id: %u\n", __func__,
54998 -                       __LINE__, dev->bus_id);
54999 +               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
55000 +                       dev->bus_id);
55001                 BUG();
55002                 return -EINVAL;
55003  
55004 @@ -240,7 +240,7 @@ EXPORT_SYMBOL_GPL(ps3_close_hv_device);
55005  static void _dump_mmio_region(const struct ps3_mmio_region* r,
55006         const char* func, int line)
55007  {
55008 -       pr_debug("%s:%d: dev       %u:%u\n", func, line, r->dev->bus_id,
55009 +       pr_debug("%s:%d: dev       %lu:%lu\n", func, line, r->dev->bus_id,
55010                 r->dev->dev_id);
55011         pr_debug("%s:%d: bus_addr  %lxh\n", func, line, r->bus_addr);
55012         pr_debug("%s:%d: len       %lxh\n", func, line, r->len);
55013 @@ -715,6 +715,7 @@ int ps3_system_bus_device_register(struc
55014         static unsigned int dev_ioc0_count;
55015         static unsigned int dev_sb_count;
55016         static unsigned int dev_vuart_count;
55017 +       static unsigned int dev_lpm_count;
55018  
55019         if (!dev->core.parent)
55020                 dev->core.parent = &ps3_system_bus;
55021 @@ -737,6 +738,10 @@ int ps3_system_bus_device_register(struc
55022                 snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
55023                         "vuart_%02x", ++dev_vuart_count);
55024                 break;
55025 +       case PS3_DEVICE_TYPE_LPM:
55026 +               snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
55027 +                       "lpm_%02x", ++dev_lpm_count);
55028 +               break;
55029         default:
55030                 BUG();
55031         };
55032 Index: linux-2.6.24.7/arch/powerpc/platforms/pseries/eeh.c
55033 ===================================================================
55034 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pseries/eeh.c
55035 +++ linux-2.6.24.7/arch/powerpc/platforms/pseries/eeh.c
55036 @@ -29,6 +29,8 @@
55037  #include <linux/rbtree.h>
55038  #include <linux/seq_file.h>
55039  #include <linux/spinlock.h>
55040 +#include <linux/of.h>
55041 +
55042  #include <asm/atomic.h>
55043  #include <asm/eeh.h>
55044  #include <asm/eeh_event.h>
55045 @@ -169,7 +171,6 @@ static void rtas_slot_error_detail(struc
55046   */
55047  static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
55048  {
55049 -       struct device_node *dn;
55050         struct pci_dev *dev = pdn->pcidev;
55051         u32 cfg;
55052         int cap, i;
55053 @@ -243,12 +244,12 @@ static size_t gather_pci_data(struct pci
55054  
55055         /* Gather status on devices under the bridge */
55056         if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
55057 -               dn = pdn->node->child;
55058 -               while (dn) {
55059 +               struct device_node *dn;
55060 +
55061 +               for_each_child_of_node(pdn->node, dn) {
55062                         pdn = PCI_DN(dn);
55063                         if (pdn)
55064                                 n += gather_pci_data(pdn, buf+n, len-n);
55065 -                       dn = dn->sibling;
55066                 }
55067         }
55068  
55069 @@ -372,7 +373,7 @@ struct device_node * find_device_pe(stru
55070         return dn;
55071  }
55072  
55073 -/** Mark all devices that are peers of this device as failed.
55074 +/** Mark all devices that are children of this device as failed.
55075   *  Mark the device driver too, so that it can see the failure
55076   *  immediately; this is critical, since some drivers poll
55077   *  status registers in interrupts ... If a driver is polling,
55078 @@ -380,9 +381,11 @@ struct device_node * find_device_pe(stru
55079   *  an interrupt context, which is bad.
55080   */
55081  
55082 -static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
55083 +static void __eeh_mark_slot(struct device_node *parent, int mode_flag)
55084  {
55085 -       while (dn) {
55086 +       struct device_node *dn;
55087 +
55088 +       for_each_child_of_node(parent, dn) {
55089                 if (PCI_DN(dn)) {
55090                         /* Mark the pci device driver too */
55091                         struct pci_dev *dev = PCI_DN(dn)->pcidev;
55092 @@ -392,10 +395,8 @@ static void __eeh_mark_slot (struct devi
55093                         if (dev && dev->driver)
55094                                 dev->error_state = pci_channel_io_frozen;
55095  
55096 -                       if (dn->child)
55097 -                               __eeh_mark_slot (dn->child, mode_flag);
55098 +                       __eeh_mark_slot(dn, mode_flag);
55099                 }
55100 -               dn = dn->sibling;
55101         }
55102  }
55103  
55104 @@ -415,19 +416,19 @@ void eeh_mark_slot (struct device_node *
55105         if (dev)
55106                 dev->error_state = pci_channel_io_frozen;
55107  
55108 -       __eeh_mark_slot (dn->child, mode_flag);
55109 +       __eeh_mark_slot(dn, mode_flag);
55110  }
55111  
55112 -static void __eeh_clear_slot (struct device_node *dn, int mode_flag)
55113 +static void __eeh_clear_slot(struct device_node *parent, int mode_flag)
55114  {
55115 -       while (dn) {
55116 +       struct device_node *dn;
55117 +
55118 +       for_each_child_of_node(parent, dn) {
55119                 if (PCI_DN(dn)) {
55120                         PCI_DN(dn)->eeh_mode &= ~mode_flag;
55121                         PCI_DN(dn)->eeh_check_count = 0;
55122 -                       if (dn->child)
55123 -                               __eeh_clear_slot (dn->child, mode_flag);
55124 +                       __eeh_clear_slot(dn, mode_flag);
55125                 }
55126 -               dn = dn->sibling;
55127         }
55128  }
55129  
55130 @@ -444,7 +445,7 @@ void eeh_clear_slot (struct device_node 
55131  
55132         PCI_DN(dn)->eeh_mode &= ~mode_flag;
55133         PCI_DN(dn)->eeh_check_count = 0;
55134 -       __eeh_clear_slot (dn->child, mode_flag);
55135 +       __eeh_clear_slot(dn, mode_flag);
55136         spin_unlock_irqrestore(&confirm_error_lock, flags);
55137  }
55138  
55139 @@ -480,6 +481,7 @@ int eeh_dn_check_failure(struct device_n
55140                 no_dn++;
55141                 return 0;
55142         }
55143 +       dn = find_device_pe(dn);
55144         pdn = PCI_DN(dn);
55145  
55146         /* Access to IO BARs might get this far and still not want checking. */
55147 @@ -545,7 +547,7 @@ int eeh_dn_check_failure(struct device_n
55148  
55149         /* Note that config-io to empty slots may fail;
55150          * they are empty when they don't have children. */
55151 -       if ((rets[0] == 5) && (dn->child == NULL)) {
55152 +       if ((rets[0] == 5) && (rets[2] == 0) && (dn->child == NULL)) {
55153                 false_positives++;
55154                 pdn->eeh_false_positives ++;
55155                 rc = 0;
55156 @@ -848,11 +850,8 @@ void eeh_restore_bars(struct pci_dn *pdn
55157         if ((pdn->eeh_mode & EEH_MODE_SUPPORTED) && !IS_BRIDGE(pdn->class_code))
55158                 __restore_bars (pdn);
55159  
55160 -       dn = pdn->node->child;
55161 -       while (dn) {
55162 +       for_each_child_of_node(pdn->node, dn)
55163                 eeh_restore_bars (PCI_DN(dn));
55164 -               dn = dn->sibling;
55165 -       }
55166  }
55167  
55168  /**
55169 @@ -1130,7 +1129,8 @@ static void eeh_add_device_early(struct 
55170  void eeh_add_device_tree_early(struct device_node *dn)
55171  {
55172         struct device_node *sib;
55173 -       for (sib = dn->child; sib; sib = sib->sibling)
55174 +
55175 +       for_each_child_of_node(dn, sib)
55176                 eeh_add_device_tree_early(sib);
55177         eeh_add_device_early(dn);
55178  }
55179 Index: linux-2.6.24.7/arch/powerpc/platforms/pseries/eeh_driver.c
55180 ===================================================================
55181 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pseries/eeh_driver.c
55182 +++ linux-2.6.24.7/arch/powerpc/platforms/pseries/eeh_driver.c
55183 @@ -310,8 +310,6 @@ struct pci_dn * handle_eeh_events (struc
55184         const char *location, *pci_str, *drv_str;
55185  
55186         frozen_dn = find_device_pe(event->dn);
55187 -       frozen_bus = pcibios_find_pci_bus(frozen_dn);
55188 -
55189         if (!frozen_dn) {
55190  
55191                 location = of_get_property(event->dn, "ibm,loc-code", NULL);
55192 @@ -321,6 +319,8 @@ struct pci_dn * handle_eeh_events (struc
55193                         location, pci_name(event->dev));
55194                 return NULL;
55195         }
55196 +
55197 +       frozen_bus = pcibios_find_pci_bus(frozen_dn);
55198         location = of_get_property(frozen_dn, "ibm,loc-code", NULL);
55199         location = location ? location : "unknown";
55200  
55201 @@ -354,13 +354,6 @@ struct pci_dn * handle_eeh_events (struc
55202         if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
55203                 goto excess_failures;
55204  
55205 -       /* Get the current PCI slot state. */
55206 -       rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000);
55207 -       if (rc < 0) {
55208 -               printk(KERN_WARNING "EEH: Permanent failure\n");
55209 -               goto hard_fail;
55210 -       }
55211 -
55212         printk(KERN_WARNING
55213            "EEH: This PCI device has failed %d times in the last hour:\n",
55214                 frozen_pdn->eeh_freeze_count);
55215 @@ -376,6 +369,14 @@ struct pci_dn * handle_eeh_events (struc
55216          */
55217         pci_walk_bus(frozen_bus, eeh_report_error, &result);
55218  
55219 +       /* Get the current PCI slot state. This can take a long time,
55220 +        * sometimes over 3 seconds for certain systems. */
55221 +       rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000);
55222 +       if (rc < 0) {
55223 +               printk(KERN_WARNING "EEH: Permanent failure\n");
55224 +               goto hard_fail;
55225 +       }
55226 +
55227         /* Since rtas may enable MMIO when posting the error log,
55228          * don't post the error log until after all dev drivers
55229          * have been informed.
55230 Index: linux-2.6.24.7/arch/powerpc/platforms/pseries/iommu.c
55231 ===================================================================
55232 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pseries/iommu.c
55233 +++ linux-2.6.24.7/arch/powerpc/platforms/pseries/iommu.c
55234 @@ -251,7 +251,7 @@ static void iommu_table_setparms(struct 
55235         const unsigned long *basep;
55236         const u32 *sizep;
55237  
55238 -       node = (struct device_node *)phb->arch_data;
55239 +       node = phb->dn;
55240  
55241         basep = of_get_property(node, "linux,tce-base", NULL);
55242         sizep = of_get_property(node, "linux,tce-size", NULL);
55243 @@ -296,11 +296,12 @@ static void iommu_table_setparms(struct 
55244  static void iommu_table_setparms_lpar(struct pci_controller *phb,
55245                                       struct device_node *dn,
55246                                       struct iommu_table *tbl,
55247 -                                     const void *dma_window)
55248 +                                     const void *dma_window,
55249 +                                     int bussubno)
55250  {
55251         unsigned long offset, size;
55252  
55253 -       tbl->it_busno  = PCI_DN(dn)->bussubno;
55254 +       tbl->it_busno  = bussubno;
55255         of_parse_dma_window(dn, dma_window, &tbl->it_index, &offset, &size);
55256  
55257         tbl->it_base   = 0;
55258 @@ -420,17 +421,10 @@ static void pci_dma_bus_setup_pSeriesLP(
55259             pdn->full_name, ppci->iommu_table);
55260  
55261         if (!ppci->iommu_table) {
55262 -               /* Bussubno hasn't been copied yet.
55263 -                * Do it now because iommu_table_setparms_lpar needs it.
55264 -                */
55265 -
55266 -               ppci->bussubno = bus->number;
55267 -
55268                 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
55269                                    ppci->phb->node);
55270 -
55271 -               iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window);
55272 -
55273 +               iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window,
55274 +                       bus->number);
55275                 ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node);
55276                 DBG("  created table: %p\n", ppci->iommu_table);
55277         }
55278 @@ -523,14 +517,10 @@ static void pci_dma_dev_setup_pSeriesLP(
55279  
55280         pci = PCI_DN(pdn);
55281         if (!pci->iommu_table) {
55282 -               /* iommu_table_setparms_lpar needs bussubno. */
55283 -               pci->bussubno = pci->phb->bus->number;
55284 -
55285                 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
55286                                    pci->phb->node);
55287 -
55288 -               iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window);
55289 -
55290 +               iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window,
55291 +                       pci->phb->bus->number);
55292                 pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
55293                 DBG("  created table: %p\n", pci->iommu_table);
55294         } else {
55295 @@ -556,7 +546,7 @@ static int iommu_reconfig_notifier(struc
55296         case PSERIES_RECONFIG_REMOVE:
55297                 if (pci && pci->iommu_table &&
55298                     of_get_property(np, "ibm,dma-window", NULL))
55299 -                       iommu_free_table(np);
55300 +                       iommu_free_table(pci->iommu_table, np->full_name);
55301                 break;
55302         default:
55303                 err = NOTIFY_DONE;
55304 Index: linux-2.6.24.7/arch/powerpc/platforms/pseries/pci_dlpar.c
55305 ===================================================================
55306 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pseries/pci_dlpar.c
55307 +++ linux-2.6.24.7/arch/powerpc/platforms/pseries/pci_dlpar.c
55308 @@ -83,7 +83,7 @@ EXPORT_SYMBOL_GPL(pcibios_remove_pci_dev
55309  
55310  /* Must be called before pci_bus_add_devices */
55311  void
55312 -pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus)
55313 +pcibios_fixup_new_pci_devices(struct pci_bus *bus)
55314  {
55315         struct pci_dev *dev;
55316  
55317 @@ -98,8 +98,6 @@ pcibios_fixup_new_pci_devices(struct pci
55318                         /* Fill device archdata and setup iommu table */
55319                         pcibios_setup_new_device(dev);
55320  
55321 -                       if(fix_bus)
55322 -                               pcibios_fixup_device_resources(dev, bus);
55323                         pci_read_irq_line(dev);
55324                         for (i = 0; i < PCI_NUM_RESOURCES; i++) {
55325                                 struct resource *r = &dev->resource[i];
55326 @@ -132,8 +130,8 @@ pcibios_pci_config_bridge(struct pci_dev
55327  
55328         pci_scan_child_bus(child_bus);
55329  
55330 -       /* Fixup new pci devices without touching bus struct */
55331 -       pcibios_fixup_new_pci_devices(child_bus, 0);
55332 +       /* Fixup new pci devices */
55333 +       pcibios_fixup_new_pci_devices(child_bus);
55334  
55335         /* Make the discovered devices available */
55336         pci_bus_add_devices(child_bus);
55337 @@ -169,7 +167,7 @@ pcibios_add_pci_devices(struct pci_bus *
55338                 /* use ofdt-based probe */
55339                 of_scan_bus(dn, bus);
55340                 if (!list_empty(&bus->devices)) {
55341 -                       pcibios_fixup_new_pci_devices(bus, 0);
55342 +                       pcibios_fixup_new_pci_devices(bus);
55343                         pci_bus_add_devices(bus);
55344                         eeh_add_device_tree_late(bus);
55345                 }
55346 @@ -178,7 +176,7 @@ pcibios_add_pci_devices(struct pci_bus *
55347                 slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
55348                 num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
55349                 if (num) {
55350 -                       pcibios_fixup_new_pci_devices(bus, 1);
55351 +                       pcibios_fixup_new_pci_devices(bus);
55352                         pci_bus_add_devices(bus);
55353                         eeh_add_device_tree_late(bus);
55354                 }
55355 @@ -208,7 +206,7 @@ struct pci_controller * __devinit init_p
55356                 eeh_add_device_tree_early(dn);
55357  
55358         scan_phb(phb);
55359 -       pcibios_fixup_new_pci_devices(phb->bus, 0);
55360 +       pcibios_fixup_new_pci_devices(phb->bus);
55361         pci_bus_add_devices(phb->bus);
55362         eeh_add_device_tree_late(phb->bus);
55363  
55364 Index: linux-2.6.24.7/arch/powerpc/platforms/pseries/plpar_wrappers.h
55365 ===================================================================
55366 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pseries/plpar_wrappers.h
55367 +++ linux-2.6.24.7/arch/powerpc/platforms/pseries/plpar_wrappers.h
55368 @@ -8,11 +8,6 @@ static inline long poll_pending(void)
55369         return plpar_hcall_norets(H_POLL_PENDING);
55370  }
55371  
55372 -static inline long prod_processor(void)
55373 -{
55374 -       return plpar_hcall_norets(H_PROD);
55375 -}
55376 -
55377  static inline long cede_processor(void)
55378  {
55379         return plpar_hcall_norets(H_CEDE);
55380 Index: linux-2.6.24.7/arch/powerpc/platforms/pseries/smp.c
55381 ===================================================================
55382 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pseries/smp.c
55383 +++ linux-2.6.24.7/arch/powerpc/platforms/pseries/smp.c
55384 @@ -46,6 +46,7 @@
55385  #include <asm/pSeries_reconfig.h>
55386  #include <asm/mpic.h>
55387  #include <asm/vdso_datapage.h>
55388 +#include <asm/cputhreads.h>
55389  
55390  #include "plpar_wrappers.h"
55391  #include "pseries.h"
55392 @@ -202,7 +203,7 @@ static int smp_pSeries_cpu_bootable(unsi
55393          */
55394         if (system_state < SYSTEM_RUNNING &&
55395             cpu_has_feature(CPU_FTR_SMT) &&
55396 -           !smt_enabled_at_boot && nr % 2 != 0)
55397 +           !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
55398                 return 0;
55399  
55400         return 1;
55401 Index: linux-2.6.24.7/arch/powerpc/platforms/pseries/xics.c
55402 ===================================================================
55403 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pseries/xics.c
55404 +++ linux-2.6.24.7/arch/powerpc/platforms/pseries/xics.c
55405 @@ -87,19 +87,25 @@ static int ibm_int_off;
55406  /* Direct HW low level accessors */
55407  
55408  
55409 -static inline unsigned int direct_xirr_info_get(int n_cpu)
55410 +static inline unsigned int direct_xirr_info_get(void)
55411  {
55412 -       return in_be32(&xics_per_cpu[n_cpu]->xirr.word);
55413 +       int cpu = smp_processor_id();
55414 +
55415 +       return in_be32(&xics_per_cpu[cpu]->xirr.word);
55416  }
55417  
55418 -static inline void direct_xirr_info_set(int n_cpu, int value)
55419 +static inline void direct_xirr_info_set(int value)
55420  {
55421 -       out_be32(&xics_per_cpu[n_cpu]->xirr.word, value);
55422 +       int cpu = smp_processor_id();
55423 +
55424 +       out_be32(&xics_per_cpu[cpu]->xirr.word, value);
55425  }
55426  
55427 -static inline void direct_cppr_info(int n_cpu, u8 value)
55428 +static inline void direct_cppr_info(u8 value)
55429  {
55430 -       out_8(&xics_per_cpu[n_cpu]->xirr.bytes[0], value);
55431 +       int cpu = smp_processor_id();
55432 +
55433 +       out_8(&xics_per_cpu[cpu]->xirr.bytes[0], value);
55434  }
55435  
55436  static inline void direct_qirr_info(int n_cpu, u8 value)
55437 @@ -111,7 +117,7 @@ static inline void direct_qirr_info(int 
55438  /* LPAR low level accessors */
55439  
55440  
55441 -static inline unsigned int lpar_xirr_info_get(int n_cpu)
55442 +static inline unsigned int lpar_xirr_info_get(void)
55443  {
55444         unsigned long lpar_rc;
55445         unsigned long return_value;
55446 @@ -122,7 +128,7 @@ static inline unsigned int lpar_xirr_inf
55447         return (unsigned int)return_value;
55448  }
55449  
55450 -static inline void lpar_xirr_info_set(int n_cpu, int value)
55451 +static inline void lpar_xirr_info_set(int value)
55452  {
55453         unsigned long lpar_rc;
55454         unsigned long val64 = value & 0xffffffff;
55455 @@ -133,7 +139,7 @@ static inline void lpar_xirr_info_set(in
55456                       val64);
55457  }
55458  
55459 -static inline void lpar_cppr_info(int n_cpu, u8 value)
55460 +static inline void lpar_cppr_info(u8 value)
55461  {
55462         unsigned long lpar_rc;
55463  
55464 @@ -275,21 +281,19 @@ static unsigned int xics_startup(unsigne
55465  
55466  static void xics_eoi_direct(unsigned int virq)
55467  {
55468 -       int cpu = smp_processor_id();
55469         unsigned int irq = (unsigned int)irq_map[virq].hwirq;
55470  
55471         iosync();
55472 -       direct_xirr_info_set(cpu, (0xff << 24) | irq);
55473 +       direct_xirr_info_set((0xff << 24) | irq);
55474  }
55475  
55476  
55477  static void xics_eoi_lpar(unsigned int virq)
55478  {
55479 -       int cpu = smp_processor_id();
55480         unsigned int irq = (unsigned int)irq_map[virq].hwirq;
55481  
55482         iosync();
55483 -       lpar_xirr_info_set(cpu, (0xff << 24) | irq);
55484 +       lpar_xirr_info_set((0xff << 24) | irq);
55485  }
55486  
55487  static inline unsigned int xics_remap_irq(unsigned int vec)
55488 @@ -312,16 +316,12 @@ static inline unsigned int xics_remap_ir
55489  
55490  static unsigned int xics_get_irq_direct(void)
55491  {
55492 -       unsigned int cpu = smp_processor_id();
55493 -
55494 -       return xics_remap_irq(direct_xirr_info_get(cpu));
55495 +       return xics_remap_irq(direct_xirr_info_get());
55496  }
55497  
55498  static unsigned int xics_get_irq_lpar(void)
55499  {
55500 -       unsigned int cpu = smp_processor_id();
55501 -
55502 -       return xics_remap_irq(lpar_xirr_info_get(cpu));
55503 +       return xics_remap_irq(lpar_xirr_info_get());
55504  }
55505  
55506  #ifdef CONFIG_SMP
55507 @@ -387,12 +387,12 @@ void xics_cause_IPI(int cpu)
55508  
55509  #endif /* CONFIG_SMP */
55510  
55511 -static void xics_set_cpu_priority(int cpu, unsigned char cppr)
55512 +static void xics_set_cpu_priority(unsigned char cppr)
55513  {
55514         if (firmware_has_feature(FW_FEATURE_LPAR))
55515 -               lpar_cppr_info(cpu, cppr);
55516 +               lpar_cppr_info(cppr);
55517         else
55518 -               direct_cppr_info(cpu, cppr);
55519 +               direct_cppr_info(cppr);
55520         iosync();
55521  }
55522  
55523 @@ -440,9 +440,7 @@ static void xics_set_affinity(unsigned i
55524  
55525  void xics_setup_cpu(void)
55526  {
55527 -       int cpu = smp_processor_id();
55528 -
55529 -       xics_set_cpu_priority(cpu, 0xff);
55530 +       xics_set_cpu_priority(0xff);
55531  
55532         /*
55533          * Put the calling processor into the GIQ.  This is really only
55534 @@ -783,7 +781,7 @@ void xics_teardown_cpu(int secondary)
55535         unsigned int ipi;
55536         struct irq_desc *desc;
55537  
55538 -       xics_set_cpu_priority(cpu, 0);
55539 +       xics_set_cpu_priority(0);
55540  
55541         /*
55542          * Clear IPI
55543 @@ -824,10 +822,11 @@ void xics_teardown_cpu(int secondary)
55544  void xics_migrate_irqs_away(void)
55545  {
55546         int status;
55547 -       unsigned int irq, virq, cpu = smp_processor_id();
55548 +       int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id();
55549 +       unsigned int irq, virq;
55550  
55551         /* Reject any interrupt that was queued to us... */
55552 -       xics_set_cpu_priority(cpu, 0);
55553 +       xics_set_cpu_priority(0);
55554  
55555         /* remove ourselves from the global interrupt queue */
55556         status = rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
55557 @@ -835,7 +834,7 @@ void xics_migrate_irqs_away(void)
55558         WARN_ON(status < 0);
55559  
55560         /* Allow IPIs again... */
55561 -       xics_set_cpu_priority(cpu, DEFAULT_PRIORITY);
55562 +       xics_set_cpu_priority(DEFAULT_PRIORITY);
55563  
55564         for_each_irq(virq) {
55565                 struct irq_desc *desc;
55566 @@ -874,7 +873,7 @@ void xics_migrate_irqs_away(void)
55567                  * The irq has to be migrated only in the single cpu
55568                  * case.
55569                  */
55570 -               if (xics_status[0] != get_hard_smp_processor_id(cpu))
55571 +               if (xics_status[0] != hw_cpu)
55572                         goto unlock;
55573  
55574                 printk(KERN_WARNING "IRQ %u affinity broken off cpu %u\n",
55575 Index: linux-2.6.24.7/arch/powerpc/platforms/pseries/xics.h
55576 ===================================================================
55577 --- linux-2.6.24.7.orig/arch/powerpc/platforms/pseries/xics.h
55578 +++ linux-2.6.24.7/arch/powerpc/platforms/pseries/xics.h
55579 @@ -21,9 +21,6 @@ extern void xics_cause_IPI(int cpu);
55580  extern  void xics_request_IPIs(void);
55581  extern void xics_migrate_irqs_away(void);
55582  
55583 -/* first argument is ignored for now*/
55584 -void pSeriesLP_cppr_info(int n_cpu, u8 value);
55585 -
55586  struct xics_ipi_struct {
55587         volatile unsigned long value;
55588  } ____cacheline_aligned;
55589 Index: linux-2.6.24.7/arch/powerpc/sysdev/Kconfig
55590 ===================================================================
55591 --- /dev/null
55592 +++ linux-2.6.24.7/arch/powerpc/sysdev/Kconfig
55593 @@ -0,0 +1,8 @@
55594 +# For a description of the syntax of this configuration file,
55595 +# see Documentation/kbuild/kconfig-language.txt.
55596 +#
55597 +
55598 +config PPC4xx_PCI_EXPRESS
55599 +       bool
55600 +       depends on PCI && 4xx
55601 +       default n
55602 Index: linux-2.6.24.7/arch/powerpc/sysdev/Makefile
55603 ===================================================================
55604 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/Makefile
55605 +++ linux-2.6.24.7/arch/powerpc/sysdev/Makefile
55606 @@ -2,7 +2,7 @@ ifeq ($(CONFIG_PPC64),y)
55607  EXTRA_CFLAGS                   += -mno-minimal-toc
55608  endif
55609  
55610 -mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o
55611 +mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o mpic_pasemi_msi.o
55612  obj-$(CONFIG_MPIC)             += mpic.o $(mpic-msi-obj-y)
55613  
55614  obj-$(CONFIG_PPC_MPC106)       += grackle.o
55615 @@ -12,6 +12,7 @@ obj-$(CONFIG_U3_DART)         += dart_iommu.o
55616  obj-$(CONFIG_MMIO_NVRAM)       += mmio_nvram.o
55617  obj-$(CONFIG_FSL_SOC)          += fsl_soc.o
55618  obj-$(CONFIG_FSL_PCI)          += fsl_pci.o
55619 +obj-$(CONFIG_RAPIDIO)          += fsl_rio.o
55620  obj-$(CONFIG_TSI108_BRIDGE)    += tsi108_pci.o tsi108_dev.o
55621  obj-$(CONFIG_QUICC_ENGINE)     += qe_lib/
55622  obj-$(CONFIG_PPC_BESTCOMM)     += bestcomm/
55623 @@ -24,9 +25,13 @@ obj-$(CONFIG_AXON_RAM)               += axonram.o
55624  ifeq ($(CONFIG_PPC_MERGE),y)
55625  obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
55626  obj-$(CONFIG_PPC_I8259)                += i8259.o
55627 -obj-$(CONFIG_PPC_83xx)         += ipic.o
55628 +obj-$(CONFIG_IPIC)             += ipic.o
55629  obj-$(CONFIG_4xx)              += uic.o
55630  obj-$(CONFIG_XILINX_VIRTEX)    += xilinx_intc.o
55631 +obj-$(CONFIG_OF_RTC)           += of_rtc.o
55632 +ifeq ($(CONFIG_PCI),y)
55633 +obj-$(CONFIG_4xx)              += ppc4xx_pci.o
55634 +endif
55635  endif
55636  
55637  # Temporary hack until we have migrated to asm-powerpc
55638 Index: linux-2.6.24.7/arch/powerpc/sysdev/axonram.c
55639 ===================================================================
55640 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/axonram.c
55641 +++ linux-2.6.24.7/arch/powerpc/sysdev/axonram.c
55642 @@ -42,8 +42,9 @@
55643  #include <linux/slab.h>
55644  #include <linux/string.h>
55645  #include <linux/types.h>
55646 -#include <asm/of_device.h>
55647 -#include <asm/of_platform.h>
55648 +#include <linux/of_device.h>
55649 +#include <linux/of_platform.h>
55650 +
55651  #include <asm/page.h>
55652  #include <asm/prom.h>
55653  
55654 Index: linux-2.6.24.7/arch/powerpc/sysdev/bestcomm/bestcomm.h
55655 ===================================================================
55656 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/bestcomm/bestcomm.h
55657 +++ linux-2.6.24.7/arch/powerpc/sysdev/bestcomm/bestcomm.h
55658 @@ -20,7 +20,7 @@ struct bcom_bd; /* defined later on ... 
55659  
55660  
55661  /* ======================================================================== */
55662 -/* Generic task managment                                                   */
55663 +/* Generic task management                                                   */
55664  /* ======================================================================== */
55665  
55666  /**
55667 Index: linux-2.6.24.7/arch/powerpc/sysdev/commproc.c
55668 ===================================================================
55669 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/commproc.c
55670 +++ linux-2.6.24.7/arch/powerpc/sysdev/commproc.c
55671 @@ -240,6 +240,34 @@ void __init cpm_reset(void)
55672  #endif
55673  }
55674  
55675 +static DEFINE_SPINLOCK(cmd_lock);
55676 +
55677 +#define MAX_CR_CMD_LOOPS        10000
55678 +
55679 +int cpm_command(u32 command, u8 opcode)
55680 +{
55681 +       int i, ret;
55682 +       unsigned long flags;
55683 +
55684 +       if (command & 0xffffff0f)
55685 +               return -EINVAL;
55686 +
55687 +       spin_lock_irqsave(&cmd_lock, flags);
55688 +
55689 +       ret = 0;
55690 +       out_be16(&cpmp->cp_cpcr, command | CPM_CR_FLG | (opcode << 8));
55691 +       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
55692 +               if ((in_be16(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
55693 +                       goto out;
55694 +
55695 +       printk(KERN_ERR "%s(): Not able to issue CPM command\n", __FUNCTION__);
55696 +       ret = -EIO;
55697 +out:
55698 +       spin_unlock_irqrestore(&cmd_lock, flags);
55699 +       return ret;
55700 +}
55701 +EXPORT_SYMBOL(cpm_command);
55702 +
55703  /* We used to do this earlier, but have to postpone as long as possible
55704   * to ensure the kernel VM is now running.
55705   */
55706 @@ -408,7 +436,7 @@ EXPORT_SYMBOL(cpm_dpram_phys);
55707  #endif /* !CONFIG_PPC_CPM_NEW_BINDING */
55708  
55709  struct cpm_ioport16 {
55710 -       __be16 dir, par, sor, dat, intr;
55711 +       __be16 dir, par, odr_sor, dat, intr;
55712         __be16 res[3];
55713  };
55714  
55715 @@ -438,6 +466,13 @@ static void cpm1_set_pin32(int port, int
55716         else
55717                 clrbits32(&iop->par, pin);
55718  
55719 +       if (port == CPM_PORTB) {
55720 +               if (flags & CPM_PIN_OPENDRAIN)
55721 +                       setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
55722 +               else
55723 +                       clrbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
55724 +       }
55725 +
55726         if (port == CPM_PORTE) {
55727                 if (flags & CPM_PIN_SECONDARY)
55728                         setbits32(&iop->sor, pin);
55729 @@ -471,11 +506,17 @@ static void cpm1_set_pin16(int port, int
55730         else
55731                 clrbits16(&iop->par, pin);
55732  
55733 +       if (port == CPM_PORTA) {
55734 +               if (flags & CPM_PIN_OPENDRAIN)
55735 +                       setbits16(&iop->odr_sor, pin);
55736 +               else
55737 +                       clrbits16(&iop->odr_sor, pin);
55738 +       }
55739         if (port == CPM_PORTC) {
55740                 if (flags & CPM_PIN_SECONDARY)
55741 -                       setbits16(&iop->sor, pin);
55742 +                       setbits16(&iop->odr_sor, pin);
55743                 else
55744 -                       clrbits16(&iop->sor, pin);
55745 +                       clrbits16(&iop->odr_sor, pin);
55746         }
55747  }
55748  
55749 Index: linux-2.6.24.7/arch/powerpc/sysdev/cpm2_common.c
55750 ===================================================================
55751 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/cpm2_common.c
55752 +++ linux-2.6.24.7/arch/powerpc/sysdev/cpm2_common.c
55753 @@ -82,6 +82,31 @@ void __init cpm2_reset(void)
55754         cpmp = &cpm2_immr->im_cpm;
55755  }
55756  
55757 +static DEFINE_SPINLOCK(cmd_lock);
55758 +
55759 +#define MAX_CR_CMD_LOOPS        10000
55760 +
55761 +int cpm_command(u32 command, u8 opcode)
55762 +{
55763 +       int i, ret;
55764 +       unsigned long flags;
55765 +
55766 +       spin_lock_irqsave(&cmd_lock, flags);
55767 +
55768 +       ret = 0;
55769 +       out_be32(&cpmp->cp_cpcr, command | opcode | CPM_CR_FLG);
55770 +       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
55771 +               if ((in_be32(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
55772 +                       goto out;
55773 +
55774 +       printk(KERN_ERR "%s(): Not able to issue CPM command\n", __FUNCTION__);
55775 +       ret = -EIO;
55776 +out:
55777 +       spin_unlock_irqrestore(&cmd_lock, flags);
55778 +       return ret;
55779 +}
55780 +EXPORT_SYMBOL(cpm_command);
55781 +
55782  /* Set a baud rate generator.  This needs lots of work.  There are
55783   * eight BRGs, which can be connected to the CPM channels or output
55784   * as clocks.  The BRGs are in two different block of internal
55785 Index: linux-2.6.24.7/arch/powerpc/sysdev/fsl_pci.c
55786 ===================================================================
55787 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/fsl_pci.c
55788 +++ linux-2.6.24.7/arch/powerpc/sysdev/fsl_pci.c
55789 @@ -33,8 +33,8 @@ void __init setup_pci_atmu(struct pci_co
55790         struct ccsr_pci __iomem *pci;
55791         int i;
55792  
55793 -       pr_debug("PCI memory map start 0x%x, size 0x%x\n", rsrc->start,
55794 -                       rsrc->end - rsrc->start + 1);
55795 +       pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n",
55796 +                   (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1);
55797         pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
55798  
55799         /* Disable all windows (except powar0 since its ignored) */
55800 @@ -46,17 +46,17 @@ void __init setup_pci_atmu(struct pci_co
55801         /* Setup outbound MEM window */
55802         for(i = 0; i < 3; i++)
55803                 if (hose->mem_resources[i].flags & IORESOURCE_MEM){
55804 -                       pr_debug("PCI MEM resource start 0x%08x, size 0x%08x.\n",
55805 -                               hose->mem_resources[i].start,
55806 -                               hose->mem_resources[i].end
55807 -                                 - hose->mem_resources[i].start + 1);
55808 -                       out_be32(&pci->pow[i+1].potar,
55809 -                               (hose->mem_resources[i].start >> 12)
55810 -                               & 0x000fffff);
55811 +                       resource_size_t pci_addr_start =
55812 +                                hose->mem_resources[i].start -
55813 +                                hose->pci_mem_offset;
55814 +                       pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n",
55815 +                               (u64)hose->mem_resources[i].start,
55816 +                               (u64)hose->mem_resources[i].end
55817 +                                 - (u64)hose->mem_resources[i].start + 1);
55818 +                       out_be32(&pci->pow[i+1].potar, (pci_addr_start >> 12));
55819                         out_be32(&pci->pow[i+1].potear, 0);
55820                         out_be32(&pci->pow[i+1].powbar,
55821 -                               (hose->mem_resources[i].start >> 12)
55822 -                               & 0x000fffff);
55823 +                               (hose->mem_resources[i].start >> 12));
55824                         /* Enable, Mem R/W */
55825                         out_be32(&pci->pow[i+1].powar, 0x80044000
55826                                 | (__ilog2(hose->mem_resources[i].end
55827 @@ -65,15 +65,14 @@ void __init setup_pci_atmu(struct pci_co
55828  
55829         /* Setup outbound IO window */
55830         if (hose->io_resource.flags & IORESOURCE_IO){
55831 -               pr_debug("PCI IO resource start 0x%08x, size 0x%08x, phy base 0x%08x.\n",
55832 -                       hose->io_resource.start,
55833 -                       hose->io_resource.end - hose->io_resource.start + 1,
55834 -                       hose->io_base_phys);
55835 -               out_be32(&pci->pow[i+1].potar, (hose->io_resource.start >> 12)
55836 -                               & 0x000fffff);
55837 +               pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, "
55838 +                        "phy base 0x%016llx.\n",
55839 +                       (u64)hose->io_resource.start,
55840 +                       (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1,
55841 +                       (u64)hose->io_base_phys);
55842 +               out_be32(&pci->pow[i+1].potar, (hose->io_resource.start >> 12));
55843                 out_be32(&pci->pow[i+1].potear, 0);
55844 -               out_be32(&pci->pow[i+1].powbar, (hose->io_base_phys >> 12)
55845 -                               & 0x000fffff);
55846 +               out_be32(&pci->pow[i+1].powbar, (hose->io_base_phys >> 12));
55847                 /* Enable, IO R/W */
55848                 out_be32(&pci->pow[i+1].powar, 0x80088000
55849                         | (__ilog2(hose->io_resource.end
55850 @@ -107,55 +106,17 @@ void __init setup_pci_cmd(struct pci_con
55851         }
55852  }
55853  
55854 -static void __init quirk_fsl_pcie_transparent(struct pci_dev *dev)
55855 -{
55856 -       struct resource *res;
55857 -       int i, res_idx = PCI_BRIDGE_RESOURCES;
55858 -       struct pci_controller *hose;
55859 +static int fsl_pcie_bus_fixup;
55860  
55861 +static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
55862 +{
55863         /* if we aren't a PCIe don't bother */
55864         if (!pci_find_capability(dev, PCI_CAP_ID_EXP))
55865                 return ;
55866  
55867 -       /*
55868 -        * Make the bridge be transparent.
55869 -        */
55870 -       dev->transparent = 1;
55871 -
55872 -       hose = pci_bus_to_host(dev->bus);
55873 -       if (!hose) {
55874 -               printk(KERN_ERR "Can't find hose for bus %d\n",
55875 -                      dev->bus->number);
55876 -               return;
55877 -       }
55878 -
55879 -       /* Clear out any of the virtual P2P bridge registers */
55880 -       pci_write_config_word(dev, PCI_IO_BASE_UPPER16, 0);
55881 -       pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16, 0);
55882 -       pci_write_config_byte(dev, PCI_IO_BASE, 0x10);
55883 -       pci_write_config_byte(dev, PCI_IO_LIMIT, 0);
55884 -       pci_write_config_word(dev, PCI_MEMORY_BASE, 0x10);
55885 -       pci_write_config_word(dev, PCI_MEMORY_LIMIT, 0);
55886 -       pci_write_config_word(dev, PCI_PREF_BASE_UPPER32, 0x0);
55887 -       pci_write_config_word(dev, PCI_PREF_LIMIT_UPPER32, 0x0);
55888 -       pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, 0x10);
55889 -       pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, 0);
55890 -
55891 -       if (hose->io_resource.flags) {
55892 -               res = &dev->resource[res_idx++];
55893 -               res->start = hose->io_resource.start;
55894 -               res->end = hose->io_resource.end;
55895 -               res->flags = hose->io_resource.flags;
55896 -               update_bridge_resource(dev, res);
55897 -       }
55898 -
55899 -       for (i = 0; i < 3; i++) {
55900 -               res = &dev->resource[res_idx + i];
55901 -               res->start = hose->mem_resources[i].start;
55902 -               res->end = hose->mem_resources[i].end;
55903 -               res->flags = hose->mem_resources[i].flags;
55904 -               update_bridge_resource(dev, res);
55905 -       }
55906 +       dev->class = PCI_CLASS_BRIDGE_PCI << 8;
55907 +       fsl_pcie_bus_fixup = 1;
55908 +       return ;
55909  }
55910  
55911  int __init fsl_pcie_check_link(struct pci_controller *hose)
55912 @@ -172,11 +133,24 @@ void fsl_pcibios_fixup_bus(struct pci_bu
55913         struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
55914         int i;
55915  
55916 -       /* deal with bogus pci_bus when we don't have anything connected on PCIe */
55917 -       if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) {
55918 -               if (bus->parent) {
55919 -                       for (i = 0; i < 4; ++i)
55920 -                               bus->resource[i] = bus->parent->resource[i];
55921 +       if ((bus->parent == hose->bus) &&
55922 +           ((fsl_pcie_bus_fixup &&
55923 +             early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) ||
55924 +            (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK)))
55925 +       {
55926 +               for (i = 0; i < 4; ++i) {
55927 +                       struct resource *res = bus->resource[i];
55928 +                       struct resource *par = bus->parent->resource[i];
55929 +                       if (res) {
55930 +                               res->start = 0;
55931 +                               res->end   = 0;
55932 +                               res->flags = 0;
55933 +                       }
55934 +                       if (res && par) {
55935 +                               res->start = par->start;
55936 +                               res->end   = par->end;
55937 +                               res->flags = par->flags;
55938 +                       }
55939                 }
55940         }
55941  }
55942 @@ -202,7 +176,7 @@ int __init fsl_add_bridge(struct device_
55943                 printk(KERN_WARNING "Can't get bus-range for %s, assume"
55944                         " bus 0\n", dev->full_name);
55945  
55946 -       pci_assign_all_buses = 1;
55947 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
55948         hose = pcibios_alloc_controller(dev);
55949         if (!hose)
55950                 return -ENOMEM;
55951 @@ -222,7 +196,7 @@ int __init fsl_add_bridge(struct device_
55952                         hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK;
55953         }
55954  
55955 -       printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx."
55956 +       printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. "
55957                 "Firmware bus number: %d->%d\n",
55958                 (unsigned long long)rsrc.start, hose->first_busno,
55959                 hose->last_busno);
55960 @@ -240,23 +214,23 @@ int __init fsl_add_bridge(struct device_
55961         return 0;
55962  }
55963  
55964 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8548E, quirk_fsl_pcie_transparent);
55965 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8548, quirk_fsl_pcie_transparent);
55966 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8543E, quirk_fsl_pcie_transparent);
55967 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8543, quirk_fsl_pcie_transparent);
55968 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8547E, quirk_fsl_pcie_transparent);
55969 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8545E, quirk_fsl_pcie_transparent);
55970 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8545, quirk_fsl_pcie_transparent);
55971 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568E, quirk_fsl_pcie_transparent);
55972 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_transparent);
55973 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_transparent);
55974 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567, quirk_fsl_pcie_transparent);
55975 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533E, quirk_fsl_pcie_transparent);
55976 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533, quirk_fsl_pcie_transparent);
55977 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_transparent);
55978 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_transparent);
55979 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8572E, quirk_fsl_pcie_transparent);
55980 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8572, quirk_fsl_pcie_transparent);
55981 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_transparent);
55982 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_transparent);
55983 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_transparent);
55984 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8548E, quirk_fsl_pcie_header);
55985 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8548, quirk_fsl_pcie_header);
55986 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8543E, quirk_fsl_pcie_header);
55987 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8543, quirk_fsl_pcie_header);
55988 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8547E, quirk_fsl_pcie_header);
55989 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8545E, quirk_fsl_pcie_header);
55990 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8545, quirk_fsl_pcie_header);
55991 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8568E, quirk_fsl_pcie_header);
55992 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_header);
55993 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_header);
55994 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8567, quirk_fsl_pcie_header);
55995 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8533E, quirk_fsl_pcie_header);
55996 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8533, quirk_fsl_pcie_header);
55997 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_header);
55998 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_header);
55999 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8572E, quirk_fsl_pcie_header);
56000 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8572, quirk_fsl_pcie_header);
56001 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_header);
56002 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_header);
56003 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_header);
56004 Index: linux-2.6.24.7/arch/powerpc/sysdev/fsl_rio.c
56005 ===================================================================
56006 --- /dev/null
56007 +++ linux-2.6.24.7/arch/powerpc/sysdev/fsl_rio.c
56008 @@ -0,0 +1,932 @@
56009 +/*
56010 + * MPC85xx RapidIO support
56011 + *
56012 + * Copyright 2005 MontaVista Software, Inc.
56013 + * Matt Porter <mporter@kernel.crashing.org>
56014 + *
56015 + * This program is free software; you can redistribute  it and/or modify it
56016 + * under  the terms of  the GNU General  Public License as published by the
56017 + * Free Software Foundation;  either version 2 of the  License, or (at your
56018 + * option) any later version.
56019 + */
56020 +
56021 +#include <linux/init.h>
56022 +#include <linux/module.h>
56023 +#include <linux/types.h>
56024 +#include <linux/dma-mapping.h>
56025 +#include <linux/interrupt.h>
56026 +#include <linux/rio.h>
56027 +#include <linux/rio_drv.h>
56028 +
56029 +#include <asm/io.h>
56030 +
56031 +#define RIO_REGS_BASE          (CCSRBAR + 0xc0000)
56032 +#define RIO_ATMU_REGS_OFFSET   0x10c00
56033 +#define RIO_MSG_REGS_OFFSET    0x11000
56034 +#define RIO_MAINT_WIN_SIZE     0x400000
56035 +#define RIO_DBELL_WIN_SIZE     0x1000
56036 +
56037 +#define RIO_MSG_OMR_MUI                0x00000002
56038 +#define RIO_MSG_OSR_TE         0x00000080
56039 +#define RIO_MSG_OSR_QOI                0x00000020
56040 +#define RIO_MSG_OSR_QFI                0x00000010
56041 +#define RIO_MSG_OSR_MUB                0x00000004
56042 +#define RIO_MSG_OSR_EOMI       0x00000002
56043 +#define RIO_MSG_OSR_QEI                0x00000001
56044 +
56045 +#define RIO_MSG_IMR_MI         0x00000002
56046 +#define RIO_MSG_ISR_TE         0x00000080
56047 +#define RIO_MSG_ISR_QFI                0x00000010
56048 +#define RIO_MSG_ISR_DIQI       0x00000001
56049 +
56050 +#define RIO_MSG_DESC_SIZE      32
56051 +#define RIO_MSG_BUFFER_SIZE    4096
56052 +#define RIO_MIN_TX_RING_SIZE   2
56053 +#define RIO_MAX_TX_RING_SIZE   2048
56054 +#define RIO_MIN_RX_RING_SIZE   2
56055 +#define RIO_MAX_RX_RING_SIZE   2048
56056 +
56057 +#define DOORBELL_DMR_DI                0x00000002
56058 +#define DOORBELL_DSR_TE                0x00000080
56059 +#define DOORBELL_DSR_QFI       0x00000010
56060 +#define DOORBELL_DSR_DIQI      0x00000001
56061 +#define DOORBELL_TID_OFFSET    0x03
56062 +#define DOORBELL_SID_OFFSET    0x05
56063 +#define DOORBELL_INFO_OFFSET   0x06
56064 +
56065 +#define DOORBELL_MESSAGE_SIZE  0x08
56066 +#define DBELL_SID(x)           (*(u8 *)(x + DOORBELL_SID_OFFSET))
56067 +#define DBELL_TID(x)           (*(u8 *)(x + DOORBELL_TID_OFFSET))
56068 +#define DBELL_INF(x)           (*(u16 *)(x + DOORBELL_INFO_OFFSET))
56069 +
56070 +struct rio_atmu_regs {
56071 +       u32 rowtar;
56072 +       u32 pad1;
56073 +       u32 rowbar;
56074 +       u32 pad2;
56075 +       u32 rowar;
56076 +       u32 pad3[3];
56077 +};
56078 +
56079 +struct rio_msg_regs {
56080 +       u32 omr;
56081 +       u32 osr;
56082 +       u32 pad1;
56083 +       u32 odqdpar;
56084 +       u32 pad2;
56085 +       u32 osar;
56086 +       u32 odpr;
56087 +       u32 odatr;
56088 +       u32 odcr;
56089 +       u32 pad3;
56090 +       u32 odqepar;
56091 +       u32 pad4[13];
56092 +       u32 imr;
56093 +       u32 isr;
56094 +       u32 pad5;
56095 +       u32 ifqdpar;
56096 +       u32 pad6;
56097 +       u32 ifqepar;
56098 +       u32 pad7[250];
56099 +       u32 dmr;
56100 +       u32 dsr;
56101 +       u32 pad8;
56102 +       u32 dqdpar;
56103 +       u32 pad9;
56104 +       u32 dqepar;
56105 +       u32 pad10[26];
56106 +       u32 pwmr;
56107 +       u32 pwsr;
56108 +       u32 pad11;
56109 +       u32 pwqbar;
56110 +};
56111 +
56112 +struct rio_tx_desc {
56113 +       u32 res1;
56114 +       u32 saddr;
56115 +       u32 dport;
56116 +       u32 dattr;
56117 +       u32 res2;
56118 +       u32 res3;
56119 +       u32 dwcnt;
56120 +       u32 res4;
56121 +};
56122 +
56123 +static u32 regs_win;
56124 +static struct rio_atmu_regs *atmu_regs;
56125 +static struct rio_atmu_regs *maint_atmu_regs;
56126 +static struct rio_atmu_regs *dbell_atmu_regs;
56127 +static u32 dbell_win;
56128 +static u32 maint_win;
56129 +static struct rio_msg_regs *msg_regs;
56130 +
56131 +static struct rio_dbell_ring {
56132 +       void *virt;
56133 +       dma_addr_t phys;
56134 +} dbell_ring;
56135 +
56136 +static struct rio_msg_tx_ring {
56137 +       void *virt;
56138 +       dma_addr_t phys;
56139 +       void *virt_buffer[RIO_MAX_TX_RING_SIZE];
56140 +       dma_addr_t phys_buffer[RIO_MAX_TX_RING_SIZE];
56141 +       int tx_slot;
56142 +       int size;
56143 +       void *dev_id;
56144 +} msg_tx_ring;
56145 +
56146 +static struct rio_msg_rx_ring {
56147 +       void *virt;
56148 +       dma_addr_t phys;
56149 +       void *virt_buffer[RIO_MAX_RX_RING_SIZE];
56150 +       int rx_slot;
56151 +       int size;
56152 +       void *dev_id;
56153 +} msg_rx_ring;
56154 +
56155 +/**
56156 + * mpc85xx_rio_doorbell_send - Send a MPC85xx doorbell message
56157 + * @index: ID of RapidIO interface
56158 + * @destid: Destination ID of target device
56159 + * @data: 16-bit info field of RapidIO doorbell message
56160 + *
56161 + * Sends a MPC85xx doorbell message. Returns %0 on success or
56162 + * %-EINVAL on failure.
56163 + */
56164 +static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data)
56165 +{
56166 +       pr_debug("mpc85xx_doorbell_send: index %d destid %4.4x data %4.4x\n",
56167 +                index, destid, data);
56168 +       out_be32((void *)&dbell_atmu_regs->rowtar, destid << 22);
56169 +       out_be16((void *)(dbell_win), data);
56170 +
56171 +       return 0;
56172 +}
56173 +
56174 +/**
56175 + * mpc85xx_local_config_read - Generate a MPC85xx local config space read
56176 + * @index: ID of RapdiIO interface
56177 + * @offset: Offset into configuration space
56178 + * @len: Length (in bytes) of the maintenance transaction
56179 + * @data: Value to be read into
56180 + *
56181 + * Generates a MPC85xx local configuration space read. Returns %0 on
56182 + * success or %-EINVAL on failure.
56183 + */
56184 +static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * data)
56185 +{
56186 +       pr_debug("mpc85xx_local_config_read: index %d offset %8.8x\n", index,
56187 +                offset);
56188 +       *data = in_be32((void *)(regs_win + offset));
56189 +
56190 +       return 0;
56191 +}
56192 +
56193 +/**
56194 + * mpc85xx_local_config_write - Generate a MPC85xx local config space write
56195 + * @index: ID of RapdiIO interface
56196 + * @offset: Offset into configuration space
56197 + * @len: Length (in bytes) of the maintenance transaction
56198 + * @data: Value to be written
56199 + *
56200 + * Generates a MPC85xx local configuration space write. Returns %0 on
56201 + * success or %-EINVAL on failure.
56202 + */
56203 +static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data)
56204 +{
56205 +       pr_debug
56206 +           ("mpc85xx_local_config_write: index %d offset %8.8x data %8.8x\n",
56207 +            index, offset, data);
56208 +       out_be32((void *)(regs_win + offset), data);
56209 +
56210 +       return 0;
56211 +}
56212 +
56213 +/**
56214 + * mpc85xx_rio_config_read - Generate a MPC85xx read maintenance transaction
56215 + * @index: ID of RapdiIO interface
56216 + * @destid: Destination ID of transaction
56217 + * @hopcount: Number of hops to target device
56218 + * @offset: Offset into configuration space
56219 + * @len: Length (in bytes) of the maintenance transaction
56220 + * @val: Location to be read into
56221 + *
56222 + * Generates a MPC85xx read maintenance transaction. Returns %0 on
56223 + * success or %-EINVAL on failure.
56224 + */
56225 +static int
56226 +mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len,
56227 +                       u32 * val)
56228 +{
56229 +       u8 *data;
56230 +
56231 +       pr_debug
56232 +           ("mpc85xx_rio_config_read: index %d destid %d hopcount %d offset %8.8x len %d\n",
56233 +            index, destid, hopcount, offset, len);
56234 +       out_be32((void *)&maint_atmu_regs->rowtar,
56235 +                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
56236 +
56237 +       data = (u8 *) maint_win + offset;
56238 +       switch (len) {
56239 +       case 1:
56240 +               *val = in_8((u8 *) data);
56241 +               break;
56242 +       case 2:
56243 +               *val = in_be16((u16 *) data);
56244 +               break;
56245 +       default:
56246 +               *val = in_be32((u32 *) data);
56247 +               break;
56248 +       }
56249 +
56250 +       return 0;
56251 +}
56252 +
56253 +/**
56254 + * mpc85xx_rio_config_write - Generate a MPC85xx write maintenance transaction
56255 + * @index: ID of RapdiIO interface
56256 + * @destid: Destination ID of transaction
56257 + * @hopcount: Number of hops to target device
56258 + * @offset: Offset into configuration space
56259 + * @len: Length (in bytes) of the maintenance transaction
56260 + * @val: Value to be written
56261 + *
56262 + * Generates an MPC85xx write maintenance transaction. Returns %0 on
56263 + * success or %-EINVAL on failure.
56264 + */
56265 +static int
56266 +mpc85xx_rio_config_write(int index, u16 destid, u8 hopcount, u32 offset,
56267 +                        int len, u32 val)
56268 +{
56269 +       u8 *data;
56270 +       pr_debug
56271 +           ("mpc85xx_rio_config_write: index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n",
56272 +            index, destid, hopcount, offset, len, val);
56273 +       out_be32((void *)&maint_atmu_regs->rowtar,
56274 +                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
56275 +
56276 +       data = (u8 *) maint_win + offset;
56277 +       switch (len) {
56278 +       case 1:
56279 +               out_8((u8 *) data, val);
56280 +               break;
56281 +       case 2:
56282 +               out_be16((u16 *) data, val);
56283 +               break;
56284 +       default:
56285 +               out_be32((u32 *) data, val);
56286 +               break;
56287 +       }
56288 +
56289 +       return 0;
56290 +}
56291 +
56292 +/**
56293 + * rio_hw_add_outb_message - Add message to the MPC85xx outbound message queue
56294 + * @mport: Master port with outbound message queue
56295 + * @rdev: Target of outbound message
56296 + * @mbox: Outbound mailbox
56297 + * @buffer: Message to add to outbound queue
56298 + * @len: Length of message
56299 + *
56300 + * Adds the @buffer message to the MPC85xx outbound message queue. Returns
56301 + * %0 on success or %-EINVAL on failure.
56302 + */
56303 +int
56304 +rio_hw_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox,
56305 +                       void *buffer, size_t len)
56306 +{
56307 +       u32 omr;
56308 +       struct rio_tx_desc *desc =
56309 +           (struct rio_tx_desc *)msg_tx_ring.virt + msg_tx_ring.tx_slot;
56310 +       int ret = 0;
56311 +
56312 +       pr_debug
56313 +           ("RIO: rio_hw_add_outb_message(): destid %4.4x mbox %d buffer %8.8x len %8.8x\n",
56314 +            rdev->destid, mbox, (int)buffer, len);
56315 +
56316 +       if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
56317 +               ret = -EINVAL;
56318 +               goto out;
56319 +       }
56320 +
56321 +       /* Copy and clear rest of buffer */
56322 +       memcpy(msg_tx_ring.virt_buffer[msg_tx_ring.tx_slot], buffer, len);
56323 +       if (len < (RIO_MAX_MSG_SIZE - 4))
56324 +               memset((void *)((u32) msg_tx_ring.
56325 +                               virt_buffer[msg_tx_ring.tx_slot] + len), 0,
56326 +                      RIO_MAX_MSG_SIZE - len);
56327 +
56328 +       /* Set mbox field for message */
56329 +       desc->dport = mbox & 0x3;
56330 +
56331 +       /* Enable EOMI interrupt, set priority, and set destid */
56332 +       desc->dattr = 0x28000000 | (rdev->destid << 2);
56333 +
56334 +       /* Set transfer size aligned to next power of 2 (in double words) */
56335 +       desc->dwcnt = is_power_of_2(len) ? len : 1 << get_bitmask_order(len);
56336 +
56337 +       /* Set snooping and source buffer address */
56338 +       desc->saddr = 0x00000004 | msg_tx_ring.phys_buffer[msg_tx_ring.tx_slot];
56339 +
56340 +       /* Increment enqueue pointer */
56341 +       omr = in_be32((void *)&msg_regs->omr);
56342 +       out_be32((void *)&msg_regs->omr, omr | RIO_MSG_OMR_MUI);
56343 +
56344 +       /* Go to next descriptor */
56345 +       if (++msg_tx_ring.tx_slot == msg_tx_ring.size)
56346 +               msg_tx_ring.tx_slot = 0;
56347 +
56348 +      out:
56349 +       return ret;
56350 +}
56351 +
56352 +EXPORT_SYMBOL_GPL(rio_hw_add_outb_message);
56353 +
56354 +/**
56355 + * mpc85xx_rio_tx_handler - MPC85xx outbound message interrupt handler
56356 + * @irq: Linux interrupt number
56357 + * @dev_instance: Pointer to interrupt-specific data
56358 + *
56359 + * Handles outbound message interrupts. Executes a register outbound
56360 + * mailbox event handler and acks the interrupt occurrence.
56361 + */
56362 +static irqreturn_t
56363 +mpc85xx_rio_tx_handler(int irq, void *dev_instance)
56364 +{
56365 +       int osr;
56366 +       struct rio_mport *port = (struct rio_mport *)dev_instance;
56367 +
56368 +       osr = in_be32((void *)&msg_regs->osr);
56369 +
56370 +       if (osr & RIO_MSG_OSR_TE) {
56371 +               pr_info("RIO: outbound message transmission error\n");
56372 +               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_TE);
56373 +               goto out;
56374 +       }
56375 +
56376 +       if (osr & RIO_MSG_OSR_QOI) {
56377 +               pr_info("RIO: outbound message queue overflow\n");
56378 +               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_QOI);
56379 +               goto out;
56380 +       }
56381 +
56382 +       if (osr & RIO_MSG_OSR_EOMI) {
56383 +               u32 dqp = in_be32((void *)&msg_regs->odqdpar);
56384 +               int slot = (dqp - msg_tx_ring.phys) >> 5;
56385 +               port->outb_msg[0].mcback(port, msg_tx_ring.dev_id, -1, slot);
56386 +
56387 +               /* Ack the end-of-message interrupt */
56388 +               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_EOMI);
56389 +       }
56390 +
56391 +      out:
56392 +       return IRQ_HANDLED;
56393 +}
56394 +
56395 +/**
56396 + * rio_open_outb_mbox - Initialize MPC85xx outbound mailbox
56397 + * @mport: Master port implementing the outbound message unit
56398 + * @dev_id: Device specific pointer to pass on event
56399 + * @mbox: Mailbox to open
56400 + * @entries: Number of entries in the outbound mailbox ring
56401 + *
56402 + * Initializes buffer ring, request the outbound message interrupt,
56403 + * and enables the outbound message unit. Returns %0 on success and
56404 + * %-EINVAL or %-ENOMEM on failure.
56405 + */
56406 +int rio_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
56407 +{
56408 +       int i, j, rc = 0;
56409 +
56410 +       if ((entries < RIO_MIN_TX_RING_SIZE) ||
56411 +           (entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
56412 +               rc = -EINVAL;
56413 +               goto out;
56414 +       }
56415 +
56416 +       /* Initialize shadow copy ring */
56417 +       msg_tx_ring.dev_id = dev_id;
56418 +       msg_tx_ring.size = entries;
56419 +
56420 +       for (i = 0; i < msg_tx_ring.size; i++) {
56421 +               if (!
56422 +                   (msg_tx_ring.virt_buffer[i] =
56423 +                    dma_alloc_coherent(NULL, RIO_MSG_BUFFER_SIZE,
56424 +                                       &msg_tx_ring.phys_buffer[i],
56425 +                                       GFP_KERNEL))) {
56426 +                       rc = -ENOMEM;
56427 +                       for (j = 0; j < msg_tx_ring.size; j++)
56428 +                               if (msg_tx_ring.virt_buffer[j])
56429 +                                       dma_free_coherent(NULL,
56430 +                                                         RIO_MSG_BUFFER_SIZE,
56431 +                                                         msg_tx_ring.
56432 +                                                         virt_buffer[j],
56433 +                                                         msg_tx_ring.
56434 +                                                         phys_buffer[j]);
56435 +                       goto out;
56436 +               }
56437 +       }
56438 +
56439 +       /* Initialize outbound message descriptor ring */
56440 +       if (!(msg_tx_ring.virt = dma_alloc_coherent(NULL,
56441 +                                                   msg_tx_ring.size *
56442 +                                                   RIO_MSG_DESC_SIZE,
56443 +                                                   &msg_tx_ring.phys,
56444 +                                                   GFP_KERNEL))) {
56445 +               rc = -ENOMEM;
56446 +               goto out_dma;
56447 +       }
56448 +       memset(msg_tx_ring.virt, 0, msg_tx_ring.size * RIO_MSG_DESC_SIZE);
56449 +       msg_tx_ring.tx_slot = 0;
56450 +
56451 +       /* Point dequeue/enqueue pointers at first entry in ring */
56452 +       out_be32((void *)&msg_regs->odqdpar, msg_tx_ring.phys);
56453 +       out_be32((void *)&msg_regs->odqepar, msg_tx_ring.phys);
56454 +
56455 +       /* Configure for snooping */
56456 +       out_be32((void *)&msg_regs->osar, 0x00000004);
56457 +
56458 +       /* Clear interrupt status */
56459 +       out_be32((void *)&msg_regs->osr, 0x000000b3);
56460 +
56461 +       /* Hook up outbound message handler */
56462 +       if ((rc =
56463 +            request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0,
56464 +                        "msg_tx", (void *)mport)) < 0)
56465 +               goto out_irq;
56466 +
56467 +       /*
56468 +        * Configure outbound message unit
56469 +        *      Snooping
56470 +        *      Interrupts (all enabled, except QEIE)
56471 +        *      Chaining mode
56472 +        *      Disable
56473 +        */
56474 +       out_be32((void *)&msg_regs->omr, 0x00100220);
56475 +
56476 +       /* Set number of entries */
56477 +       out_be32((void *)&msg_regs->omr,
56478 +                in_be32((void *)&msg_regs->omr) |
56479 +                ((get_bitmask_order(entries) - 2) << 12));
56480 +
56481 +       /* Now enable the unit */
56482 +       out_be32((void *)&msg_regs->omr, in_be32((void *)&msg_regs->omr) | 0x1);
56483 +
56484 +      out:
56485 +       return rc;
56486 +
56487 +      out_irq:
56488 +       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
56489 +                         msg_tx_ring.virt, msg_tx_ring.phys);
56490 +
56491 +      out_dma:
56492 +       for (i = 0; i < msg_tx_ring.size; i++)
56493 +               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
56494 +                                 msg_tx_ring.virt_buffer[i],
56495 +                                 msg_tx_ring.phys_buffer[i]);
56496 +
56497 +       return rc;
56498 +}
56499 +
56500 +/**
56501 + * rio_close_outb_mbox - Shut down MPC85xx outbound mailbox
56502 + * @mport: Master port implementing the outbound message unit
56503 + * @mbox: Mailbox to close
56504 + *
56505 + * Disables the outbound message unit, free all buffers, and
56506 + * frees the outbound message interrupt.
56507 + */
56508 +void rio_close_outb_mbox(struct rio_mport *mport, int mbox)
56509 +{
56510 +       /* Disable inbound message unit */
56511 +       out_be32((void *)&msg_regs->omr, 0);
56512 +
56513 +       /* Free ring */
56514 +       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
56515 +                         msg_tx_ring.virt, msg_tx_ring.phys);
56516 +
56517 +       /* Free interrupt */
56518 +       free_irq(MPC85xx_IRQ_RIO_TX, (void *)mport);
56519 +}
56520 +
56521 +/**
56522 + * mpc85xx_rio_rx_handler - MPC85xx inbound message interrupt handler
56523 + * @irq: Linux interrupt number
56524 + * @dev_instance: Pointer to interrupt-specific data
56525 + *
56526 + * Handles inbound message interrupts. Executes a registered inbound
56527 + * mailbox event handler and acks the interrupt occurrence.
56528 + */
56529 +static irqreturn_t
56530 +mpc85xx_rio_rx_handler(int irq, void *dev_instance)
56531 +{
56532 +       int isr;
56533 +       struct rio_mport *port = (struct rio_mport *)dev_instance;
56534 +
56535 +       isr = in_be32((void *)&msg_regs->isr);
56536 +
56537 +       if (isr & RIO_MSG_ISR_TE) {
56538 +               pr_info("RIO: inbound message reception error\n");
56539 +               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_TE);
56540 +               goto out;
56541 +       }
56542 +
56543 +       /* XXX Need to check/dispatch until queue empty */
56544 +       if (isr & RIO_MSG_ISR_DIQI) {
56545 +               /*
56546 +                * We implement *only* mailbox 0, but can receive messages
56547 +                * for any mailbox/letter to that mailbox destination. So,
56548 +                * make the callback with an unknown/invalid mailbox number
56549 +                * argument.
56550 +                */
56551 +               port->inb_msg[0].mcback(port, msg_rx_ring.dev_id, -1, -1);
56552 +
56553 +               /* Ack the queueing interrupt */
56554 +               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_DIQI);
56555 +       }
56556 +
56557 +      out:
56558 +       return IRQ_HANDLED;
56559 +}
56560 +
56561 +/**
56562 + * rio_open_inb_mbox - Initialize MPC85xx inbound mailbox
56563 + * @mport: Master port implementing the inbound message unit
56564 + * @dev_id: Device specific pointer to pass on event
56565 + * @mbox: Mailbox to open
56566 + * @entries: Number of entries in the inbound mailbox ring
56567 + *
56568 + * Initializes buffer ring, request the inbound message interrupt,
56569 + * and enables the inbound message unit. Returns %0 on success
56570 + * and %-EINVAL or %-ENOMEM on failure.
56571 + */
56572 +int rio_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
56573 +{
56574 +       int i, rc = 0;
56575 +
56576 +       if ((entries < RIO_MIN_RX_RING_SIZE) ||
56577 +           (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {
56578 +               rc = -EINVAL;
56579 +               goto out;
56580 +       }
56581 +
56582 +       /* Initialize client buffer ring */
56583 +       msg_rx_ring.dev_id = dev_id;
56584 +       msg_rx_ring.size = entries;
56585 +       msg_rx_ring.rx_slot = 0;
56586 +       for (i = 0; i < msg_rx_ring.size; i++)
56587 +               msg_rx_ring.virt_buffer[i] = NULL;
56588 +
56589 +       /* Initialize inbound message ring */
56590 +       if (!(msg_rx_ring.virt = dma_alloc_coherent(NULL,
56591 +                                                   msg_rx_ring.size *
56592 +                                                   RIO_MAX_MSG_SIZE,
56593 +                                                   &msg_rx_ring.phys,
56594 +                                                   GFP_KERNEL))) {
56595 +               rc = -ENOMEM;
56596 +               goto out;
56597 +       }
56598 +
56599 +       /* Point dequeue/enqueue pointers at first entry in ring */
56600 +       out_be32((void *)&msg_regs->ifqdpar, (u32) msg_rx_ring.phys);
56601 +       out_be32((void *)&msg_regs->ifqepar, (u32) msg_rx_ring.phys);
56602 +
56603 +       /* Clear interrupt status */
56604 +       out_be32((void *)&msg_regs->isr, 0x00000091);
56605 +
56606 +       /* Hook up inbound message handler */
56607 +       if ((rc =
56608 +            request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0,
56609 +                        "msg_rx", (void *)mport)) < 0) {
56610 +               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
56611 +                                 msg_tx_ring.virt_buffer[i],
56612 +                                 msg_tx_ring.phys_buffer[i]);
56613 +               goto out;
56614 +       }
56615 +
56616 +       /*
56617 +        * Configure inbound message unit:
56618 +        *      Snooping
56619 +        *      4KB max message size
56620 +        *      Unmask all interrupt sources
56621 +        *      Disable
56622 +        */
56623 +       out_be32((void *)&msg_regs->imr, 0x001b0060);
56624 +
56625 +       /* Set number of queue entries */
56626 +       out_be32((void *)&msg_regs->imr,
56627 +                in_be32((void *)&msg_regs->imr) |
56628 +                ((get_bitmask_order(entries) - 2) << 12));
56629 +
56630 +       /* Now enable the unit */
56631 +       out_be32((void *)&msg_regs->imr, in_be32((void *)&msg_regs->imr) | 0x1);
56632 +
56633 +      out:
56634 +       return rc;
56635 +}
56636 +
56637 +/**
56638 + * rio_close_inb_mbox - Shut down MPC85xx inbound mailbox
56639 + * @mport: Master port implementing the inbound message unit
56640 + * @mbox: Mailbox to close
56641 + *
56642 + * Disables the inbound message unit, free all buffers, and
56643 + * frees the inbound message interrupt.
56644 + */
56645 +void rio_close_inb_mbox(struct rio_mport *mport, int mbox)
56646 +{
56647 +       /* Disable inbound message unit */
56648 +       out_be32((void *)&msg_regs->imr, 0);
56649 +
56650 +       /* Free ring */
56651 +       dma_free_coherent(NULL, msg_rx_ring.size * RIO_MAX_MSG_SIZE,
56652 +                         msg_rx_ring.virt, msg_rx_ring.phys);
56653 +
56654 +       /* Free interrupt */
56655 +       free_irq(MPC85xx_IRQ_RIO_RX, (void *)mport);
56656 +}
56657 +
56658 +/**
56659 + * rio_hw_add_inb_buffer - Add buffer to the MPC85xx inbound message queue
56660 + * @mport: Master port implementing the inbound message unit
56661 + * @mbox: Inbound mailbox number
56662 + * @buf: Buffer to add to inbound queue
56663 + *
56664 + * Adds the @buf buffer to the MPC85xx inbound message queue. Returns
56665 + * %0 on success or %-EINVAL on failure.
56666 + */
56667 +int rio_hw_add_inb_buffer(struct rio_mport *mport, int mbox, void *buf)
56668 +{
56669 +       int rc = 0;
56670 +
56671 +       pr_debug("RIO: rio_hw_add_inb_buffer(), msg_rx_ring.rx_slot %d\n",
56672 +                msg_rx_ring.rx_slot);
56673 +
56674 +       if (msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot]) {
56675 +               printk(KERN_ERR
56676 +                      "RIO: error adding inbound buffer %d, buffer exists\n",
56677 +                      msg_rx_ring.rx_slot);
56678 +               rc = -EINVAL;
56679 +               goto out;
56680 +       }
56681 +
56682 +       msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot] = buf;
56683 +       if (++msg_rx_ring.rx_slot == msg_rx_ring.size)
56684 +               msg_rx_ring.rx_slot = 0;
56685 +
56686 +      out:
56687 +       return rc;
56688 +}
56689 +
56690 +EXPORT_SYMBOL_GPL(rio_hw_add_inb_buffer);
56691 +
56692 +/**
56693 + * rio_hw_get_inb_message - Fetch inbound message from the MPC85xx message unit
56694 + * @mport: Master port implementing the inbound message unit
56695 + * @mbox: Inbound mailbox number
56696 + *
56697 + * Gets the next available inbound message from the inbound message queue.
56698 + * A pointer to the message is returned on success or NULL on failure.
56699 + */
56700 +void *rio_hw_get_inb_message(struct rio_mport *mport, int mbox)
56701 +{
56702 +       u32 imr;
56703 +       u32 phys_buf, virt_buf;
56704 +       void *buf = NULL;
56705 +       int buf_idx;
56706 +
56707 +       phys_buf = in_be32((void *)&msg_regs->ifqdpar);
56708 +
56709 +       /* If no more messages, then bail out */
56710 +       if (phys_buf == in_be32((void *)&msg_regs->ifqepar))
56711 +               goto out2;
56712 +
56713 +       virt_buf = (u32) msg_rx_ring.virt + (phys_buf - msg_rx_ring.phys);
56714 +       buf_idx = (phys_buf - msg_rx_ring.phys) / RIO_MAX_MSG_SIZE;
56715 +       buf = msg_rx_ring.virt_buffer[buf_idx];
56716 +
56717 +       if (!buf) {
56718 +               printk(KERN_ERR
56719 +                      "RIO: inbound message copy failed, no buffers\n");
56720 +               goto out1;
56721 +       }
56722 +
56723 +       /* Copy max message size, caller is expected to allocate that big */
56724 +       memcpy(buf, (void *)virt_buf, RIO_MAX_MSG_SIZE);
56725 +
56726 +       /* Clear the available buffer */
56727 +       msg_rx_ring.virt_buffer[buf_idx] = NULL;
56728 +
56729 +      out1:
56730 +       imr = in_be32((void *)&msg_regs->imr);
56731 +       out_be32((void *)&msg_regs->imr, imr | RIO_MSG_IMR_MI);
56732 +
56733 +      out2:
56734 +       return buf;
56735 +}
56736 +
56737 +EXPORT_SYMBOL_GPL(rio_hw_get_inb_message);
56738 +
56739 +/**
56740 + * mpc85xx_rio_dbell_handler - MPC85xx doorbell interrupt handler
56741 + * @irq: Linux interrupt number
56742 + * @dev_instance: Pointer to interrupt-specific data
56743 + *
56744 + * Handles doorbell interrupts. Parses a list of registered
56745 + * doorbell event handlers and executes a matching event handler.
56746 + */
56747 +static irqreturn_t
56748 +mpc85xx_rio_dbell_handler(int irq, void *dev_instance)
56749 +{
56750 +       int dsr;
56751 +       struct rio_mport *port = (struct rio_mport *)dev_instance;
56752 +
56753 +       dsr = in_be32((void *)&msg_regs->dsr);
56754 +
56755 +       if (dsr & DOORBELL_DSR_TE) {
56756 +               pr_info("RIO: doorbell reception error\n");
56757 +               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_TE);
56758 +               goto out;
56759 +       }
56760 +
56761 +       if (dsr & DOORBELL_DSR_QFI) {
56762 +               pr_info("RIO: doorbell queue full\n");
56763 +               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_QFI);
56764 +               goto out;
56765 +       }
56766 +
56767 +       /* XXX Need to check/dispatch until queue empty */
56768 +       if (dsr & DOORBELL_DSR_DIQI) {
56769 +               u32 dmsg =
56770 +                   (u32) dbell_ring.virt +
56771 +                   (in_be32((void *)&msg_regs->dqdpar) & 0xfff);
56772 +               u32 dmr;
56773 +               struct rio_dbell *dbell;
56774 +               int found = 0;
56775 +
56776 +               pr_debug
56777 +                   ("RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
56778 +                    DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
56779 +
56780 +               list_for_each_entry(dbell, &port->dbells, node) {
56781 +                       if ((dbell->res->start <= DBELL_INF(dmsg)) &&
56782 +                           (dbell->res->end >= DBELL_INF(dmsg))) {
56783 +                               found = 1;
56784 +                               break;
56785 +                       }
56786 +               }
56787 +               if (found) {
56788 +                       dbell->dinb(port, dbell->dev_id, DBELL_SID(dmsg), DBELL_TID(dmsg),
56789 +                                   DBELL_INF(dmsg));
56790 +               } else {
56791 +                       pr_debug
56792 +                           ("RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
56793 +                            DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
56794 +               }
56795 +               dmr = in_be32((void *)&msg_regs->dmr);
56796 +               out_be32((void *)&msg_regs->dmr, dmr | DOORBELL_DMR_DI);
56797 +               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_DIQI);
56798 +       }
56799 +
56800 +      out:
56801 +       return IRQ_HANDLED;
56802 +}
56803 +
56804 +/**
56805 + * mpc85xx_rio_doorbell_init - MPC85xx doorbell interface init
56806 + * @mport: Master port implementing the inbound doorbell unit
56807 + *
56808 + * Initializes doorbell unit hardware and inbound DMA buffer
56809 + * ring. Called from mpc85xx_rio_setup(). Returns %0 on success
56810 + * or %-ENOMEM on failure.
56811 + */
56812 +static int mpc85xx_rio_doorbell_init(struct rio_mport *mport)
56813 +{
56814 +       int rc = 0;
56815 +
56816 +       /* Map outbound doorbell window immediately after maintenance window */
56817 +       if (!(dbell_win =
56818 +             (u32) ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
56819 +                           RIO_DBELL_WIN_SIZE))) {
56820 +               printk(KERN_ERR
56821 +                      "RIO: unable to map outbound doorbell window\n");
56822 +               rc = -ENOMEM;
56823 +               goto out;
56824 +       }
56825 +
56826 +       /* Initialize inbound doorbells */
56827 +       if (!(dbell_ring.virt = dma_alloc_coherent(NULL,
56828 +                                                  512 * DOORBELL_MESSAGE_SIZE,
56829 +                                                  &dbell_ring.phys,
56830 +                                                  GFP_KERNEL))) {
56831 +               printk(KERN_ERR "RIO: unable allocate inbound doorbell ring\n");
56832 +               rc = -ENOMEM;
56833 +               iounmap((void *)dbell_win);
56834 +               goto out;
56835 +       }
56836 +
56837 +       /* Point dequeue/enqueue pointers at first entry in ring */
56838 +       out_be32((void *)&msg_regs->dqdpar, (u32) dbell_ring.phys);
56839 +       out_be32((void *)&msg_regs->dqepar, (u32) dbell_ring.phys);
56840 +
56841 +       /* Clear interrupt status */
56842 +       out_be32((void *)&msg_regs->dsr, 0x00000091);
56843 +
56844 +       /* Hook up doorbell handler */
56845 +       if ((rc =
56846 +            request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0,
56847 +                        "dbell_rx", (void *)mport) < 0)) {
56848 +               iounmap((void *)dbell_win);
56849 +               dma_free_coherent(NULL, 512 * DOORBELL_MESSAGE_SIZE,
56850 +                                 dbell_ring.virt, dbell_ring.phys);
56851 +               printk(KERN_ERR
56852 +                      "MPC85xx RIO: unable to request inbound doorbell irq");
56853 +               goto out;
56854 +       }
56855 +
56856 +       /* Configure doorbells for snooping, 512 entries, and enable */
56857 +       out_be32((void *)&msg_regs->dmr, 0x00108161);
56858 +
56859 +      out:
56860 +       return rc;
56861 +}
56862 +
56863 +static char *cmdline = NULL;
56864 +
56865 +static int mpc85xx_rio_get_hdid(int index)
56866 +{
56867 +       /* XXX Need to parse multiple entries in some format */
56868 +       if (!cmdline)
56869 +               return -1;
56870 +
56871 +       return simple_strtol(cmdline, NULL, 0);
56872 +}
56873 +
56874 +static int mpc85xx_rio_get_cmdline(char *s)
56875 +{
56876 +       if (!s)
56877 +               return 0;
56878 +
56879 +       cmdline = s;
56880 +       return 1;
56881 +}
56882 +
56883 +__setup("riohdid=", mpc85xx_rio_get_cmdline);
56884 +
56885 +/**
56886 + * mpc85xx_rio_setup - Setup MPC85xx RapidIO interface
56887 + * @law_start: Starting physical address of RapidIO LAW
56888 + * @law_size: Size of RapidIO LAW
56889 + *
56890 + * Initializes MPC85xx RapidIO hardware interface, configures
56891 + * master port with system-specific info, and registers the
56892 + * master port with the RapidIO subsystem.
56893 + */
56894 +void mpc85xx_rio_setup(int law_start, int law_size)
56895 +{
56896 +       struct rio_ops *ops;
56897 +       struct rio_mport *port;
56898 +
56899 +       ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL);
56900 +       ops->lcread = mpc85xx_local_config_read;
56901 +       ops->lcwrite = mpc85xx_local_config_write;
56902 +       ops->cread = mpc85xx_rio_config_read;
56903 +       ops->cwrite = mpc85xx_rio_config_write;
56904 +       ops->dsend = mpc85xx_rio_doorbell_send;
56905 +
56906 +       port = kmalloc(sizeof(struct rio_mport), GFP_KERNEL);
56907 +       port->id = 0;
56908 +       port->index = 0;
56909 +       INIT_LIST_HEAD(&port->dbells);
56910 +       port->iores.start = law_start;
56911 +       port->iores.end = law_start + law_size;
56912 +       port->iores.flags = IORESOURCE_MEM;
56913 +
56914 +       rio_init_dbell_res(&port->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff);
56915 +       rio_init_mbox_res(&port->riores[RIO_INB_MBOX_RESOURCE], 0, 0);
56916 +       rio_init_mbox_res(&port->riores[RIO_OUTB_MBOX_RESOURCE], 0, 0);
56917 +       strcpy(port->name, "RIO0 mport");
56918 +
56919 +       port->ops = ops;
56920 +       port->host_deviceid = mpc85xx_rio_get_hdid(port->id);
56921 +
56922 +       rio_register_mport(port);
56923 +
56924 +       regs_win = (u32) ioremap(RIO_REGS_BASE, 0x20000);
56925 +       atmu_regs = (struct rio_atmu_regs *)(regs_win + RIO_ATMU_REGS_OFFSET);
56926 +       maint_atmu_regs = atmu_regs + 1;
56927 +       dbell_atmu_regs = atmu_regs + 2;
56928 +       msg_regs = (struct rio_msg_regs *)(regs_win + RIO_MSG_REGS_OFFSET);
56929 +
56930 +       /* Configure maintenance transaction window */
56931 +       out_be32((void *)&maint_atmu_regs->rowbar, 0x000c0000);
56932 +       out_be32((void *)&maint_atmu_regs->rowar, 0x80077015);
56933 +
56934 +       maint_win = (u32) ioremap(law_start, RIO_MAINT_WIN_SIZE);
56935 +
56936 +       /* Configure outbound doorbell window */
56937 +       out_be32((void *)&dbell_atmu_regs->rowbar, 0x000c0400);
56938 +       out_be32((void *)&dbell_atmu_regs->rowar, 0x8004200b);
56939 +       mpc85xx_rio_doorbell_init(port);
56940 +}
56941 Index: linux-2.6.24.7/arch/powerpc/sysdev/fsl_rio.h
56942 ===================================================================
56943 --- /dev/null
56944 +++ linux-2.6.24.7/arch/powerpc/sysdev/fsl_rio.h
56945 @@ -0,0 +1,20 @@
56946 +/*
56947 + * MPC85xx RapidIO definitions
56948 + *
56949 + * Copyright 2005 MontaVista Software, Inc.
56950 + * Matt Porter <mporter@kernel.crashing.org>
56951 + *
56952 + * This program is free software; you can redistribute  it and/or modify it
56953 + * under  the terms of  the GNU General  Public License as published by the
56954 + * Free Software Foundation;  either version 2 of the  License, or (at your
56955 + * option) any later version.
56956 + */
56957 +
56958 +#ifndef __PPC_SYSLIB_PPC85XX_RIO_H
56959 +#define __PPC_SYSLIB_PPC85XX_RIO_H
56960 +
56961 +#include <linux/init.h>
56962 +
56963 +extern void mpc85xx_rio_setup(int law_start, int law_size);
56964 +
56965 +#endif                         /* __PPC_SYSLIB_PPC85XX_RIO_H */
56966 Index: linux-2.6.24.7/arch/powerpc/sysdev/fsl_soc.c
56967 ===================================================================
56968 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/fsl_soc.c
56969 +++ linux-2.6.24.7/arch/powerpc/sysdev/fsl_soc.c
56970 @@ -24,6 +24,7 @@
56971  #include <linux/platform_device.h>
56972  #include <linux/of_platform.h>
56973  #include <linux/phy.h>
56974 +#include <linux/phy_fixed.h>
56975  #include <linux/spi/spi.h>
56976  #include <linux/fsl_devices.h>
56977  #include <linux/fs_enet_pd.h>
56978 @@ -54,10 +55,18 @@ phys_addr_t get_immrbase(void)
56979         soc = of_find_node_by_type(NULL, "soc");
56980         if (soc) {
56981                 int size;
56982 -               const void *prop = of_get_property(soc, "reg", &size);
56983 +               u32 naddr;
56984 +               const u32 *prop = of_get_property(soc, "#address-cells", &size);
56985  
56986 +               if (prop && size == 4)
56987 +                       naddr = *prop;
56988 +               else
56989 +                       naddr = 2;
56990 +
56991 +               prop = of_get_property(soc, "ranges", &size);
56992                 if (prop)
56993 -                       immrbase = of_translate_address(soc, prop);
56994 +                       immrbase = of_translate_address(soc, prop + naddr);
56995 +
56996                 of_node_put(soc);
56997         }
56998  
56999 @@ -130,17 +139,51 @@ u32 get_baudrate(void)
57000  EXPORT_SYMBOL(get_baudrate);
57001  #endif /* CONFIG_CPM2 */
57002  
57003 -static int __init gfar_mdio_of_init(void)
57004 +#ifdef CONFIG_FIXED_PHY
57005 +static int __init of_add_fixed_phys(void)
57006  {
57007 +       int ret;
57008         struct device_node *np;
57009 -       unsigned int i;
57010 +       u32 *fixed_link;
57011 +       struct fixed_phy_status status = {};
57012 +
57013 +       for_each_node_by_name(np, "ethernet") {
57014 +               fixed_link  = (u32 *)of_get_property(np, "fixed-link", NULL);
57015 +               if (!fixed_link)
57016 +                       continue;
57017 +
57018 +               status.link = 1;
57019 +               status.duplex = fixed_link[1];
57020 +               status.speed = fixed_link[2];
57021 +               status.pause = fixed_link[3];
57022 +               status.asym_pause = fixed_link[4];
57023 +
57024 +               ret = fixed_phy_add(PHY_POLL, fixed_link[0], &status);
57025 +               if (ret) {
57026 +                       of_node_put(np);
57027 +                       return ret;
57028 +               }
57029 +       }
57030 +
57031 +       return 0;
57032 +}
57033 +arch_initcall(of_add_fixed_phys);
57034 +#endif /* CONFIG_FIXED_PHY */
57035 +
57036 +static int __init gfar_mdio_of_init(void)
57037 +{
57038 +       struct device_node *np = NULL;
57039         struct platform_device *mdio_dev;
57040         struct resource res;
57041         int ret;
57042  
57043 -       for (np = NULL, i = 0;
57044 -            (np = of_find_compatible_node(np, "mdio", "gianfar")) != NULL;
57045 -            i++) {
57046 +       np = of_find_compatible_node(np, NULL, "fsl,gianfar-mdio");
57047 +
57048 +       /* try the deprecated version */
57049 +       if (!np)
57050 +               np = of_find_compatible_node(np, "mdio", "gianfar");
57051 +
57052 +       if (np) {
57053                 int k;
57054                 struct device_node *child = NULL;
57055                 struct gianfar_mdio_data mdio_data;
57056 @@ -179,11 +222,13 @@ static int __init gfar_mdio_of_init(void
57057                         goto unreg;
57058         }
57059  
57060 +       of_node_put(np);
57061         return 0;
57062  
57063  unreg:
57064         platform_device_unregister(mdio_dev);
57065  err:
57066 +       of_node_put(np);
57067         return ret;
57068  }
57069  
57070 @@ -193,7 +238,6 @@ static const char *gfar_tx_intr = "tx";
57071  static const char *gfar_rx_intr = "rx";
57072  static const char *gfar_err_intr = "error";
57073  
57074 -
57075  static int __init gfar_of_init(void)
57076  {
57077         struct device_node *np;
57078 @@ -277,29 +321,43 @@ static int __init gfar_of_init(void)
57079                         gfar_data.interface = PHY_INTERFACE_MODE_MII;
57080  
57081                 ph = of_get_property(np, "phy-handle", NULL);
57082 -               phy = of_find_node_by_phandle(*ph);
57083 +               if (ph == NULL) {
57084 +                       u32 *fixed_link;
57085  
57086 -               if (phy == NULL) {
57087 -                       ret = -ENODEV;
57088 -                       goto unreg;
57089 -               }
57090 +                       fixed_link = (u32 *)of_get_property(np, "fixed-link",
57091 +                                                          NULL);
57092 +                       if (!fixed_link) {
57093 +                               ret = -ENODEV;
57094 +                               goto unreg;
57095 +                       }
57096  
57097 -               mdio = of_get_parent(phy);
57098 +                       gfar_data.bus_id = 0;
57099 +                       gfar_data.phy_id = fixed_link[0];
57100 +               } else {
57101 +                       phy = of_find_node_by_phandle(*ph);
57102 +
57103 +                       if (phy == NULL) {
57104 +                               ret = -ENODEV;
57105 +                               goto unreg;
57106 +                       }
57107 +
57108 +                       mdio = of_get_parent(phy);
57109 +
57110 +                       id = of_get_property(phy, "reg", NULL);
57111 +                       ret = of_address_to_resource(mdio, 0, &res);
57112 +                       if (ret) {
57113 +                               of_node_put(phy);
57114 +                               of_node_put(mdio);
57115 +                               goto unreg;
57116 +                       }
57117 +
57118 +                       gfar_data.phy_id = *id;
57119 +                       gfar_data.bus_id = res.start;
57120  
57121 -               id = of_get_property(phy, "reg", NULL);
57122 -               ret = of_address_to_resource(mdio, 0, &res);
57123 -               if (ret) {
57124                         of_node_put(phy);
57125                         of_node_put(mdio);
57126 -                       goto unreg;
57127                 }
57128  
57129 -               gfar_data.phy_id = *id;
57130 -               gfar_data.bus_id = res.start;
57131 -
57132 -               of_node_put(phy);
57133 -               of_node_put(mdio);
57134 -
57135                 ret =
57136                     platform_device_add_data(gfar_dev, &gfar_data,
57137                                              sizeof(struct
57138 @@ -390,13 +448,11 @@ static void __init of_register_i2c_devic
57139  static int __init fsl_i2c_of_init(void)
57140  {
57141         struct device_node *np;
57142 -       unsigned int i;
57143 +       unsigned int i = 0;
57144         struct platform_device *i2c_dev;
57145         int ret;
57146  
57147 -       for (np = NULL, i = 0;
57148 -            (np = of_find_compatible_node(np, "i2c", "fsl-i2c")) != NULL;
57149 -            i++) {
57150 +       for_each_compatible_node(np, NULL, "fsl-i2c") {
57151                 struct resource r[2];
57152                 struct fsl_i2c_platform_data i2c_data;
57153                 const unsigned char *flags = NULL;
57154 @@ -432,7 +488,7 @@ static int __init fsl_i2c_of_init(void)
57155                 if (ret)
57156                         goto unreg;
57157  
57158 -               of_register_i2c_devices(np, i);
57159 +               of_register_i2c_devices(np, i++);
57160         }
57161  
57162         return 0;
57163 @@ -528,14 +584,12 @@ static enum fsl_usb2_phy_modes determine
57164  static int __init fsl_usb_of_init(void)
57165  {
57166         struct device_node *np;
57167 -       unsigned int i;
57168 +       unsigned int i = 0;
57169         struct platform_device *usb_dev_mph = NULL, *usb_dev_dr_host = NULL,
57170                 *usb_dev_dr_client = NULL;
57171         int ret;
57172  
57173 -       for (np = NULL, i = 0;
57174 -            (np = of_find_compatible_node(np, "usb", "fsl-usb2-mph")) != NULL;
57175 -            i++) {
57176 +       for_each_compatible_node(np, NULL, "fsl-usb2-mph") {
57177                 struct resource r[2];
57178                 struct fsl_usb2_platform_data usb_data;
57179                 const unsigned char *prop = NULL;
57180 @@ -578,11 +632,10 @@ static int __init fsl_usb_of_init(void)
57181                                                     fsl_usb2_platform_data));
57182                 if (ret)
57183                         goto unreg_mph;
57184 +               i++;
57185         }
57186  
57187 -       for (np = NULL;
57188 -            (np = of_find_compatible_node(np, "usb", "fsl-usb2-dr")) != NULL;
57189 -            i++) {
57190 +       for_each_compatible_node(np, NULL, "fsl-usb2-dr") {
57191                 struct resource r[2];
57192                 struct fsl_usb2_platform_data usb_data;
57193                 const unsigned char *prop = NULL;
57194 @@ -654,6 +707,7 @@ static int __init fsl_usb_of_init(void)
57195                                                 fsl_usb2_platform_data))))
57196                                 goto unreg_dr;
57197                 }
57198 +               i++;
57199         }
57200         return 0;
57201  
57202 @@ -1125,13 +1179,12 @@ arch_initcall(fs_enet_of_init);
57203  
57204  static int __init fsl_pcmcia_of_init(void)
57205  {
57206 -       struct device_node *np = NULL;
57207 +       struct device_node *np;
57208         /*
57209          * Register all the devices which type is "pcmcia"
57210          */
57211 -       while ((np = of_find_compatible_node(np,
57212 -                       "pcmcia", "fsl,pq-pcmcia")) != NULL)
57213 -                           of_platform_device_create(np, "m8xx-pcmcia", NULL);
57214 +       for_each_compatible_node(np, "pcmcia", "fsl,pq-pcmcia")
57215 +               of_platform_device_create(np, "m8xx-pcmcia", NULL);
57216         return 0;
57217  }
57218  
57219 Index: linux-2.6.24.7/arch/powerpc/sysdev/grackle.c
57220 ===================================================================
57221 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/grackle.c
57222 +++ linux-2.6.24.7/arch/powerpc/sysdev/grackle.c
57223 @@ -57,7 +57,7 @@ void __init setup_grackle(struct pci_con
57224  {
57225         setup_indirect_pci(hose, 0xfec00000, 0xfee00000, 0);
57226         if (machine_is_compatible("PowerMac1,1"))
57227 -               pci_assign_all_buses = 1;
57228 +               ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
57229         if (machine_is_compatible("AAPL,PowerBook1998"))
57230                 grackle_set_loop_snoop(hose, 1);
57231  #if 0  /* Disabled for now, HW problems ??? */
57232 Index: linux-2.6.24.7/arch/powerpc/sysdev/ipic.c
57233 ===================================================================
57234 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/ipic.c
57235 +++ linux-2.6.24.7/arch/powerpc/sysdev/ipic.c
57236 @@ -30,11 +30,67 @@
57237  #include "ipic.h"
57238  
57239  static struct ipic * primary_ipic;
57240 +static struct irq_chip ipic_level_irq_chip, ipic_edge_irq_chip;
57241  static DEFINE_SPINLOCK(ipic_lock);
57242  
57243  static struct ipic_info ipic_info[] = {
57244 +       [1] = {
57245 +               .mask   = IPIC_SIMSR_H,
57246 +               .prio   = IPIC_SIPRR_C,
57247 +               .force  = IPIC_SIFCR_H,
57248 +               .bit    = 16,
57249 +               .prio_mask = 0,
57250 +       },
57251 +       [2] = {
57252 +               .mask   = IPIC_SIMSR_H,
57253 +               .prio   = IPIC_SIPRR_C,
57254 +               .force  = IPIC_SIFCR_H,
57255 +               .bit    = 17,
57256 +               .prio_mask = 1,
57257 +       },
57258 +       [3] = {
57259 +               .mask   = IPIC_SIMSR_H,
57260 +               .prio   = IPIC_SIPRR_C,
57261 +               .force  = IPIC_SIFCR_H,
57262 +               .bit    = 18,
57263 +               .prio_mask = 2,
57264 +       },
57265 +       [4] = {
57266 +               .mask   = IPIC_SIMSR_H,
57267 +               .prio   = IPIC_SIPRR_C,
57268 +               .force  = IPIC_SIFCR_H,
57269 +               .bit    = 19,
57270 +               .prio_mask = 3,
57271 +       },
57272 +       [5] = {
57273 +               .mask   = IPIC_SIMSR_H,
57274 +               .prio   = IPIC_SIPRR_C,
57275 +               .force  = IPIC_SIFCR_H,
57276 +               .bit    = 20,
57277 +               .prio_mask = 4,
57278 +       },
57279 +       [6] = {
57280 +               .mask   = IPIC_SIMSR_H,
57281 +               .prio   = IPIC_SIPRR_C,
57282 +               .force  = IPIC_SIFCR_H,
57283 +               .bit    = 21,
57284 +               .prio_mask = 5,
57285 +       },
57286 +       [7] = {
57287 +               .mask   = IPIC_SIMSR_H,
57288 +               .prio   = IPIC_SIPRR_C,
57289 +               .force  = IPIC_SIFCR_H,
57290 +               .bit    = 22,
57291 +               .prio_mask = 6,
57292 +       },
57293 +       [8] = {
57294 +               .mask   = IPIC_SIMSR_H,
57295 +               .prio   = IPIC_SIPRR_C,
57296 +               .force  = IPIC_SIFCR_H,
57297 +               .bit    = 23,
57298 +               .prio_mask = 7,
57299 +       },
57300         [9] = {
57301 -               .pend   = IPIC_SIPNR_H,
57302                 .mask   = IPIC_SIMSR_H,
57303                 .prio   = IPIC_SIPRR_D,
57304                 .force  = IPIC_SIFCR_H,
57305 @@ -42,7 +98,6 @@ static struct ipic_info ipic_info[] = {
57306                 .prio_mask = 0,
57307         },
57308         [10] = {
57309 -               .pend   = IPIC_SIPNR_H,
57310                 .mask   = IPIC_SIMSR_H,
57311                 .prio   = IPIC_SIPRR_D,
57312                 .force  = IPIC_SIFCR_H,
57313 @@ -50,15 +105,27 @@ static struct ipic_info ipic_info[] = {
57314                 .prio_mask = 1,
57315         },
57316         [11] = {
57317 -               .pend   = IPIC_SIPNR_H,
57318                 .mask   = IPIC_SIMSR_H,
57319                 .prio   = IPIC_SIPRR_D,
57320                 .force  = IPIC_SIFCR_H,
57321                 .bit    = 26,
57322                 .prio_mask = 2,
57323         },
57324 +       [12] = {
57325 +               .mask   = IPIC_SIMSR_H,
57326 +               .prio   = IPIC_SIPRR_D,
57327 +               .force  = IPIC_SIFCR_H,
57328 +               .bit    = 27,
57329 +               .prio_mask = 3,
57330 +       },
57331 +       [13] = {
57332 +               .mask   = IPIC_SIMSR_H,
57333 +               .prio   = IPIC_SIPRR_D,
57334 +               .force  = IPIC_SIFCR_H,
57335 +               .bit    = 28,
57336 +               .prio_mask = 4,
57337 +       },
57338         [14] = {
57339 -               .pend   = IPIC_SIPNR_H,
57340                 .mask   = IPIC_SIMSR_H,
57341                 .prio   = IPIC_SIPRR_D,
57342                 .force  = IPIC_SIFCR_H,
57343 @@ -66,7 +133,6 @@ static struct ipic_info ipic_info[] = {
57344                 .prio_mask = 5,
57345         },
57346         [15] = {
57347 -               .pend   = IPIC_SIPNR_H,
57348                 .mask   = IPIC_SIMSR_H,
57349                 .prio   = IPIC_SIPRR_D,
57350                 .force  = IPIC_SIFCR_H,
57351 @@ -74,7 +140,6 @@ static struct ipic_info ipic_info[] = {
57352                 .prio_mask = 6,
57353         },
57354         [16] = {
57355 -               .pend   = IPIC_SIPNR_H,
57356                 .mask   = IPIC_SIMSR_H,
57357                 .prio   = IPIC_SIPRR_D,
57358                 .force  = IPIC_SIFCR_H,
57359 @@ -82,7 +147,7 @@ static struct ipic_info ipic_info[] = {
57360                 .prio_mask = 7,
57361         },
57362         [17] = {
57363 -               .pend   = IPIC_SEPNR,
57364 +               .ack    = IPIC_SEPNR,
57365                 .mask   = IPIC_SEMSR,
57366                 .prio   = IPIC_SMPRR_A,
57367                 .force  = IPIC_SEFCR,
57368 @@ -90,7 +155,7 @@ static struct ipic_info ipic_info[] = {
57369                 .prio_mask = 5,
57370         },
57371         [18] = {
57372 -               .pend   = IPIC_SEPNR,
57373 +               .ack    = IPIC_SEPNR,
57374                 .mask   = IPIC_SEMSR,
57375                 .prio   = IPIC_SMPRR_A,
57376                 .force  = IPIC_SEFCR,
57377 @@ -98,7 +163,7 @@ static struct ipic_info ipic_info[] = {
57378                 .prio_mask = 6,
57379         },
57380         [19] = {
57381 -               .pend   = IPIC_SEPNR,
57382 +               .ack    = IPIC_SEPNR,
57383                 .mask   = IPIC_SEMSR,
57384                 .prio   = IPIC_SMPRR_A,
57385                 .force  = IPIC_SEFCR,
57386 @@ -106,7 +171,7 @@ static struct ipic_info ipic_info[] = {
57387                 .prio_mask = 7,
57388         },
57389         [20] = {
57390 -               .pend   = IPIC_SEPNR,
57391 +               .ack    = IPIC_SEPNR,
57392                 .mask   = IPIC_SEMSR,
57393                 .prio   = IPIC_SMPRR_B,
57394                 .force  = IPIC_SEFCR,
57395 @@ -114,7 +179,7 @@ static struct ipic_info ipic_info[] = {
57396                 .prio_mask = 4,
57397         },
57398         [21] = {
57399 -               .pend   = IPIC_SEPNR,
57400 +               .ack    = IPIC_SEPNR,
57401                 .mask   = IPIC_SEMSR,
57402                 .prio   = IPIC_SMPRR_B,
57403                 .force  = IPIC_SEFCR,
57404 @@ -122,7 +187,7 @@ static struct ipic_info ipic_info[] = {
57405                 .prio_mask = 5,
57406         },
57407         [22] = {
57408 -               .pend   = IPIC_SEPNR,
57409 +               .ack    = IPIC_SEPNR,
57410                 .mask   = IPIC_SEMSR,
57411                 .prio   = IPIC_SMPRR_B,
57412                 .force  = IPIC_SEFCR,
57413 @@ -130,7 +195,7 @@ static struct ipic_info ipic_info[] = {
57414                 .prio_mask = 6,
57415         },
57416         [23] = {
57417 -               .pend   = IPIC_SEPNR,
57418 +               .ack    = IPIC_SEPNR,
57419                 .mask   = IPIC_SEMSR,
57420                 .prio   = IPIC_SMPRR_B,
57421                 .force  = IPIC_SEFCR,
57422 @@ -138,7 +203,6 @@ static struct ipic_info ipic_info[] = {
57423                 .prio_mask = 7,
57424         },
57425         [32] = {
57426 -               .pend   = IPIC_SIPNR_H,
57427                 .mask   = IPIC_SIMSR_H,
57428                 .prio   = IPIC_SIPRR_A,
57429                 .force  = IPIC_SIFCR_H,
57430 @@ -146,7 +210,6 @@ static struct ipic_info ipic_info[] = {
57431                 .prio_mask = 0,
57432         },
57433         [33] = {
57434 -               .pend   = IPIC_SIPNR_H,
57435                 .mask   = IPIC_SIMSR_H,
57436                 .prio   = IPIC_SIPRR_A,
57437                 .force  = IPIC_SIFCR_H,
57438 @@ -154,7 +217,6 @@ static struct ipic_info ipic_info[] = {
57439                 .prio_mask = 1,
57440         },
57441         [34] = {
57442 -               .pend   = IPIC_SIPNR_H,
57443                 .mask   = IPIC_SIMSR_H,
57444                 .prio   = IPIC_SIPRR_A,
57445                 .force  = IPIC_SIFCR_H,
57446 @@ -162,7 +224,6 @@ static struct ipic_info ipic_info[] = {
57447                 .prio_mask = 2,
57448         },
57449         [35] = {
57450 -               .pend   = IPIC_SIPNR_H,
57451                 .mask   = IPIC_SIMSR_H,
57452                 .prio   = IPIC_SIPRR_A,
57453                 .force  = IPIC_SIFCR_H,
57454 @@ -170,7 +231,6 @@ static struct ipic_info ipic_info[] = {
57455                 .prio_mask = 3,
57456         },
57457         [36] = {
57458 -               .pend   = IPIC_SIPNR_H,
57459                 .mask   = IPIC_SIMSR_H,
57460                 .prio   = IPIC_SIPRR_A,
57461                 .force  = IPIC_SIFCR_H,
57462 @@ -178,7 +238,6 @@ static struct ipic_info ipic_info[] = {
57463                 .prio_mask = 4,
57464         },
57465         [37] = {
57466 -               .pend   = IPIC_SIPNR_H,
57467                 .mask   = IPIC_SIMSR_H,
57468                 .prio   = IPIC_SIPRR_A,
57469                 .force  = IPIC_SIFCR_H,
57470 @@ -186,7 +245,6 @@ static struct ipic_info ipic_info[] = {
57471                 .prio_mask = 5,
57472         },
57473         [38] = {
57474 -               .pend   = IPIC_SIPNR_H,
57475                 .mask   = IPIC_SIMSR_H,
57476                 .prio   = IPIC_SIPRR_A,
57477                 .force  = IPIC_SIFCR_H,
57478 @@ -194,15 +252,69 @@ static struct ipic_info ipic_info[] = {
57479                 .prio_mask = 6,
57480         },
57481         [39] = {
57482 -               .pend   = IPIC_SIPNR_H,
57483                 .mask   = IPIC_SIMSR_H,
57484                 .prio   = IPIC_SIPRR_A,
57485                 .force  = IPIC_SIFCR_H,
57486                 .bit    = 7,
57487                 .prio_mask = 7,
57488         },
57489 +       [40] = {
57490 +               .mask   = IPIC_SIMSR_H,
57491 +               .prio   = IPIC_SIPRR_B,
57492 +               .force  = IPIC_SIFCR_H,
57493 +               .bit    = 8,
57494 +               .prio_mask = 0,
57495 +       },
57496 +       [41] = {
57497 +               .mask   = IPIC_SIMSR_H,
57498 +               .prio   = IPIC_SIPRR_B,
57499 +               .force  = IPIC_SIFCR_H,
57500 +               .bit    = 9,
57501 +               .prio_mask = 1,
57502 +       },
57503 +       [42] = {
57504 +               .mask   = IPIC_SIMSR_H,
57505 +               .prio   = IPIC_SIPRR_B,
57506 +               .force  = IPIC_SIFCR_H,
57507 +               .bit    = 10,
57508 +               .prio_mask = 2,
57509 +       },
57510 +       [43] = {
57511 +               .mask   = IPIC_SIMSR_H,
57512 +               .prio   = IPIC_SIPRR_B,
57513 +               .force  = IPIC_SIFCR_H,
57514 +               .bit    = 11,
57515 +               .prio_mask = 3,
57516 +       },
57517 +       [44] = {
57518 +               .mask   = IPIC_SIMSR_H,
57519 +               .prio   = IPIC_SIPRR_B,
57520 +               .force  = IPIC_SIFCR_H,
57521 +               .bit    = 12,
57522 +               .prio_mask = 4,
57523 +       },
57524 +       [45] = {
57525 +               .mask   = IPIC_SIMSR_H,
57526 +               .prio   = IPIC_SIPRR_B,
57527 +               .force  = IPIC_SIFCR_H,
57528 +               .bit    = 13,
57529 +               .prio_mask = 5,
57530 +       },
57531 +       [46] = {
57532 +               .mask   = IPIC_SIMSR_H,
57533 +               .prio   = IPIC_SIPRR_B,
57534 +               .force  = IPIC_SIFCR_H,
57535 +               .bit    = 14,
57536 +               .prio_mask = 6,
57537 +       },
57538 +       [47] = {
57539 +               .mask   = IPIC_SIMSR_H,
57540 +               .prio   = IPIC_SIPRR_B,
57541 +               .force  = IPIC_SIFCR_H,
57542 +               .bit    = 15,
57543 +               .prio_mask = 7,
57544 +       },
57545         [48] = {
57546 -               .pend   = IPIC_SEPNR,
57547                 .mask   = IPIC_SEMSR,
57548                 .prio   = IPIC_SMPRR_A,
57549                 .force  = IPIC_SEFCR,
57550 @@ -210,7 +322,6 @@ static struct ipic_info ipic_info[] = {
57551                 .prio_mask = 4,
57552         },
57553         [64] = {
57554 -               .pend   = IPIC_SIPNR_L,
57555                 .mask   = IPIC_SIMSR_L,
57556                 .prio   = IPIC_SMPRR_A,
57557                 .force  = IPIC_SIFCR_L,
57558 @@ -218,7 +329,6 @@ static struct ipic_info ipic_info[] = {
57559                 .prio_mask = 0,
57560         },
57561         [65] = {
57562 -               .pend   = IPIC_SIPNR_L,
57563                 .mask   = IPIC_SIMSR_L,
57564                 .prio   = IPIC_SMPRR_A,
57565                 .force  = IPIC_SIFCR_L,
57566 @@ -226,7 +336,6 @@ static struct ipic_info ipic_info[] = {
57567                 .prio_mask = 1,
57568         },
57569         [66] = {
57570 -               .pend   = IPIC_SIPNR_L,
57571                 .mask   = IPIC_SIMSR_L,
57572                 .prio   = IPIC_SMPRR_A,
57573                 .force  = IPIC_SIFCR_L,
57574 @@ -234,7 +343,6 @@ static struct ipic_info ipic_info[] = {
57575                 .prio_mask = 2,
57576         },
57577         [67] = {
57578 -               .pend   = IPIC_SIPNR_L,
57579                 .mask   = IPIC_SIMSR_L,
57580                 .prio   = IPIC_SMPRR_A,
57581                 .force  = IPIC_SIFCR_L,
57582 @@ -242,7 +350,6 @@ static struct ipic_info ipic_info[] = {
57583                 .prio_mask = 3,
57584         },
57585         [68] = {
57586 -               .pend   = IPIC_SIPNR_L,
57587                 .mask   = IPIC_SIMSR_L,
57588                 .prio   = IPIC_SMPRR_B,
57589                 .force  = IPIC_SIFCR_L,
57590 @@ -250,7 +357,6 @@ static struct ipic_info ipic_info[] = {
57591                 .prio_mask = 0,
57592         },
57593         [69] = {
57594 -               .pend   = IPIC_SIPNR_L,
57595                 .mask   = IPIC_SIMSR_L,
57596                 .prio   = IPIC_SMPRR_B,
57597                 .force  = IPIC_SIFCR_L,
57598 @@ -258,7 +364,6 @@ static struct ipic_info ipic_info[] = {
57599                 .prio_mask = 1,
57600         },
57601         [70] = {
57602 -               .pend   = IPIC_SIPNR_L,
57603                 .mask   = IPIC_SIMSR_L,
57604                 .prio   = IPIC_SMPRR_B,
57605                 .force  = IPIC_SIFCR_L,
57606 @@ -266,7 +371,6 @@ static struct ipic_info ipic_info[] = {
57607                 .prio_mask = 2,
57608         },
57609         [71] = {
57610 -               .pend   = IPIC_SIPNR_L,
57611                 .mask   = IPIC_SIMSR_L,
57612                 .prio   = IPIC_SMPRR_B,
57613                 .force  = IPIC_SIFCR_L,
57614 @@ -274,91 +378,120 @@ static struct ipic_info ipic_info[] = {
57615                 .prio_mask = 3,
57616         },
57617         [72] = {
57618 -               .pend   = IPIC_SIPNR_L,
57619                 .mask   = IPIC_SIMSR_L,
57620                 .prio   = 0,
57621                 .force  = IPIC_SIFCR_L,
57622                 .bit    = 8,
57623         },
57624         [73] = {
57625 -               .pend   = IPIC_SIPNR_L,
57626                 .mask   = IPIC_SIMSR_L,
57627                 .prio   = 0,
57628                 .force  = IPIC_SIFCR_L,
57629                 .bit    = 9,
57630         },
57631         [74] = {
57632 -               .pend   = IPIC_SIPNR_L,
57633                 .mask   = IPIC_SIMSR_L,
57634                 .prio   = 0,
57635                 .force  = IPIC_SIFCR_L,
57636                 .bit    = 10,
57637         },
57638         [75] = {
57639 -               .pend   = IPIC_SIPNR_L,
57640                 .mask   = IPIC_SIMSR_L,
57641                 .prio   = 0,
57642                 .force  = IPIC_SIFCR_L,
57643                 .bit    = 11,
57644         },
57645         [76] = {
57646 -               .pend   = IPIC_SIPNR_L,
57647                 .mask   = IPIC_SIMSR_L,
57648                 .prio   = 0,
57649                 .force  = IPIC_SIFCR_L,
57650                 .bit    = 12,
57651         },
57652         [77] = {
57653 -               .pend   = IPIC_SIPNR_L,
57654                 .mask   = IPIC_SIMSR_L,
57655                 .prio   = 0,
57656                 .force  = IPIC_SIFCR_L,
57657                 .bit    = 13,
57658         },
57659         [78] = {
57660 -               .pend   = IPIC_SIPNR_L,
57661                 .mask   = IPIC_SIMSR_L,
57662                 .prio   = 0,
57663                 .force  = IPIC_SIFCR_L,
57664                 .bit    = 14,
57665         },
57666         [79] = {
57667 -               .pend   = IPIC_SIPNR_L,
57668                 .mask   = IPIC_SIMSR_L,
57669                 .prio   = 0,
57670                 .force  = IPIC_SIFCR_L,
57671                 .bit    = 15,
57672         },
57673         [80] = {
57674 -               .pend   = IPIC_SIPNR_L,
57675                 .mask   = IPIC_SIMSR_L,
57676                 .prio   = 0,
57677                 .force  = IPIC_SIFCR_L,
57678                 .bit    = 16,
57679         },
57680 +       [81] = {
57681 +               .mask   = IPIC_SIMSR_L,
57682 +               .prio   = 0,
57683 +               .force  = IPIC_SIFCR_L,
57684 +               .bit    = 17,
57685 +       },
57686 +       [82] = {
57687 +               .mask   = IPIC_SIMSR_L,
57688 +               .prio   = 0,
57689 +               .force  = IPIC_SIFCR_L,
57690 +               .bit    = 18,
57691 +       },
57692 +       [83] = {
57693 +               .mask   = IPIC_SIMSR_L,
57694 +               .prio   = 0,
57695 +               .force  = IPIC_SIFCR_L,
57696 +               .bit    = 19,
57697 +       },
57698         [84] = {
57699 -               .pend   = IPIC_SIPNR_L,
57700                 .mask   = IPIC_SIMSR_L,
57701                 .prio   = 0,
57702                 .force  = IPIC_SIFCR_L,
57703                 .bit    = 20,
57704         },
57705         [85] = {
57706 -               .pend   = IPIC_SIPNR_L,
57707                 .mask   = IPIC_SIMSR_L,
57708                 .prio   = 0,
57709                 .force  = IPIC_SIFCR_L,
57710                 .bit    = 21,
57711         },
57712 +       [86] = {
57713 +               .mask   = IPIC_SIMSR_L,
57714 +               .prio   = 0,
57715 +               .force  = IPIC_SIFCR_L,
57716 +               .bit    = 22,
57717 +       },
57718 +       [87] = {
57719 +               .mask   = IPIC_SIMSR_L,
57720 +               .prio   = 0,
57721 +               .force  = IPIC_SIFCR_L,
57722 +               .bit    = 23,
57723 +       },
57724 +       [88] = {
57725 +               .mask   = IPIC_SIMSR_L,
57726 +               .prio   = 0,
57727 +               .force  = IPIC_SIFCR_L,
57728 +               .bit    = 24,
57729 +       },
57730 +       [89] = {
57731 +               .mask   = IPIC_SIMSR_L,
57732 +               .prio   = 0,
57733 +               .force  = IPIC_SIFCR_L,
57734 +               .bit    = 25,
57735 +       },
57736         [90] = {
57737 -               .pend   = IPIC_SIPNR_L,
57738                 .mask   = IPIC_SIMSR_L,
57739                 .prio   = 0,
57740                 .force  = IPIC_SIFCR_L,
57741                 .bit    = 26,
57742         },
57743         [91] = {
57744 -               .pend   = IPIC_SIPNR_L,
57745                 .mask   = IPIC_SIMSR_L,
57746                 .prio   = 0,
57747                 .force  = IPIC_SIFCR_L,
57748 @@ -412,6 +545,10 @@ static void ipic_mask_irq(unsigned int v
57749         temp &= ~(1 << (31 - ipic_info[src].bit));
57750         ipic_write(ipic->regs, ipic_info[src].mask, temp);
57751  
57752 +       /* mb() can't guarantee that masking is finished.  But it does finish
57753 +        * for nearly all cases. */
57754 +       mb();
57755 +
57756         spin_unlock_irqrestore(&ipic_lock, flags);
57757  }
57758  
57759 @@ -424,9 +561,13 @@ static void ipic_ack_irq(unsigned int vi
57760  
57761         spin_lock_irqsave(&ipic_lock, flags);
57762  
57763 -       temp = ipic_read(ipic->regs, ipic_info[src].pend);
57764 +       temp = ipic_read(ipic->regs, ipic_info[src].ack);
57765         temp |= (1 << (31 - ipic_info[src].bit));
57766 -       ipic_write(ipic->regs, ipic_info[src].pend, temp);
57767 +       ipic_write(ipic->regs, ipic_info[src].ack, temp);
57768 +
57769 +       /* mb() can't guarantee that ack is finished.  But it does finish
57770 +        * for nearly all cases. */
57771 +       mb();
57772  
57773         spin_unlock_irqrestore(&ipic_lock, flags);
57774  }
57775 @@ -444,9 +585,13 @@ static void ipic_mask_irq_and_ack(unsign
57776         temp &= ~(1 << (31 - ipic_info[src].bit));
57777         ipic_write(ipic->regs, ipic_info[src].mask, temp);
57778  
57779 -       temp = ipic_read(ipic->regs, ipic_info[src].pend);
57780 +       temp = ipic_read(ipic->regs, ipic_info[src].ack);
57781         temp |= (1 << (31 - ipic_info[src].bit));
57782 -       ipic_write(ipic->regs, ipic_info[src].pend, temp);
57783 +       ipic_write(ipic->regs, ipic_info[src].ack, temp);
57784 +
57785 +       /* mb() can't guarantee that ack is finished.  But it does finish
57786 +        * for nearly all cases. */
57787 +       mb();
57788  
57789         spin_unlock_irqrestore(&ipic_lock, flags);
57790  }
57791 @@ -468,14 +613,22 @@ static int ipic_set_irq_type(unsigned in
57792                         flow_type);
57793                 return -EINVAL;
57794         }
57795 +       /* ipic supports only edge mode on external interrupts */
57796 +       if ((flow_type & IRQ_TYPE_EDGE_FALLING) && !ipic_info[src].ack) {
57797 +               printk(KERN_ERR "ipic: edge sense not supported on internal "
57798 +                               "interrupts\n");
57799 +               return -EINVAL;
57800 +       }
57801  
57802         desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
57803         desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
57804         if (flow_type & IRQ_TYPE_LEVEL_LOW)  {
57805                 desc->status |= IRQ_LEVEL;
57806                 desc->handle_irq = handle_level_irq;
57807 +               desc->chip = &ipic_level_irq_chip;
57808         } else {
57809                 desc->handle_irq = handle_edge_irq;
57810 +               desc->chip = &ipic_edge_irq_chip;
57811         }
57812  
57813         /* only EXT IRQ senses are programmable on ipic
57814 @@ -500,7 +653,16 @@ static int ipic_set_irq_type(unsigned in
57815         return 0;
57816  }
57817  
57818 -static struct irq_chip ipic_irq_chip = {
57819 +/* level interrupts and edge interrupts have different ack operations */
57820 +static struct irq_chip ipic_level_irq_chip = {
57821 +       .typename       = " IPIC  ",
57822 +       .unmask         = ipic_unmask_irq,
57823 +       .mask           = ipic_mask_irq,
57824 +       .mask_ack       = ipic_mask_irq,
57825 +       .set_type       = ipic_set_irq_type,
57826 +};
57827 +
57828 +static struct irq_chip ipic_edge_irq_chip = {
57829         .typename       = " IPIC  ",
57830         .unmask         = ipic_unmask_irq,
57831         .mask           = ipic_mask_irq,
57832 @@ -519,13 +681,9 @@ static int ipic_host_map(struct irq_host
57833                          irq_hw_number_t hw)
57834  {
57835         struct ipic *ipic = h->host_data;
57836 -       struct irq_chip *chip;
57837 -
57838 -       /* Default chip */
57839 -       chip = &ipic->hc_irq;
57840  
57841         set_irq_chip_data(virq, ipic);
57842 -       set_irq_chip_and_handler(virq, chip, handle_level_irq);
57843 +       set_irq_chip_and_handler(virq, &ipic_level_irq_chip, handle_level_irq);
57844  
57845         /* Set default irq type */
57846         set_irq_type(virq, IRQ_TYPE_NONE);
57847 @@ -584,7 +742,6 @@ struct ipic * __init ipic_init(struct de
57848         ipic->regs = ioremap(res.start, res.end - res.start + 1);
57849  
57850         ipic->irqhost->host_data = ipic;
57851 -       ipic->hc_irq = ipic_irq_chip;
57852  
57853         /* init hw */
57854         ipic_write(ipic->regs, IPIC_SICNR, 0x0);
57855 @@ -593,6 +750,10 @@ struct ipic * __init ipic_init(struct de
57856          * configure SICFR accordingly */
57857         if (flags & IPIC_SPREADMODE_GRP_A)
57858                 temp |= SICFR_IPSA;
57859 +       if (flags & IPIC_SPREADMODE_GRP_B)
57860 +               temp |= SICFR_IPSB;
57861 +       if (flags & IPIC_SPREADMODE_GRP_C)
57862 +               temp |= SICFR_IPSC;
57863         if (flags & IPIC_SPREADMODE_GRP_D)
57864                 temp |= SICFR_IPSD;
57865         if (flags & IPIC_SPREADMODE_MIX_A)
57866 @@ -600,7 +761,7 @@ struct ipic * __init ipic_init(struct de
57867         if (flags & IPIC_SPREADMODE_MIX_B)
57868                 temp |= SICFR_MPSB;
57869  
57870 -       ipic_write(ipic->regs, IPIC_SICNR, temp);
57871 +       ipic_write(ipic->regs, IPIC_SICFR, temp);
57872  
57873         /* handle MCP route */
57874         temp = 0;
57875 @@ -672,10 +833,12 @@ void ipic_set_highest_priority(unsigned 
57876  
57877  void ipic_set_default_priority(void)
57878  {
57879 -       ipic_write(primary_ipic->regs, IPIC_SIPRR_A, IPIC_SIPRR_A_DEFAULT);
57880 -       ipic_write(primary_ipic->regs, IPIC_SIPRR_D, IPIC_SIPRR_D_DEFAULT);
57881 -       ipic_write(primary_ipic->regs, IPIC_SMPRR_A, IPIC_SMPRR_A_DEFAULT);
57882 -       ipic_write(primary_ipic->regs, IPIC_SMPRR_B, IPIC_SMPRR_B_DEFAULT);
57883 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_A, IPIC_PRIORITY_DEFAULT);
57884 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_B, IPIC_PRIORITY_DEFAULT);
57885 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_C, IPIC_PRIORITY_DEFAULT);
57886 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_D, IPIC_PRIORITY_DEFAULT);
57887 +       ipic_write(primary_ipic->regs, IPIC_SMPRR_A, IPIC_PRIORITY_DEFAULT);
57888 +       ipic_write(primary_ipic->regs, IPIC_SMPRR_B, IPIC_PRIORITY_DEFAULT);
57889  }
57890  
57891  void ipic_enable_mcp(enum ipic_mcp_irq mcp_irq)
57892 Index: linux-2.6.24.7/arch/powerpc/sysdev/ipic.h
57893 ===================================================================
57894 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/ipic.h
57895 +++ linux-2.6.24.7/arch/powerpc/sysdev/ipic.h
57896 @@ -23,13 +23,12 @@
57897  #define IPIC_IRQ_EXT7 23
57898  
57899  /* Default Priority Registers */
57900 -#define IPIC_SIPRR_A_DEFAULT 0x05309770
57901 -#define IPIC_SIPRR_D_DEFAULT 0x05309770
57902 -#define IPIC_SMPRR_A_DEFAULT 0x05309770
57903 -#define IPIC_SMPRR_B_DEFAULT 0x05309770
57904 +#define IPIC_PRIORITY_DEFAULT 0x05309770
57905  
57906  /* System Global Interrupt Configuration Register */
57907  #define        SICFR_IPSA      0x00010000
57908 +#define        SICFR_IPSB      0x00020000
57909 +#define        SICFR_IPSC      0x00040000
57910  #define        SICFR_IPSD      0x00080000
57911  #define        SICFR_MPSA      0x00200000
57912  #define        SICFR_MPSB      0x00400000
57913 @@ -45,13 +44,11 @@ struct ipic {
57914  
57915         /* The remapper for this IPIC */
57916         struct irq_host         *irqhost;
57917 -
57918 -       /* The "linux" controller struct */
57919 -       struct irq_chip         hc_irq;
57920  };
57921  
57922  struct ipic_info {
57923 -       u8      pend;           /* pending register offset from base */
57924 +       u8      ack;            /* pending register offset from base if the irq
57925 +                                  supports ack operation */
57926         u8      mask;           /* mask register offset from base */
57927         u8      prio;           /* priority register offset from base */
57928         u8      force;          /* force register offset from base */
57929 Index: linux-2.6.24.7/arch/powerpc/sysdev/mmio_nvram.c
57930 ===================================================================
57931 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/mmio_nvram.c
57932 +++ linux-2.6.24.7/arch/powerpc/sysdev/mmio_nvram.c
57933 @@ -99,7 +99,7 @@ int __init mmio_nvram_init(void)
57934         nvram_addr = r.start;
57935         mmio_nvram_len = r.end - r.start + 1;
57936         if ( (!mmio_nvram_len) || (!nvram_addr) ) {
57937 -               printk(KERN_WARNING "nvram: address or lenght is 0\n");
57938 +               printk(KERN_WARNING "nvram: address or length is 0\n");
57939                 ret = -EIO;
57940                 goto out;
57941         }
57942 Index: linux-2.6.24.7/arch/powerpc/sysdev/mpic.c
57943 ===================================================================
57944 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/mpic.c
57945 +++ linux-2.6.24.7/arch/powerpc/sysdev/mpic.c
57946 @@ -83,6 +83,7 @@ static u32 mpic_infos[][MPIC_IDX_END] = 
57947                 MPIC_CPU_WHOAMI,
57948                 MPIC_CPU_INTACK,
57949                 MPIC_CPU_EOI,
57950 +               MPIC_CPU_MCACK,
57951  
57952                 MPIC_IRQ_BASE,
57953                 MPIC_IRQ_STRIDE,
57954 @@ -121,6 +122,7 @@ static u32 mpic_infos[][MPIC_IDX_END] = 
57955                 TSI108_CPU_WHOAMI,
57956                 TSI108_CPU_INTACK,
57957                 TSI108_CPU_EOI,
57958 +               TSI108_CPU_MCACK,
57959  
57960                 TSI108_IRQ_BASE,
57961                 TSI108_IRQ_STRIDE,
57962 @@ -265,7 +267,7 @@ static inline void _mpic_irq_write(struc
57963   */
57964  
57965  
57966 -static void _mpic_map_mmio(struct mpic *mpic, unsigned long phys_addr,
57967 +static void _mpic_map_mmio(struct mpic *mpic, phys_addr_t phys_addr,
57968                            struct mpic_reg_bank *rb, unsigned int offset,
57969                            unsigned int size)
57970  {
57971 @@ -285,7 +287,7 @@ static void _mpic_map_dcr(struct mpic *m
57972         BUG_ON(!DCR_MAP_OK(rb->dhost));
57973  }
57974  
57975 -static inline void mpic_map(struct mpic *mpic, unsigned long phys_addr,
57976 +static inline void mpic_map(struct mpic *mpic, phys_addr_t phys_addr,
57977                             struct mpic_reg_bank *rb, unsigned int offset,
57978                             unsigned int size)
57979  {
57980 @@ -612,12 +614,11 @@ static inline void mpic_eoi(struct mpic 
57981  }
57982  
57983  #ifdef CONFIG_SMP
57984 -static irqreturn_t mpic_ipi_action(int irq, void *dev_id)
57985 +static irqreturn_t mpic_ipi_action(int irq, void *data)
57986  {
57987 -       struct mpic *mpic;
57988 +       long ipi = (long)data;
57989  
57990 -       mpic = mpic_find(irq, NULL);
57991 -       smp_message_recv(mpic_irq_to_hw(irq) - mpic->ipi_vecs[0]);
57992 +       smp_message_recv(ipi);
57993  
57994         return IRQ_HANDLED;
57995  }
57996 @@ -842,6 +843,24 @@ int mpic_set_irq_type(unsigned int virq,
57997         return 0;
57998  }
57999  
58000 +void mpic_set_vector(unsigned int virq, unsigned int vector)
58001 +{
58002 +       struct mpic *mpic = mpic_from_irq(virq);
58003 +       unsigned int src = mpic_irq_to_hw(virq);
58004 +       unsigned int vecpri;
58005 +
58006 +       DBG("mpic: set_vector(mpic:@%p,virq:%d,src:%d,vector:0x%x)\n",
58007 +           mpic, virq, src, vector);
58008 +
58009 +       if (src >= mpic->irq_count)
58010 +               return;
58011 +
58012 +       vecpri = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI));
58013 +       vecpri = vecpri & ~MPIC_INFO(VECPRI_VECTOR_MASK);
58014 +       vecpri |= vector;
58015 +       mpic_irq_write(src, MPIC_INFO(IRQ_VECTOR_PRI), vecpri);
58016 +}
58017 +
58018  static struct irq_chip mpic_irq_chip = {
58019         .mask           = mpic_mask_irq,
58020         .unmask         = mpic_unmask_irq,
58021 @@ -1109,6 +1128,11 @@ struct mpic * __init mpic_alloc(struct d
58022                         mb();
58023         }
58024  
58025 +       if (flags & MPIC_ENABLE_MCK)
58026 +               mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0),
58027 +                          mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
58028 +                          | MPIC_GREG_GCONF_MCK);
58029 +
58030         /* Read feature register, calculate num CPUs and, for non-ISU
58031          * MPICs, num sources as well. On ISU MPICs, sources are counted
58032          * as ISUs are added
58033 @@ -1230,6 +1254,8 @@ void __init mpic_init(struct mpic *mpic)
58034                 mpic_u3msi_init(mpic);
58035         }
58036  
58037 +       mpic_pasemi_msi_init(mpic);
58038 +
58039         for (i = 0; i < mpic->num_sources; i++) {
58040                 /* start with vector = source number, and masked */
58041                 u32 vecpri = MPIC_VECPRI_MASK | i |
58042 @@ -1253,6 +1279,11 @@ void __init mpic_init(struct mpic *mpic)
58043                            mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
58044                            | MPIC_GREG_GCONF_8259_PTHROU_DIS);
58045  
58046 +       if (mpic->flags & MPIC_NO_BIAS)
58047 +               mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0),
58048 +                       mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
58049 +                       | MPIC_GREG_GCONF_NO_BIAS);
58050 +
58051         /* Set current processor priority to 0 */
58052         mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0);
58053  
58054 @@ -1419,13 +1450,13 @@ void mpic_send_ipi(unsigned int ipi_no, 
58055                        mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0]));
58056  }
58057  
58058 -unsigned int mpic_get_one_irq(struct mpic *mpic)
58059 +static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
58060  {
58061         u32 src;
58062  
58063 -       src = mpic_cpu_read(MPIC_INFO(CPU_INTACK)) & MPIC_INFO(VECPRI_VECTOR_MASK);
58064 +       src = mpic_cpu_read(reg) & MPIC_INFO(VECPRI_VECTOR_MASK);
58065  #ifdef DEBUG_LOW
58066 -       DBG("%s: get_one_irq(): %d\n", mpic->name, src);
58067 +       DBG("%s: get_one_irq(reg 0x%x): %d\n", mpic->name, reg, src);
58068  #endif
58069         if (unlikely(src == mpic->spurious_vec)) {
58070                 if (mpic->flags & MPIC_SPV_EOI)
58071 @@ -1443,6 +1474,11 @@ unsigned int mpic_get_one_irq(struct mpi
58072         return irq_linear_revmap(mpic->irqhost, src);
58073  }
58074  
58075 +unsigned int mpic_get_one_irq(struct mpic *mpic)
58076 +{
58077 +       return _mpic_get_one_irq(mpic, MPIC_INFO(CPU_INTACK));
58078 +}
58079 +
58080  unsigned int mpic_get_irq(void)
58081  {
58082         struct mpic *mpic = mpic_primary;
58083 @@ -1452,12 +1488,20 @@ unsigned int mpic_get_irq(void)
58084         return mpic_get_one_irq(mpic);
58085  }
58086  
58087 +unsigned int mpic_get_mcirq(void)
58088 +{
58089 +       struct mpic *mpic = mpic_primary;
58090 +
58091 +       BUG_ON(mpic == NULL);
58092 +
58093 +       return _mpic_get_one_irq(mpic, MPIC_INFO(CPU_MCACK));
58094 +}
58095  
58096  #ifdef CONFIG_SMP
58097  void mpic_request_ipis(void)
58098  {
58099         struct mpic *mpic = mpic_primary;
58100 -       int i, err;
58101 +       long i, err;
58102         static char *ipi_names[] = {
58103                 "IPI0 (call function)",
58104                 "IPI1 (reschedule)",
58105 @@ -1472,14 +1516,14 @@ void mpic_request_ipis(void)
58106                 unsigned int vipi = irq_create_mapping(mpic->irqhost,
58107                                                        mpic->ipi_vecs[0] + i);
58108                 if (vipi == NO_IRQ) {
58109 -                       printk(KERN_ERR "Failed to map IPI %d\n", i);
58110 +                       printk(KERN_ERR "Failed to map IPI %ld\n", i);
58111                         break;
58112                 }
58113                 err = request_irq(vipi, mpic_ipi_action,
58114                                   IRQF_DISABLED|IRQF_PERCPU,
58115 -                                 ipi_names[i], mpic);
58116 +                                 ipi_names[i], (void *)i);
58117                 if (err) {
58118 -                       printk(KERN_ERR "Request of irq %d for IPI %d failed\n",
58119 +                       printk(KERN_ERR "Request of irq %d for IPI %ld failed\n",
58120                                vipi, i);
58121                         break;
58122                 }
58123 Index: linux-2.6.24.7/arch/powerpc/sysdev/mpic.h
58124 ===================================================================
58125 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/mpic.h
58126 +++ linux-2.6.24.7/arch/powerpc/sysdev/mpic.h
58127 @@ -17,6 +17,7 @@ extern int mpic_msi_init_allocator(struc
58128  extern irq_hw_number_t mpic_msi_alloc_hwirqs(struct mpic *mpic, int num);
58129  extern void mpic_msi_free_hwirqs(struct mpic *mpic, int offset, int num);
58130  extern int mpic_u3msi_init(struct mpic *mpic);
58131 +extern int mpic_pasemi_msi_init(struct mpic *mpic);
58132  #else
58133  static inline void mpic_msi_reserve_hwirq(struct mpic *mpic,
58134                                           irq_hw_number_t hwirq)
58135 @@ -28,12 +29,15 @@ static inline int mpic_u3msi_init(struct
58136  {
58137         return -1;
58138  }
58139 +
58140 +static inline int mpic_pasemi_msi_init(struct mpic *mpic)
58141 +{
58142 +       return -1;
58143 +}
58144  #endif
58145  
58146  extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type);
58147 -extern void mpic_end_irq(unsigned int irq);
58148 -extern void mpic_mask_irq(unsigned int irq);
58149 -extern void mpic_unmask_irq(unsigned int irq);
58150 +extern void mpic_set_vector(unsigned int virq, unsigned int vector);
58151  extern void mpic_set_affinity(unsigned int irq, cpumask_t cpumask);
58152  
58153  #endif /* _POWERPC_SYSDEV_MPIC_H */
58154 Index: linux-2.6.24.7/arch/powerpc/sysdev/mpic_pasemi_msi.c
58155 ===================================================================
58156 --- /dev/null
58157 +++ linux-2.6.24.7/arch/powerpc/sysdev/mpic_pasemi_msi.c
58158 @@ -0,0 +1,172 @@
58159 +/*
58160 + * Copyright 2007, Olof Johansson, PA Semi
58161 + *
58162 + * Based on arch/powerpc/sysdev/mpic_u3msi.c:
58163 + *
58164 + * Copyright 2006, Segher Boessenkool, IBM Corporation.
58165 + * Copyright 2006-2007, Michael Ellerman, IBM Corporation.
58166 + *
58167 + * This program is free software; you can redistribute it and/or
58168 + * modify it under the terms of the GNU General Public License
58169 + * as published by the Free Software Foundation; version 2 of the
58170 + * License.
58171 + *
58172 + */
58173 +
58174 +#undef DEBUG
58175 +
58176 +#include <linux/irq.h>
58177 +#include <linux/bootmem.h>
58178 +#include <linux/msi.h>
58179 +#include <asm/mpic.h>
58180 +#include <asm/prom.h>
58181 +#include <asm/hw_irq.h>
58182 +#include <asm/ppc-pci.h>
58183 +
58184 +#include "mpic.h"
58185 +
58186 +/* Allocate 16 interrupts per device, to give an alignment of 16,
58187 + * since that's the size of the grouping w.r.t. affinity. If someone
58188 + * needs more than 32 MSI's down the road we'll have to rethink this,
58189 + * but it should be OK for now.
58190 + */
58191 +#define ALLOC_CHUNK 16
58192 +
58193 +#define PASEMI_MSI_ADDR 0xfc080000
58194 +
58195 +/* A bit ugly, can we get this from the pci_dev somehow? */
58196 +static struct mpic *msi_mpic;
58197 +
58198 +
58199 +static void mpic_pasemi_msi_mask_irq(unsigned int irq)
58200 +{
58201 +       pr_debug("mpic_pasemi_msi_mask_irq %d\n", irq);
58202 +       mask_msi_irq(irq);
58203 +       mpic_mask_irq(irq);
58204 +}
58205 +
58206 +static void mpic_pasemi_msi_unmask_irq(unsigned int irq)
58207 +{
58208 +       pr_debug("mpic_pasemi_msi_unmask_irq %d\n", irq);
58209 +       mpic_unmask_irq(irq);
58210 +       unmask_msi_irq(irq);
58211 +}
58212 +
58213 +static struct irq_chip mpic_pasemi_msi_chip = {
58214 +       .shutdown       = mpic_pasemi_msi_mask_irq,
58215 +       .mask           = mpic_pasemi_msi_mask_irq,
58216 +       .unmask         = mpic_pasemi_msi_unmask_irq,
58217 +       .eoi            = mpic_end_irq,
58218 +       .set_type       = mpic_set_irq_type,
58219 +       .set_affinity   = mpic_set_affinity,
58220 +       .typename       = "PASEMI-MSI ",
58221 +};
58222 +
58223 +static int pasemi_msi_check_device(struct pci_dev *pdev, int nvec, int type)
58224 +{
58225 +       if (type == PCI_CAP_ID_MSIX)
58226 +               pr_debug("pasemi_msi: MSI-X untested, trying anyway\n");
58227 +
58228 +       return 0;
58229 +}
58230 +
58231 +static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
58232 +{
58233 +       struct msi_desc *entry;
58234 +
58235 +       pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev);
58236 +
58237 +       list_for_each_entry(entry, &pdev->msi_list, list) {
58238 +               if (entry->irq == NO_IRQ)
58239 +                       continue;
58240 +
58241 +               set_irq_msi(entry->irq, NULL);
58242 +               mpic_msi_free_hwirqs(msi_mpic, virq_to_hw(entry->irq),
58243 +                                    ALLOC_CHUNK);
58244 +               irq_dispose_mapping(entry->irq);
58245 +       }
58246 +
58247 +       return;
58248 +}
58249 +
58250 +static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
58251 +{
58252 +       irq_hw_number_t hwirq;
58253 +       unsigned int virq;
58254 +       struct msi_desc *entry;
58255 +       struct msi_msg msg;
58256 +       u64 addr;
58257 +
58258 +       pr_debug("pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n",
58259 +                pdev, nvec, type);
58260 +
58261 +       msg.address_hi = 0;
58262 +       msg.address_lo = PASEMI_MSI_ADDR;
58263 +
58264 +       list_for_each_entry(entry, &pdev->msi_list, list) {
58265 +               /* Allocate 16 interrupts for now, since that's the grouping for
58266 +                * affinity. This can be changed later if it turns out 32 is too
58267 +                * few MSIs for someone, but restrictions will apply to how the
58268 +                * sources can be changed independently.
58269 +                */
58270 +               hwirq = mpic_msi_alloc_hwirqs(msi_mpic, ALLOC_CHUNK);
58271 +               if (hwirq < 0) {
58272 +                       pr_debug("pasemi_msi: failed allocating hwirq\n");
58273 +                       return hwirq;
58274 +               }
58275 +
58276 +               virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
58277 +               if (virq == NO_IRQ) {
58278 +                       pr_debug("pasemi_msi: failed mapping hwirq 0x%lx\n", hwirq);
58279 +                       mpic_msi_free_hwirqs(msi_mpic, hwirq, ALLOC_CHUNK);
58280 +                       return -ENOSPC;
58281 +               }
58282 +
58283 +               /* Vector on MSI is really an offset, the hardware adds
58284 +                * it to the value written at the magic address. So set
58285 +                * it to 0 to remain sane.
58286 +                */
58287 +               mpic_set_vector(virq, 0);
58288 +
58289 +               set_irq_msi(virq, entry);
58290 +               set_irq_chip(virq, &mpic_pasemi_msi_chip);
58291 +               set_irq_type(virq, IRQ_TYPE_EDGE_RISING);
58292 +
58293 +               pr_debug("pasemi_msi: allocated virq 0x%x (hw 0x%lx) addr 0x%lx\n",
58294 +                         virq, hwirq, addr);
58295 +
58296 +               /* Likewise, the device writes [0...511] into the target
58297 +                * register to generate MSI [512...1023]
58298 +                */
58299 +               msg.data = hwirq-0x200;
58300 +               write_msi_msg(virq, &msg);
58301 +       }
58302 +
58303 +       return 0;
58304 +}
58305 +
58306 +int mpic_pasemi_msi_init(struct mpic *mpic)
58307 +{
58308 +       int rc;
58309 +
58310 +       if (!mpic->irqhost->of_node ||
58311 +           !of_device_is_compatible(mpic->irqhost->of_node,
58312 +                                    "pasemi,pwrficient-openpic"))
58313 +               return -ENODEV;
58314 +
58315 +       rc = mpic_msi_init_allocator(mpic);
58316 +       if (rc) {
58317 +               pr_debug("pasemi_msi: Error allocating bitmap!\n");
58318 +               return rc;
58319 +       }
58320 +
58321 +       pr_debug("pasemi_msi: Registering PA Semi MPIC MSI callbacks\n");
58322 +
58323 +       msi_mpic = mpic;
58324 +       WARN_ON(ppc_md.setup_msi_irqs);
58325 +       ppc_md.setup_msi_irqs = pasemi_msi_setup_msi_irqs;
58326 +       ppc_md.teardown_msi_irqs = pasemi_msi_teardown_msi_irqs;
58327 +       ppc_md.msi_check_device = pasemi_msi_check_device;
58328 +
58329 +       return 0;
58330 +}
58331 Index: linux-2.6.24.7/arch/powerpc/sysdev/mv64x60_dev.c
58332 ===================================================================
58333 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/mv64x60_dev.c
58334 +++ linux-2.6.24.7/arch/powerpc/sysdev/mv64x60_dev.c
58335 @@ -241,7 +241,7 @@ static int __init mv64x60_eth_device_set
58336  
58337         /* only register the shared platform device the first time through */
58338         if (id == 0 && (err = eth_register_shared_pdev(np)))
58339 -               return err;;
58340 +               return err;
58341  
58342         memset(r, 0, sizeof(r));
58343         of_irq_to_resource(np, 0, &r[0]);
58344 @@ -451,22 +451,19 @@ static int __init mv64x60_device_setup(v
58345         int id;
58346         int err;
58347  
58348 -       for (id = 0;
58349 -            (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); id++)
58350 -               if ((err = mv64x60_mpsc_device_setup(np, id)))
58351 +       id = 0;
58352 +       for_each_compatible_node(np, "serial", "marvell,mpsc")
58353 +               if ((err = mv64x60_mpsc_device_setup(np, id++)))
58354                         goto error;
58355  
58356 -       for (id = 0;
58357 -            (np = of_find_compatible_node(np, "network",
58358 -                                          "marvell,mv64x60-eth"));
58359 -            id++)
58360 -               if ((err = mv64x60_eth_device_setup(np, id)))
58361 +       id = 0;
58362 +       for_each_compatible_node(np, "network", "marvell,mv64x60-eth")
58363 +               if ((err = mv64x60_eth_device_setup(np, id++)))
58364                         goto error;
58365  
58366 -       for (id = 0;
58367 -            (np = of_find_compatible_node(np, "i2c", "marvell,mv64x60-i2c"));
58368 -            id++)
58369 -               if ((err = mv64x60_i2c_device_setup(np, id)))
58370 +       id = 0;
58371 +       for_each_compatible_node(np, "i2c", "marvell,mv64x60-i2c")
58372 +               if ((err = mv64x60_i2c_device_setup(np, id++)))
58373                         goto error;
58374  
58375         /* support up to one watchdog timer */
58376 @@ -477,7 +474,6 @@ static int __init mv64x60_device_setup(v
58377                 of_node_put(np);
58378         }
58379  
58380 -
58381         return 0;
58382  
58383  error:
58384 Index: linux-2.6.24.7/arch/powerpc/sysdev/mv64x60_pci.c
58385 ===================================================================
58386 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/mv64x60_pci.c
58387 +++ linux-2.6.24.7/arch/powerpc/sysdev/mv64x60_pci.c
58388 @@ -164,8 +164,8 @@ static int __init mv64x60_add_bridge(str
58389  
58390  void __init mv64x60_pci_init(void)
58391  {
58392 -       struct device_node *np = NULL;
58393 +       struct device_node *np;
58394  
58395 -       while ((np = of_find_compatible_node(np, "pci", "marvell,mv64x60-pci")))
58396 +       for_each_compatible_node(np, "pci", "marvell,mv64x60-pci")
58397                 mv64x60_add_bridge(np);
58398  }
58399 Index: linux-2.6.24.7/arch/powerpc/sysdev/mv64x60_udbg.c
58400 ===================================================================
58401 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/mv64x60_udbg.c
58402 +++ linux-2.6.24.7/arch/powerpc/sysdev/mv64x60_udbg.c
58403 @@ -85,10 +85,10 @@ static void mv64x60_udbg_init(void)
58404         if (!stdout)
58405                 return;
58406  
58407 -       for (np = NULL;
58408 -            (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); )
58409 +       for_each_compatible_node(np, "serial", "marvell,mpsc") {
58410                 if (np == stdout)
58411                         break;
58412 +       }
58413  
58414         of_node_put(stdout);
58415         if (!np)
58416 Index: linux-2.6.24.7/arch/powerpc/sysdev/of_rtc.c
58417 ===================================================================
58418 --- /dev/null
58419 +++ linux-2.6.24.7/arch/powerpc/sysdev/of_rtc.c
58420 @@ -0,0 +1,59 @@
58421 +/*
58422 + * Instantiate mmio-mapped RTC chips based on device tree information
58423 + *
58424 + * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
58425 + *
58426 + * This program is free software; you can redistribute  it and/or modify it
58427 + * under  the terms of  the GNU General  Public License as published by the
58428 + * Free Software Foundation;  either version 2 of the  License, or (at your
58429 + * option) any later version.
58430 + */
58431 +#include <linux/kernel.h>
58432 +#include <linux/of.h>
58433 +#include <linux/init.h>
58434 +#include <linux/of_platform.h>
58435 +
58436 +static __initdata struct {
58437 +       const char *compatible;
58438 +       char *plat_name;
58439 +} of_rtc_table[] = {
58440 +       { "ds1743-nvram", "rtc-ds1742" },
58441 +};
58442 +
58443 +void __init of_instantiate_rtc(void)
58444 +{
58445 +       struct device_node *node;
58446 +       int err;
58447 +       int i;
58448 +
58449 +       for (i = 0; i < ARRAY_SIZE(of_rtc_table); i++) {
58450 +               char *plat_name = of_rtc_table[i].plat_name;
58451 +
58452 +               for_each_compatible_node(node, NULL,
58453 +                                        of_rtc_table[i].compatible) {
58454 +                       struct resource *res;
58455 +
58456 +                       res = kmalloc(sizeof(*res), GFP_KERNEL);
58457 +                       if (!res) {
58458 +                               printk(KERN_ERR "OF RTC: Out of memory "
58459 +                                      "allocating resource structure for %s\n",
58460 +                                      node->full_name);
58461 +                               continue;
58462 +                       }
58463 +
58464 +                       err = of_address_to_resource(node, 0, res);
58465 +                       if (err) {
58466 +                               printk(KERN_ERR "OF RTC: Error "
58467 +                                      "translating resources for %s\n",
58468 +                                      node->full_name);
58469 +                               continue;
58470 +                       }
58471 +
58472 +                       printk(KERN_INFO "OF_RTC: %s is a %s @ 0x%llx-0x%llx\n",
58473 +                              node->full_name, plat_name,
58474 +                              (unsigned long long)res->start,
58475 +                              (unsigned long long)res->end);
58476 +                       platform_device_register_simple(plat_name, -1, res, 1);
58477 +               }
58478 +       }
58479 +}
58480 Index: linux-2.6.24.7/arch/powerpc/sysdev/pmi.c
58481 ===================================================================
58482 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/pmi.c
58483 +++ linux-2.6.24.7/arch/powerpc/sysdev/pmi.c
58484 @@ -28,9 +28,9 @@
58485  #include <linux/completion.h>
58486  #include <linux/spinlock.h>
58487  #include <linux/workqueue.h>
58488 +#include <linux/of_device.h>
58489 +#include <linux/of_platform.h>
58490  
58491 -#include <asm/of_device.h>
58492 -#include <asm/of_platform.h>
58493  #include <asm/io.h>
58494  #include <asm/pmi.h>
58495  #include <asm/prom.h>
58496 Index: linux-2.6.24.7/arch/powerpc/sysdev/ppc4xx_pci.c
58497 ===================================================================
58498 --- /dev/null
58499 +++ linux-2.6.24.7/arch/powerpc/sysdev/ppc4xx_pci.c
58500 @@ -0,0 +1,1528 @@
58501 +/*
58502 + * PCI / PCI-X / PCI-Express support for 4xx parts
58503 + *
58504 + * Copyright 2007 Ben. Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
58505 + *
58506 + * Most PCI Express code is coming from Stefan Roese implementation for
58507 + * arch/ppc in the Denx tree, slightly reworked by me.
58508 + *
58509 + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
58510 + *
58511 + * Some of that comes itself from a previous implementation for 440SPE only
58512 + * by Roland Dreier:
58513 + *
58514 + * Copyright (c) 2005 Cisco Systems.  All rights reserved.
58515 + * Roland Dreier <rolandd@cisco.com>
58516 + *
58517 + */
58518 +
58519 +#undef DEBUG
58520 +
58521 +#include <linux/kernel.h>
58522 +#include <linux/pci.h>
58523 +#include <linux/init.h>
58524 +#include <linux/of.h>
58525 +#include <linux/bootmem.h>
58526 +#include <linux/delay.h>
58527 +
58528 +#include <asm/io.h>
58529 +#include <asm/pci-bridge.h>
58530 +#include <asm/machdep.h>
58531 +#include <asm/dcr.h>
58532 +#include <asm/dcr-regs.h>
58533 +
58534 +#include "ppc4xx_pci.h"
58535 +
58536 +static int dma_offset_set;
58537 +
58538 +/* Move that to a useable header */
58539 +extern unsigned long total_memory;
58540 +
58541 +#define U64_TO_U32_LOW(val)    ((u32)((val) & 0x00000000ffffffffULL))
58542 +#define U64_TO_U32_HIGH(val)   ((u32)((val) >> 32))
58543 +
58544 +#ifdef CONFIG_RESOURCES_64BIT
58545 +#define RES_TO_U32_LOW(val)    U64_TO_U32_LOW(val)
58546 +#define RES_TO_U32_HIGH(val)   U64_TO_U32_HIGH(val)
58547 +#else
58548 +#define RES_TO_U32_LOW(val)    (val)
58549 +#define RES_TO_U32_HIGH(val)   (0)
58550 +#endif
58551 +
58552 +static inline int ppc440spe_revA(void)
58553 +{
58554 +       /* Catch both 440SPe variants, with and without RAID6 support */
58555 +        if ((mfspr(SPRN_PVR) & 0xffefffff) == 0x53421890)
58556 +                return 1;
58557 +        else
58558 +                return 0;
58559 +}
58560 +
58561 +static void fixup_ppc4xx_pci_bridge(struct pci_dev *dev)
58562 +{
58563 +       struct pci_controller *hose;
58564 +       int i;
58565 +
58566 +       if (dev->devfn != 0 || dev->bus->self != NULL)
58567 +               return;
58568 +
58569 +       hose = pci_bus_to_host(dev->bus);
58570 +       if (hose == NULL)
58571 +               return;
58572 +
58573 +       if (!of_device_is_compatible(hose->dn, "ibm,plb-pciex") &&
58574 +           !of_device_is_compatible(hose->dn, "ibm,plb-pcix") &&
58575 +           !of_device_is_compatible(hose->dn, "ibm,plb-pci"))
58576 +               return;
58577 +
58578 +       /* Hide the PCI host BARs from the kernel as their content doesn't
58579 +        * fit well in the resource management
58580 +        */
58581 +       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
58582 +               dev->resource[i].start = dev->resource[i].end = 0;
58583 +               dev->resource[i].flags = 0;
58584 +       }
58585 +
58586 +       printk(KERN_INFO "PCI: Hiding 4xx host bridge resources %s\n",
58587 +              pci_name(dev));
58588 +}
58589 +DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, fixup_ppc4xx_pci_bridge);
58590 +
58591 +static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
58592 +                                         void __iomem *reg,
58593 +                                         struct resource *res)
58594 +{
58595 +       u64 size;
58596 +       const u32 *ranges;
58597 +       int rlen;
58598 +       int pna = of_n_addr_cells(hose->dn);
58599 +       int np = pna + 5;
58600 +
58601 +       /* Default */
58602 +       res->start = 0;
58603 +       res->end = size = 0x80000000;
58604 +       res->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
58605 +
58606 +       /* Get dma-ranges property */
58607 +       ranges = of_get_property(hose->dn, "dma-ranges", &rlen);
58608 +       if (ranges == NULL)
58609 +               goto out;
58610 +
58611 +       /* Walk it */
58612 +       while ((rlen -= np * 4) >= 0) {
58613 +               u32 pci_space = ranges[0];
58614 +               u64 pci_addr = of_read_number(ranges + 1, 2);
58615 +               u64 cpu_addr = of_translate_dma_address(hose->dn, ranges + 3);
58616 +               size = of_read_number(ranges + pna + 3, 2);
58617 +               ranges += np;
58618 +               if (cpu_addr == OF_BAD_ADDR || size == 0)
58619 +                       continue;
58620 +
58621 +               /* We only care about memory */
58622 +               if ((pci_space & 0x03000000) != 0x02000000)
58623 +                       continue;
58624 +
58625 +               /* We currently only support memory at 0, and pci_addr
58626 +                * within 32 bits space
58627 +                */
58628 +               if (cpu_addr != 0 || pci_addr > 0xffffffff) {
58629 +                       printk(KERN_WARNING "%s: Ignored unsupported dma range"
58630 +                              " 0x%016llx...0x%016llx -> 0x%016llx\n",
58631 +                              hose->dn->full_name,
58632 +                              pci_addr, pci_addr + size - 1, cpu_addr);
58633 +                       continue;
58634 +               }
58635 +
58636 +               /* Check if not prefetchable */
58637 +               if (!(pci_space & 0x40000000))
58638 +                       res->flags &= ~IORESOURCE_PREFETCH;
58639 +
58640 +
58641 +               /* Use that */
58642 +               res->start = pci_addr;
58643 +#ifndef CONFIG_RESOURCES_64BIT
58644 +               /* Beware of 32 bits resources */
58645 +               if ((pci_addr + size) > 0x100000000ull)
58646 +                       res->end = 0xffffffff;
58647 +               else
58648 +#endif
58649 +                       res->end = res->start + size - 1;
58650 +               break;
58651 +       }
58652 +
58653 +       /* We only support one global DMA offset */
58654 +       if (dma_offset_set && pci_dram_offset != res->start) {
58655 +               printk(KERN_ERR "%s: dma-ranges(s) mismatch\n",
58656 +                      hose->dn->full_name);
58657 +               return -ENXIO;
58658 +       }
58659 +
58660 +       /* Check that we can fit all of memory as we don't support
58661 +        * DMA bounce buffers
58662 +        */
58663 +       if (size < total_memory) {
58664 +               printk(KERN_ERR "%s: dma-ranges too small "
58665 +                      "(size=%llx total_memory=%lx)\n",
58666 +                      hose->dn->full_name, size, total_memory);
58667 +               return -ENXIO;
58668 +       }
58669 +
58670 +       /* Check we are a power of 2 size and that base is a multiple of size*/
58671 +       if (!is_power_of_2(size) ||
58672 +           (res->start & (size - 1)) != 0) {
58673 +               printk(KERN_ERR "%s: dma-ranges unaligned\n",
58674 +                      hose->dn->full_name);
58675 +               return -ENXIO;
58676 +       }
58677 +
58678 +       /* Check that we are fully contained within 32 bits space */
58679 +       if (res->end > 0xffffffff) {
58680 +               printk(KERN_ERR "%s: dma-ranges outside of 32 bits space\n",
58681 +                      hose->dn->full_name);
58682 +               return -ENXIO;
58683 +       }
58684 + out:
58685 +       dma_offset_set = 1;
58686 +       pci_dram_offset = res->start;
58687 +
58688 +       printk(KERN_INFO "4xx PCI DMA offset set to 0x%08lx\n",
58689 +              pci_dram_offset);
58690 +       return 0;
58691 +}
58692 +
58693 +/*
58694 + * 4xx PCI 2.x part
58695 + */
58696 +
58697 +static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose,
58698 +                                            void __iomem *reg)
58699 +{
58700 +       u32 la, ma, pcila, pciha;
58701 +       int i, j;
58702 +
58703 +       /* Setup outbound memory windows */
58704 +       for (i = j = 0; i < 3; i++) {
58705 +               struct resource *res = &hose->mem_resources[i];
58706 +
58707 +               /* we only care about memory windows */
58708 +               if (!(res->flags & IORESOURCE_MEM))
58709 +                       continue;
58710 +               if (j > 2) {
58711 +                       printk(KERN_WARNING "%s: Too many ranges\n",
58712 +                              hose->dn->full_name);
58713 +                       break;
58714 +               }
58715 +
58716 +               /* Calculate register values */
58717 +               la = res->start;
58718 +               pciha = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
58719 +               pcila = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
58720 +
58721 +               ma = res->end + 1 - res->start;
58722 +               if (!is_power_of_2(ma) || ma < 0x1000 || ma > 0xffffffffu) {
58723 +                       printk(KERN_WARNING "%s: Resource out of range\n",
58724 +                              hose->dn->full_name);
58725 +                       continue;
58726 +               }
58727 +               ma = (0xffffffffu << ilog2(ma)) | 0x1;
58728 +               if (res->flags & IORESOURCE_PREFETCH)
58729 +                       ma |= 0x2;
58730 +
58731 +               /* Program register values */
58732 +               writel(la, reg + PCIL0_PMM0LA + (0x10 * j));
58733 +               writel(pcila, reg + PCIL0_PMM0PCILA + (0x10 * j));
58734 +               writel(pciha, reg + PCIL0_PMM0PCIHA + (0x10 * j));
58735 +               writel(ma, reg + PCIL0_PMM0MA + (0x10 * j));
58736 +               j++;
58737 +       }
58738 +}
58739 +
58740 +static void __init ppc4xx_configure_pci_PTMs(struct pci_controller *hose,
58741 +                                            void __iomem *reg,
58742 +                                            const struct resource *res)
58743 +{
58744 +       resource_size_t size = res->end - res->start + 1;
58745 +       u32 sa;
58746 +
58747 +       /* Calculate window size */
58748 +       sa = (0xffffffffu << ilog2(size)) | 1;
58749 +       sa |= 0x1;
58750 +
58751 +       /* RAM is always at 0 local for now */
58752 +       writel(0, reg + PCIL0_PTM1LA);
58753 +       writel(sa, reg + PCIL0_PTM1MS);
58754 +
58755 +       /* Map on PCI side */
58756 +       early_write_config_dword(hose, hose->first_busno, 0,
58757 +                                PCI_BASE_ADDRESS_1, res->start);
58758 +       early_write_config_dword(hose, hose->first_busno, 0,
58759 +                                PCI_BASE_ADDRESS_2, 0x00000000);
58760 +       early_write_config_word(hose, hose->first_busno, 0,
58761 +                               PCI_COMMAND, 0x0006);
58762 +}
58763 +
58764 +static void __init ppc4xx_probe_pci_bridge(struct device_node *np)
58765 +{
58766 +       /* NYI */
58767 +       struct resource rsrc_cfg;
58768 +       struct resource rsrc_reg;
58769 +       struct resource dma_window;
58770 +       struct pci_controller *hose = NULL;
58771 +       void __iomem *reg = NULL;
58772 +       const int *bus_range;
58773 +       int primary = 0;
58774 +
58775 +       /* Fetch config space registers address */
58776 +       if (of_address_to_resource(np, 0, &rsrc_cfg)) {
58777 +               printk(KERN_ERR "%s:Can't get PCI config register base !",
58778 +                      np->full_name);
58779 +               return;
58780 +       }
58781 +       /* Fetch host bridge internal registers address */
58782 +       if (of_address_to_resource(np, 3, &rsrc_reg)) {
58783 +               printk(KERN_ERR "%s: Can't get PCI internal register base !",
58784 +                      np->full_name);
58785 +               return;
58786 +       }
58787 +
58788 +       /* Check if primary bridge */
58789 +       if (of_get_property(np, "primary", NULL))
58790 +               primary = 1;
58791 +
58792 +       /* Get bus range if any */
58793 +       bus_range = of_get_property(np, "bus-range", NULL);
58794 +
58795 +       /* Map registers */
58796 +       reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start);
58797 +       if (reg == NULL) {
58798 +               printk(KERN_ERR "%s: Can't map registers !", np->full_name);
58799 +               goto fail;
58800 +       }
58801 +
58802 +       /* Allocate the host controller data structure */
58803 +       hose = pcibios_alloc_controller(np);
58804 +       if (!hose)
58805 +               goto fail;
58806 +
58807 +       hose->first_busno = bus_range ? bus_range[0] : 0x0;
58808 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
58809 +
58810 +       /* Setup config space */
58811 +       setup_indirect_pci(hose, rsrc_cfg.start, rsrc_cfg.start + 0x4, 0);
58812 +
58813 +       /* Disable all windows */
58814 +       writel(0, reg + PCIL0_PMM0MA);
58815 +       writel(0, reg + PCIL0_PMM1MA);
58816 +       writel(0, reg + PCIL0_PMM2MA);
58817 +       writel(0, reg + PCIL0_PTM1MS);
58818 +       writel(0, reg + PCIL0_PTM2MS);
58819 +
58820 +       /* Parse outbound mapping resources */
58821 +       pci_process_bridge_OF_ranges(hose, np, primary);
58822 +
58823 +       /* Parse inbound mapping resources */
58824 +       if (ppc4xx_parse_dma_ranges(hose, reg, &dma_window) != 0)
58825 +               goto fail;
58826 +
58827 +       /* Configure outbound ranges POMs */
58828 +       ppc4xx_configure_pci_PMMs(hose, reg);
58829 +
58830 +       /* Configure inbound ranges PIMs */
58831 +       ppc4xx_configure_pci_PTMs(hose, reg, &dma_window);
58832 +
58833 +       /* We don't need the registers anymore */
58834 +       iounmap(reg);
58835 +       return;
58836 +
58837 + fail:
58838 +       if (hose)
58839 +               pcibios_free_controller(hose);
58840 +       if (reg)
58841 +               iounmap(reg);
58842 +}
58843 +
58844 +/*
58845 + * 4xx PCI-X part
58846 + */
58847 +
58848 +static void __init ppc4xx_configure_pcix_POMs(struct pci_controller *hose,
58849 +                                             void __iomem *reg)
58850 +{
58851 +       u32 lah, lal, pciah, pcial, sa;
58852 +       int i, j;
58853 +
58854 +       /* Setup outbound memory windows */
58855 +       for (i = j = 0; i < 3; i++) {
58856 +               struct resource *res = &hose->mem_resources[i];
58857 +
58858 +               /* we only care about memory windows */
58859 +               if (!(res->flags & IORESOURCE_MEM))
58860 +                       continue;
58861 +               if (j > 1) {
58862 +                       printk(KERN_WARNING "%s: Too many ranges\n",
58863 +                              hose->dn->full_name);
58864 +                       break;
58865 +               }
58866 +
58867 +               /* Calculate register values */
58868 +               lah = RES_TO_U32_HIGH(res->start);
58869 +               lal = RES_TO_U32_LOW(res->start);
58870 +               pciah = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
58871 +               pcial = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
58872 +               sa = res->end + 1 - res->start;
58873 +               if (!is_power_of_2(sa) || sa < 0x100000 ||
58874 +                   sa > 0xffffffffu) {
58875 +                       printk(KERN_WARNING "%s: Resource out of range\n",
58876 +                              hose->dn->full_name);
58877 +                       continue;
58878 +               }
58879 +               sa = (0xffffffffu << ilog2(sa)) | 0x1;
58880 +
58881 +               /* Program register values */
58882 +               if (j == 0) {
58883 +                       writel(lah, reg + PCIX0_POM0LAH);
58884 +                       writel(lal, reg + PCIX0_POM0LAL);
58885 +                       writel(pciah, reg + PCIX0_POM0PCIAH);
58886 +                       writel(pcial, reg + PCIX0_POM0PCIAL);
58887 +                       writel(sa, reg + PCIX0_POM0SA);
58888 +               } else {
58889 +                       writel(lah, reg + PCIX0_POM1LAH);
58890 +                       writel(lal, reg + PCIX0_POM1LAL);
58891 +                       writel(pciah, reg + PCIX0_POM1PCIAH);
58892 +                       writel(pcial, reg + PCIX0_POM1PCIAL);
58893 +                       writel(sa, reg + PCIX0_POM1SA);
58894 +               }
58895 +               j++;
58896 +       }
58897 +}
58898 +
58899 +static void __init ppc4xx_configure_pcix_PIMs(struct pci_controller *hose,
58900 +                                             void __iomem *reg,
58901 +                                             const struct resource *res,
58902 +                                             int big_pim,
58903 +                                             int enable_msi_hole)
58904 +{
58905 +       resource_size_t size = res->end - res->start + 1;
58906 +       u32 sa;
58907 +
58908 +       /* RAM is always at 0 */
58909 +       writel(0x00000000, reg + PCIX0_PIM0LAH);
58910 +       writel(0x00000000, reg + PCIX0_PIM0LAL);
58911 +
58912 +       /* Calculate window size */
58913 +       sa = (0xffffffffu << ilog2(size)) | 1;
58914 +       sa |= 0x1;
58915 +       if (res->flags & IORESOURCE_PREFETCH)
58916 +               sa |= 0x2;
58917 +       if (enable_msi_hole)
58918 +               sa |= 0x4;
58919 +       writel(sa, reg + PCIX0_PIM0SA);
58920 +       if (big_pim)
58921 +               writel(0xffffffff, reg + PCIX0_PIM0SAH);
58922 +
58923 +       /* Map on PCI side */
58924 +       writel(0x00000000, reg + PCIX0_BAR0H);
58925 +       writel(res->start, reg + PCIX0_BAR0L);
58926 +       writew(0x0006, reg + PCIX0_COMMAND);
58927 +}
58928 +
58929 +static void __init ppc4xx_probe_pcix_bridge(struct device_node *np)
58930 +{
58931 +       struct resource rsrc_cfg;
58932 +       struct resource rsrc_reg;
58933 +       struct resource dma_window;
58934 +       struct pci_controller *hose = NULL;
58935 +       void __iomem *reg = NULL;
58936 +       const int *bus_range;
58937 +       int big_pim = 0, msi = 0, primary = 0;
58938 +
58939 +       /* Fetch config space registers address */
58940 +       if (of_address_to_resource(np, 0, &rsrc_cfg)) {
58941 +               printk(KERN_ERR "%s:Can't get PCI-X config register base !",
58942 +                      np->full_name);
58943 +               return;
58944 +       }
58945 +       /* Fetch host bridge internal registers address */
58946 +       if (of_address_to_resource(np, 3, &rsrc_reg)) {
58947 +               printk(KERN_ERR "%s: Can't get PCI-X internal register base !",
58948 +                      np->full_name);
58949 +               return;
58950 +       }
58951 +
58952 +       /* Check if it supports large PIMs (440GX) */
58953 +       if (of_get_property(np, "large-inbound-windows", NULL))
58954 +               big_pim = 1;
58955 +
58956 +       /* Check if we should enable MSIs inbound hole */
58957 +       if (of_get_property(np, "enable-msi-hole", NULL))
58958 +               msi = 1;
58959 +
58960 +       /* Check if primary bridge */
58961 +       if (of_get_property(np, "primary", NULL))
58962 +               primary = 1;
58963 +
58964 +       /* Get bus range if any */
58965 +       bus_range = of_get_property(np, "bus-range", NULL);
58966 +
58967 +       /* Map registers */
58968 +       reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start);
58969 +       if (reg == NULL) {
58970 +               printk(KERN_ERR "%s: Can't map registers !", np->full_name);
58971 +               goto fail;
58972 +       }
58973 +
58974 +       /* Allocate the host controller data structure */
58975 +       hose = pcibios_alloc_controller(np);
58976 +       if (!hose)
58977 +               goto fail;
58978 +
58979 +       hose->first_busno = bus_range ? bus_range[0] : 0x0;
58980 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
58981 +
58982 +       /* Setup config space */
58983 +       setup_indirect_pci(hose, rsrc_cfg.start, rsrc_cfg.start + 0x4, 0);
58984 +
58985 +       /* Disable all windows */
58986 +       writel(0, reg + PCIX0_POM0SA);
58987 +       writel(0, reg + PCIX0_POM1SA);
58988 +       writel(0, reg + PCIX0_POM2SA);
58989 +       writel(0, reg + PCIX0_PIM0SA);
58990 +       writel(0, reg + PCIX0_PIM1SA);
58991 +       writel(0, reg + PCIX0_PIM2SA);
58992 +       if (big_pim) {
58993 +               writel(0, reg + PCIX0_PIM0SAH);
58994 +               writel(0, reg + PCIX0_PIM2SAH);
58995 +       }
58996 +
58997 +       /* Parse outbound mapping resources */
58998 +       pci_process_bridge_OF_ranges(hose, np, primary);
58999 +
59000 +       /* Parse inbound mapping resources */
59001 +       if (ppc4xx_parse_dma_ranges(hose, reg, &dma_window) != 0)
59002 +               goto fail;
59003 +
59004 +       /* Configure outbound ranges POMs */
59005 +       ppc4xx_configure_pcix_POMs(hose, reg);
59006 +
59007 +       /* Configure inbound ranges PIMs */
59008 +       ppc4xx_configure_pcix_PIMs(hose, reg, &dma_window, big_pim, msi);
59009 +
59010 +       /* We don't need the registers anymore */
59011 +       iounmap(reg);
59012 +       return;
59013 +
59014 + fail:
59015 +       if (hose)
59016 +               pcibios_free_controller(hose);
59017 +       if (reg)
59018 +               iounmap(reg);
59019 +}
59020 +
59021 +#ifdef CONFIG_PPC4xx_PCI_EXPRESS
59022 +
59023 +/*
59024 + * 4xx PCI-Express part
59025 + *
59026 + * We support 3 parts currently based on the compatible property:
59027 + *
59028 + * ibm,plb-pciex-440spe
59029 + * ibm,plb-pciex-405ex
59030 + *
59031 + * Anything else will be rejected for now as they are all subtly
59032 + * different unfortunately.
59033 + *
59034 + */
59035 +
59036 +#define MAX_PCIE_BUS_MAPPED    0x40
59037 +
59038 +struct ppc4xx_pciex_port
59039 +{
59040 +       struct pci_controller   *hose;
59041 +       struct device_node      *node;
59042 +       unsigned int            index;
59043 +       int                     endpoint;
59044 +       int                     link;
59045 +       int                     has_ibpre;
59046 +       unsigned int            sdr_base;
59047 +       dcr_host_t              dcrs;
59048 +       struct resource         cfg_space;
59049 +       struct resource         utl_regs;
59050 +       void __iomem            *utl_base;
59051 +};
59052 +
59053 +static struct ppc4xx_pciex_port *ppc4xx_pciex_ports;
59054 +static unsigned int ppc4xx_pciex_port_count;
59055 +
59056 +struct ppc4xx_pciex_hwops
59057 +{
59058 +       int (*core_init)(struct device_node *np);
59059 +       int (*port_init_hw)(struct ppc4xx_pciex_port *port);
59060 +       int (*setup_utl)(struct ppc4xx_pciex_port *port);
59061 +};
59062 +
59063 +static struct ppc4xx_pciex_hwops *ppc4xx_pciex_hwops;
59064 +
59065 +#ifdef CONFIG_44x
59066 +
59067 +/* Check various reset bits of the 440SPe PCIe core */
59068 +static int __init ppc440spe_pciex_check_reset(struct device_node *np)
59069 +{
59070 +       u32 valPE0, valPE1, valPE2;
59071 +       int err = 0;
59072 +
59073 +       /* SDR0_PEGPLLLCT1 reset */
59074 +       if (!(mfdcri(SDR0, PESDR0_PLLLCT1) & 0x01000000)) {
59075 +               /*
59076 +                * the PCIe core was probably already initialised
59077 +                * by firmware - let's re-reset RCSSET regs
59078 +                *
59079 +                * -- Shouldn't we also re-reset the whole thing ? -- BenH
59080 +                */
59081 +               pr_debug("PCIE: SDR0_PLLLCT1 already reset.\n");
59082 +               mtdcri(SDR0, PESDR0_440SPE_RCSSET, 0x01010000);
59083 +               mtdcri(SDR0, PESDR1_440SPE_RCSSET, 0x01010000);
59084 +               mtdcri(SDR0, PESDR2_440SPE_RCSSET, 0x01010000);
59085 +       }
59086 +
59087 +       valPE0 = mfdcri(SDR0, PESDR0_440SPE_RCSSET);
59088 +       valPE1 = mfdcri(SDR0, PESDR1_440SPE_RCSSET);
59089 +       valPE2 = mfdcri(SDR0, PESDR2_440SPE_RCSSET);
59090 +
59091 +       /* SDR0_PExRCSSET rstgu */
59092 +       if (!(valPE0 & 0x01000000) ||
59093 +           !(valPE1 & 0x01000000) ||
59094 +           !(valPE2 & 0x01000000)) {
59095 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstgu error\n");
59096 +               err = -1;
59097 +       }
59098 +
59099 +       /* SDR0_PExRCSSET rstdl */
59100 +       if (!(valPE0 & 0x00010000) ||
59101 +           !(valPE1 & 0x00010000) ||
59102 +           !(valPE2 & 0x00010000)) {
59103 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstdl error\n");
59104 +               err = -1;
59105 +       }
59106 +
59107 +       /* SDR0_PExRCSSET rstpyn */
59108 +       if ((valPE0 & 0x00001000) ||
59109 +           (valPE1 & 0x00001000) ||
59110 +           (valPE2 & 0x00001000)) {
59111 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstpyn error\n");
59112 +               err = -1;
59113 +       }
59114 +
59115 +       /* SDR0_PExRCSSET hldplb */
59116 +       if ((valPE0 & 0x10000000) ||
59117 +           (valPE1 & 0x10000000) ||
59118 +           (valPE2 & 0x10000000)) {
59119 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET hldplb error\n");
59120 +               err = -1;
59121 +       }
59122 +
59123 +       /* SDR0_PExRCSSET rdy */
59124 +       if ((valPE0 & 0x00100000) ||
59125 +           (valPE1 & 0x00100000) ||
59126 +           (valPE2 & 0x00100000)) {
59127 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rdy error\n");
59128 +               err = -1;
59129 +       }
59130 +
59131 +       /* SDR0_PExRCSSET shutdown */
59132 +       if ((valPE0 & 0x00000100) ||
59133 +           (valPE1 & 0x00000100) ||
59134 +           (valPE2 & 0x00000100)) {
59135 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET shutdown error\n");
59136 +               err = -1;
59137 +       }
59138 +
59139 +       return err;
59140 +}
59141 +
59142 +/* Global PCIe core initializations for 440SPe core */
59143 +static int __init ppc440spe_pciex_core_init(struct device_node *np)
59144 +{
59145 +       int time_out = 20;
59146 +
59147 +       /* Set PLL clock receiver to LVPECL */
59148 +       mtdcri(SDR0, PESDR0_PLLLCT1, mfdcri(SDR0, PESDR0_PLLLCT1) | 1 << 28);
59149 +
59150 +       /* Shouldn't we do all the calibration stuff etc... here ? */
59151 +       if (ppc440spe_pciex_check_reset(np))
59152 +               return -ENXIO;
59153 +
59154 +       if (!(mfdcri(SDR0, PESDR0_PLLLCT2) & 0x10000)) {
59155 +               printk(KERN_INFO "PCIE: PESDR_PLLCT2 resistance calibration "
59156 +                      "failed (0x%08x)\n",
59157 +                      mfdcri(SDR0, PESDR0_PLLLCT2));
59158 +               return -1;
59159 +       }
59160 +
59161 +       /* De-assert reset of PCIe PLL, wait for lock */
59162 +       mtdcri(SDR0, PESDR0_PLLLCT1,
59163 +              mfdcri(SDR0, PESDR0_PLLLCT1) & ~(1 << 24));
59164 +       udelay(3);
59165 +
59166 +       while (time_out) {
59167 +               if (!(mfdcri(SDR0, PESDR0_PLLLCT3) & 0x10000000)) {
59168 +                       time_out--;
59169 +                       udelay(1);
59170 +               } else
59171 +                       break;
59172 +       }
59173 +       if (!time_out) {
59174 +               printk(KERN_INFO "PCIE: VCO output not locked\n");
59175 +               return -1;
59176 +       }
59177 +
59178 +       pr_debug("PCIE initialization OK\n");
59179 +
59180 +       return 3;
59181 +}
59182 +
59183 +static int ppc440spe_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
59184 +{
59185 +       u32 val = 1 << 24;
59186 +
59187 +       if (port->endpoint)
59188 +               val = PTYPE_LEGACY_ENDPOINT << 20;
59189 +       else
59190 +               val = PTYPE_ROOT_PORT << 20;
59191 +
59192 +       if (port->index == 0)
59193 +               val |= LNKW_X8 << 12;
59194 +       else
59195 +               val |= LNKW_X4 << 12;
59196 +
59197 +       mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET, val);
59198 +       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x20222222);
59199 +       if (ppc440spe_revA())
59200 +               mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x11000000);
59201 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL0SET1, 0x35000000);
59202 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL1SET1, 0x35000000);
59203 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL2SET1, 0x35000000);
59204 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL3SET1, 0x35000000);
59205 +       if (port->index == 0) {
59206 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL4SET1,
59207 +                      0x35000000);
59208 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL5SET1,
59209 +                      0x35000000);
59210 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL6SET1,
59211 +                      0x35000000);
59212 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL7SET1,
59213 +                      0x35000000);
59214 +       }
59215 +       val = mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET);
59216 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
59217 +              (val & ~(1 << 24 | 1 << 16)) | 1 << 12);
59218 +
59219 +       return 0;
59220 +}
59221 +
59222 +static int ppc440speA_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
59223 +{
59224 +       return ppc440spe_pciex_init_port_hw(port);
59225 +}
59226 +
59227 +static int ppc440speB_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
59228 +{
59229 +       int rc = ppc440spe_pciex_init_port_hw(port);
59230 +
59231 +       port->has_ibpre = 1;
59232 +
59233 +       return rc;
59234 +}
59235 +
59236 +static int ppc440speA_pciex_init_utl(struct ppc4xx_pciex_port *port)
59237 +{
59238 +       /* XXX Check what that value means... I hate magic */
59239 +       dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x68782800);
59240 +
59241 +       /*
59242 +        * Set buffer allocations and then assert VRB and TXE.
59243 +        */
59244 +       out_be32(port->utl_base + PEUTL_OUTTR,   0x08000000);
59245 +       out_be32(port->utl_base + PEUTL_INTR,    0x02000000);
59246 +       out_be32(port->utl_base + PEUTL_OPDBSZ,  0x10000000);
59247 +       out_be32(port->utl_base + PEUTL_PBBSZ,   0x53000000);
59248 +       out_be32(port->utl_base + PEUTL_IPHBSZ,  0x08000000);
59249 +       out_be32(port->utl_base + PEUTL_IPDBSZ,  0x10000000);
59250 +       out_be32(port->utl_base + PEUTL_RCIRQEN, 0x00f00000);
59251 +       out_be32(port->utl_base + PEUTL_PCTL,    0x80800066);
59252 +
59253 +       return 0;
59254 +}
59255 +
59256 +static int ppc440speB_pciex_init_utl(struct ppc4xx_pciex_port *port)
59257 +{
59258 +       /* Report CRS to the operating system */
59259 +       out_be32(port->utl_base + PEUTL_PBCTL,    0x08000000);
59260 +
59261 +       return 0;
59262 +}
59263 +
59264 +static struct ppc4xx_pciex_hwops ppc440speA_pcie_hwops __initdata =
59265 +{
59266 +       .core_init      = ppc440spe_pciex_core_init,
59267 +       .port_init_hw   = ppc440speA_pciex_init_port_hw,
59268 +       .setup_utl      = ppc440speA_pciex_init_utl,
59269 +};
59270 +
59271 +static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata =
59272 +{
59273 +       .core_init      = ppc440spe_pciex_core_init,
59274 +       .port_init_hw   = ppc440speB_pciex_init_port_hw,
59275 +       .setup_utl      = ppc440speB_pciex_init_utl,
59276 +};
59277 +
59278 +#endif /* CONFIG_44x */
59279 +
59280 +#ifdef CONFIG_40x
59281 +
59282 +static int __init ppc405ex_pciex_core_init(struct device_node *np)
59283 +{
59284 +       /* Nothing to do, return 2 ports */
59285 +       return 2;
59286 +}
59287 +
59288 +static void ppc405ex_pcie_phy_reset(struct ppc4xx_pciex_port *port)
59289 +{
59290 +       /* Assert the PE0_PHY reset */
59291 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01010000);
59292 +       msleep(1);
59293 +
59294 +       /* deassert the PE0_hotreset */
59295 +       if (port->endpoint)
59296 +               mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01111000);
59297 +       else
59298 +               mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01101000);
59299 +
59300 +       /* poll for phy !reset */
59301 +       /* XXX FIXME add timeout */
59302 +       while (!(mfdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSTA) & 0x00001000))
59303 +               ;
59304 +
59305 +       /* deassert the PE0_gpl_utl_reset */
59306 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x00101000);
59307 +}
59308 +
59309 +static int ppc405ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
59310 +{
59311 +       u32 val;
59312 +
59313 +       if (port->endpoint)
59314 +               val = PTYPE_LEGACY_ENDPOINT;
59315 +       else
59316 +               val = PTYPE_ROOT_PORT;
59317 +
59318 +       mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET,
59319 +              1 << 24 | val << 20 | LNKW_X1 << 12);
59320 +
59321 +       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x00000000);
59322 +       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x01010000);
59323 +       mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET1, 0x720F0000);
59324 +       mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET2, 0x70600003);
59325 +
59326 +       /*
59327 +        * Only reset the PHY when no link is currently established.
59328 +        * This is for the Atheros PCIe board which has problems to establish
59329 +        * the link (again) after this PHY reset. All other currently tested
59330 +        * PCIe boards don't show this problem.
59331 +        * This has to be re-tested and fixed in a later release!
59332 +        */
59333 +#if 0 /* XXX FIXME: Not resetting the PHY will leave all resources
59334 +       * configured as done previously by U-Boot. Then Linux will currently
59335 +       * not reassign them. So the PHY reset is now done always. This will
59336 +       * lead to problems with the Atheros PCIe board again.
59337 +       */
59338 +       val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
59339 +       if (!(val & 0x00001000))
59340 +               ppc405ex_pcie_phy_reset(port);
59341 +#else
59342 +       ppc405ex_pcie_phy_reset(port);
59343 +#endif
59344 +
59345 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, 0x10000000);  /* guarded on */
59346 +
59347 +       port->has_ibpre = 1;
59348 +
59349 +       return 0;
59350 +}
59351 +
59352 +static int ppc405ex_pciex_init_utl(struct ppc4xx_pciex_port *port)
59353 +{
59354 +       dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x0);
59355 +
59356 +       /*
59357 +        * Set buffer allocations and then assert VRB and TXE.
59358 +        */
59359 +       out_be32(port->utl_base + PEUTL_OUTTR,   0x02000000);
59360 +       out_be32(port->utl_base + PEUTL_INTR,    0x02000000);
59361 +       out_be32(port->utl_base + PEUTL_OPDBSZ,  0x04000000);
59362 +       out_be32(port->utl_base + PEUTL_PBBSZ,   0x21000000);
59363 +       out_be32(port->utl_base + PEUTL_IPHBSZ,  0x02000000);
59364 +       out_be32(port->utl_base + PEUTL_IPDBSZ,  0x04000000);
59365 +       out_be32(port->utl_base + PEUTL_RCIRQEN, 0x00f00000);
59366 +       out_be32(port->utl_base + PEUTL_PCTL,    0x80800066);
59367 +
59368 +       out_be32(port->utl_base + PEUTL_PBCTL,   0x08000000);
59369 +
59370 +       return 0;
59371 +}
59372 +
59373 +static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata =
59374 +{
59375 +       .core_init      = ppc405ex_pciex_core_init,
59376 +       .port_init_hw   = ppc405ex_pciex_init_port_hw,
59377 +       .setup_utl      = ppc405ex_pciex_init_utl,
59378 +};
59379 +
59380 +#endif /* CONFIG_40x */
59381 +
59382 +
59383 +/* Check that the core has been initied and if not, do it */
59384 +static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
59385 +{
59386 +       static int core_init;
59387 +       int count = -ENODEV;
59388 +
59389 +       if (core_init++)
59390 +               return 0;
59391 +
59392 +#ifdef CONFIG_44x
59393 +       if (of_device_is_compatible(np, "ibm,plb-pciex-440spe")) {
59394 +               if (ppc440spe_revA())
59395 +                       ppc4xx_pciex_hwops = &ppc440speA_pcie_hwops;
59396 +               else
59397 +                       ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops;
59398 +       }
59399 +#endif /* CONFIG_44x    */
59400 +#ifdef CONFIG_40x
59401 +       if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
59402 +               ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops;
59403 +#endif
59404 +       if (ppc4xx_pciex_hwops == NULL) {
59405 +               printk(KERN_WARNING "PCIE: unknown host type %s\n",
59406 +                      np->full_name);
59407 +               return -ENODEV;
59408 +       }
59409 +
59410 +       count = ppc4xx_pciex_hwops->core_init(np);
59411 +       if (count > 0) {
59412 +               ppc4xx_pciex_ports =
59413 +                      kzalloc(count * sizeof(struct ppc4xx_pciex_port),
59414 +                              GFP_KERNEL);
59415 +               if (ppc4xx_pciex_ports) {
59416 +                       ppc4xx_pciex_port_count = count;
59417 +                       return 0;
59418 +               }
59419 +               printk(KERN_WARNING "PCIE: failed to allocate ports array\n");
59420 +               return -ENOMEM;
59421 +       }
59422 +       return -ENODEV;
59423 +}
59424 +
59425 +static void __init ppc4xx_pciex_port_init_mapping(struct ppc4xx_pciex_port *port)
59426 +{
59427 +       /* We map PCI Express configuration based on the reg property */
59428 +       dcr_write(port->dcrs, DCRO_PEGPL_CFGBAH,
59429 +                 RES_TO_U32_HIGH(port->cfg_space.start));
59430 +       dcr_write(port->dcrs, DCRO_PEGPL_CFGBAL,
59431 +                 RES_TO_U32_LOW(port->cfg_space.start));
59432 +
59433 +       /* XXX FIXME: Use size from reg property. For now, map 512M */
59434 +       dcr_write(port->dcrs, DCRO_PEGPL_CFGMSK, 0xe0000001);
59435 +
59436 +       /* We map UTL registers based on the reg property */
59437 +       dcr_write(port->dcrs, DCRO_PEGPL_REGBAH,
59438 +                 RES_TO_U32_HIGH(port->utl_regs.start));
59439 +       dcr_write(port->dcrs, DCRO_PEGPL_REGBAL,
59440 +                 RES_TO_U32_LOW(port->utl_regs.start));
59441 +
59442 +       /* XXX FIXME: Use size from reg property */
59443 +       dcr_write(port->dcrs, DCRO_PEGPL_REGMSK, 0x00007001);
59444 +
59445 +       /* Disable all other outbound windows */
59446 +       dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, 0);
59447 +       dcr_write(port->dcrs, DCRO_PEGPL_OMR2MSKL, 0);
59448 +       dcr_write(port->dcrs, DCRO_PEGPL_OMR3MSKL, 0);
59449 +       dcr_write(port->dcrs, DCRO_PEGPL_MSGMSK, 0);
59450 +}
59451 +
59452 +static int __init ppc4xx_pciex_wait_on_sdr(struct ppc4xx_pciex_port *port,
59453 +                                          unsigned int sdr_offset,
59454 +                                          unsigned int mask,
59455 +                                          unsigned int value,
59456 +                                          int timeout_ms)
59457 +{
59458 +       u32 val;
59459 +
59460 +       while(timeout_ms--) {
59461 +               val = mfdcri(SDR0, port->sdr_base + sdr_offset);
59462 +               if ((val & mask) == value) {
59463 +                       pr_debug("PCIE%d: Wait on SDR %x success with tm %d (%08x)\n",
59464 +                                port->index, sdr_offset, timeout_ms, val);
59465 +                       return 0;
59466 +               }
59467 +               msleep(1);
59468 +       }
59469 +       return -1;
59470 +}
59471 +
59472 +static int __init ppc4xx_pciex_port_init(struct ppc4xx_pciex_port *port)
59473 +{
59474 +       int rc = 0;
59475 +
59476 +       /* Init HW */
59477 +       if (ppc4xx_pciex_hwops->port_init_hw)
59478 +               rc = ppc4xx_pciex_hwops->port_init_hw(port);
59479 +       if (rc != 0)
59480 +               return rc;
59481 +
59482 +       printk(KERN_INFO "PCIE%d: Checking link...\n",
59483 +              port->index);
59484 +
59485 +       /* Wait for reset to complete */
59486 +       if (ppc4xx_pciex_wait_on_sdr(port, PESDRn_RCSSTS, 1 << 20, 0, 10)) {
59487 +               printk(KERN_WARNING "PCIE%d: PGRST failed\n",
59488 +                      port->index);
59489 +               return -1;
59490 +       }
59491 +
59492 +       /* Check for card presence detect if supported, if not, just wait for
59493 +        * link unconditionally.
59494 +        *
59495 +        * note that we don't fail if there is no link, we just filter out
59496 +        * config space accesses. That way, it will be easier to implement
59497 +        * hotplug later on.
59498 +        */
59499 +       if (!port->has_ibpre ||
59500 +           !ppc4xx_pciex_wait_on_sdr(port, PESDRn_LOOP,
59501 +                                     1 << 28, 1 << 28, 100)) {
59502 +               printk(KERN_INFO
59503 +                      "PCIE%d: Device detected, waiting for link...\n",
59504 +                      port->index);
59505 +               if (ppc4xx_pciex_wait_on_sdr(port, PESDRn_LOOP,
59506 +                                            0x1000, 0x1000, 2000))
59507 +                       printk(KERN_WARNING
59508 +                              "PCIE%d: Link up failed\n", port->index);
59509 +               else {
59510 +                       printk(KERN_INFO
59511 +                              "PCIE%d: link is up !\n", port->index);
59512 +                       port->link = 1;
59513 +               }
59514 +       } else
59515 +               printk(KERN_INFO "PCIE%d: No device detected.\n", port->index);
59516 +
59517 +       /*
59518 +        * Initialize mapping: disable all regions and configure
59519 +        * CFG and REG regions based on resources in the device tree
59520 +        */
59521 +       ppc4xx_pciex_port_init_mapping(port);
59522 +
59523 +       /*
59524 +        * Map UTL
59525 +        */
59526 +       port->utl_base = ioremap(port->utl_regs.start, 0x100);
59527 +       BUG_ON(port->utl_base == NULL);
59528 +
59529 +       /*
59530 +        * Setup UTL registers --BenH.
59531 +        */
59532 +       if (ppc4xx_pciex_hwops->setup_utl)
59533 +               ppc4xx_pciex_hwops->setup_utl(port);
59534 +
59535 +       /*
59536 +        * Check for VC0 active and assert RDY.
59537 +        */
59538 +       if (port->link &&
59539 +           ppc4xx_pciex_wait_on_sdr(port, PESDRn_RCSSTS,
59540 +                                    1 << 16, 1 << 16, 5000)) {
59541 +               printk(KERN_INFO "PCIE%d: VC0 not active\n", port->index);
59542 +               port->link = 0;
59543 +       }
59544 +
59545 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
59546 +              mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) | 1 << 20);
59547 +       msleep(100);
59548 +
59549 +       return 0;
59550 +}
59551 +
59552 +static int ppc4xx_pciex_validate_bdf(struct ppc4xx_pciex_port *port,
59553 +                                    struct pci_bus *bus,
59554 +                                    unsigned int devfn)
59555 +{
59556 +       static int message;
59557 +
59558 +       /* Endpoint can not generate upstream(remote) config cycles */
59559 +       if (port->endpoint && bus->number != port->hose->first_busno)
59560 +               return PCIBIOS_DEVICE_NOT_FOUND;
59561 +
59562 +       /* Check we are within the mapped range */
59563 +       if (bus->number > port->hose->last_busno) {
59564 +               if (!message) {
59565 +                       printk(KERN_WARNING "Warning! Probing bus %u"
59566 +                              " out of range !\n", bus->number);
59567 +                       message++;
59568 +               }
59569 +               return PCIBIOS_DEVICE_NOT_FOUND;
59570 +       }
59571 +
59572 +       /* The root complex has only one device / function */
59573 +       if (bus->number == port->hose->first_busno && devfn != 0)
59574 +               return PCIBIOS_DEVICE_NOT_FOUND;
59575 +
59576 +       /* The other side of the RC has only one device as well */
59577 +       if (bus->number == (port->hose->first_busno + 1) &&
59578 +           PCI_SLOT(devfn) != 0)
59579 +               return PCIBIOS_DEVICE_NOT_FOUND;
59580 +
59581 +       /* Check if we have a link */
59582 +       if ((bus->number != port->hose->first_busno) && !port->link)
59583 +               return PCIBIOS_DEVICE_NOT_FOUND;
59584 +
59585 +       return 0;
59586 +}
59587 +
59588 +static void __iomem *ppc4xx_pciex_get_config_base(struct ppc4xx_pciex_port *port,
59589 +                                                 struct pci_bus *bus,
59590 +                                                 unsigned int devfn)
59591 +{
59592 +       int relbus;
59593 +
59594 +       /* Remove the casts when we finally remove the stupid volatile
59595 +        * in struct pci_controller
59596 +        */
59597 +       if (bus->number == port->hose->first_busno)
59598 +               return (void __iomem *)port->hose->cfg_addr;
59599 +
59600 +       relbus = bus->number - (port->hose->first_busno + 1);
59601 +       return (void __iomem *)port->hose->cfg_data +
59602 +               ((relbus  << 20) | (devfn << 12));
59603 +}
59604 +
59605 +static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
59606 +                                   int offset, int len, u32 *val)
59607 +{
59608 +       struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
59609 +       struct ppc4xx_pciex_port *port =
59610 +               &ppc4xx_pciex_ports[hose->indirect_type];
59611 +       void __iomem *addr;
59612 +       u32 gpl_cfg;
59613 +
59614 +       BUG_ON(hose != port->hose);
59615 +
59616 +       if (ppc4xx_pciex_validate_bdf(port, bus, devfn) != 0)
59617 +               return PCIBIOS_DEVICE_NOT_FOUND;
59618 +
59619 +       addr = ppc4xx_pciex_get_config_base(port, bus, devfn);
59620 +
59621 +       /*
59622 +        * Reading from configuration space of non-existing device can
59623 +        * generate transaction errors. For the read duration we suppress
59624 +        * assertion of machine check exceptions to avoid those.
59625 +        */
59626 +       gpl_cfg = dcr_read(port->dcrs, DCRO_PEGPL_CFG);
59627 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg | GPL_DMER_MASK_DISA);
59628 +
59629 +       /* Make sure no CRS is recorded */
59630 +       out_be32(port->utl_base + PEUTL_RCSTA, 0x00040000);
59631 +
59632 +       switch (len) {
59633 +       case 1:
59634 +               *val = in_8((u8 *)(addr + offset));
59635 +               break;
59636 +       case 2:
59637 +               *val = in_le16((u16 *)(addr + offset));
59638 +               break;
59639 +       default:
59640 +               *val = in_le32((u32 *)(addr + offset));
59641 +               break;
59642 +       }
59643 +
59644 +       pr_debug("pcie-config-read: bus=%3d [%3d..%3d] devfn=0x%04x"
59645 +                " offset=0x%04x len=%d, addr=0x%p val=0x%08x\n",
59646 +                bus->number, hose->first_busno, hose->last_busno,
59647 +                devfn, offset, len, addr + offset, *val);
59648 +
59649 +       /* Check for CRS (440SPe rev B does that for us but heh ..) */
59650 +       if (in_be32(port->utl_base + PEUTL_RCSTA) & 0x00040000) {
59651 +               pr_debug("Got CRS !\n");
59652 +               if (len != 4 || offset != 0)
59653 +                       return PCIBIOS_DEVICE_NOT_FOUND;
59654 +               *val = 0xffff0001;
59655 +       }
59656 +
59657 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg);
59658 +
59659 +       return PCIBIOS_SUCCESSFUL;
59660 +}
59661 +
59662 +static int ppc4xx_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
59663 +                                    int offset, int len, u32 val)
59664 +{
59665 +       struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
59666 +       struct ppc4xx_pciex_port *port =
59667 +               &ppc4xx_pciex_ports[hose->indirect_type];
59668 +       void __iomem *addr;
59669 +       u32 gpl_cfg;
59670 +
59671 +       if (ppc4xx_pciex_validate_bdf(port, bus, devfn) != 0)
59672 +               return PCIBIOS_DEVICE_NOT_FOUND;
59673 +
59674 +       addr = ppc4xx_pciex_get_config_base(port, bus, devfn);
59675 +
59676 +       /*
59677 +        * Reading from configuration space of non-existing device can
59678 +        * generate transaction errors. For the read duration we suppress
59679 +        * assertion of machine check exceptions to avoid those.
59680 +        */
59681 +       gpl_cfg = dcr_read(port->dcrs, DCRO_PEGPL_CFG);
59682 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg | GPL_DMER_MASK_DISA);
59683 +
59684 +       pr_debug("pcie-config-write: bus=%3d [%3d..%3d] devfn=0x%04x"
59685 +                " offset=0x%04x len=%d, addr=0x%p val=0x%08x\n",
59686 +                bus->number, hose->first_busno, hose->last_busno,
59687 +                devfn, offset, len, addr + offset, val);
59688 +
59689 +       switch (len) {
59690 +       case 1:
59691 +               out_8((u8 *)(addr + offset), val);
59692 +               break;
59693 +       case 2:
59694 +               out_le16((u16 *)(addr + offset), val);
59695 +               break;
59696 +       default:
59697 +               out_le32((u32 *)(addr + offset), val);
59698 +               break;
59699 +       }
59700 +
59701 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg);
59702 +
59703 +       return PCIBIOS_SUCCESSFUL;
59704 +}
59705 +
59706 +static struct pci_ops ppc4xx_pciex_pci_ops =
59707 +{
59708 +       .read  = ppc4xx_pciex_read_config,
59709 +       .write = ppc4xx_pciex_write_config,
59710 +};
59711 +
59712 +static void __init ppc4xx_configure_pciex_POMs(struct ppc4xx_pciex_port *port,
59713 +                                              struct pci_controller *hose,
59714 +                                              void __iomem *mbase)
59715 +{
59716 +       u32 lah, lal, pciah, pcial, sa;
59717 +       int i, j;
59718 +
59719 +       /* Setup outbound memory windows */
59720 +       for (i = j = 0; i < 3; i++) {
59721 +               struct resource *res = &hose->mem_resources[i];
59722 +
59723 +               /* we only care about memory windows */
59724 +               if (!(res->flags & IORESOURCE_MEM))
59725 +                       continue;
59726 +               if (j > 1) {
59727 +                       printk(KERN_WARNING "%s: Too many ranges\n",
59728 +                              port->node->full_name);
59729 +                       break;
59730 +               }
59731 +
59732 +               /* Calculate register values */
59733 +               lah = RES_TO_U32_HIGH(res->start);
59734 +               lal = RES_TO_U32_LOW(res->start);
59735 +               pciah = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
59736 +               pcial = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
59737 +               sa = res->end + 1 - res->start;
59738 +               if (!is_power_of_2(sa) || sa < 0x100000 ||
59739 +                   sa > 0xffffffffu) {
59740 +                       printk(KERN_WARNING "%s: Resource out of range\n",
59741 +                              port->node->full_name);
59742 +                       continue;
59743 +               }
59744 +               sa = (0xffffffffu << ilog2(sa)) | 0x1;
59745 +
59746 +               /* Program register values */
59747 +               switch (j) {
59748 +               case 0:
59749 +                       out_le32(mbase + PECFG_POM0LAH, pciah);
59750 +                       out_le32(mbase + PECFG_POM0LAL, pcial);
59751 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1BAH, lah);
59752 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1BAL, lal);
59753 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKH, 0x7fffffff);
59754 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, sa | 3);
59755 +                       break;
59756 +               case 1:
59757 +                       out_le32(mbase + PECFG_POM1LAH, pciah);
59758 +                       out_le32(mbase + PECFG_POM1LAL, pcial);
59759 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2BAH, lah);
59760 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2BAL, lal);
59761 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2MSKH, 0x7fffffff);
59762 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2MSKL, sa | 3);
59763 +                       break;
59764 +               }
59765 +               j++;
59766 +       }
59767 +
59768 +       /* Configure IO, always 64K starting at 0 */
59769 +       if (hose->io_resource.flags & IORESOURCE_IO) {
59770 +               lah = RES_TO_U32_HIGH(hose->io_base_phys);
59771 +               lal = RES_TO_U32_LOW(hose->io_base_phys);
59772 +               out_le32(mbase + PECFG_POM2LAH, 0);
59773 +               out_le32(mbase + PECFG_POM2LAL, 0);
59774 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3BAH, lah);
59775 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3BAL, lal);
59776 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3MSKH, 0x7fffffff);
59777 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3MSKL, 0xffff0000 | 3);
59778 +       }
59779 +}
59780 +
59781 +static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
59782 +                                              struct pci_controller *hose,
59783 +                                              void __iomem *mbase,
59784 +                                              struct resource *res)
59785 +{
59786 +       resource_size_t size = res->end - res->start + 1;
59787 +       u64 sa;
59788 +
59789 +       /* Calculate window size */
59790 +       sa = (0xffffffffffffffffull << ilog2(size));;
59791 +       if (res->flags & IORESOURCE_PREFETCH)
59792 +               sa |= 0x8;
59793 +
59794 +       out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa));
59795 +       out_le32(mbase + PECFG_BAR0LMPA, RES_TO_U32_LOW(sa));
59796 +
59797 +       /* The setup of the split looks weird to me ... let's see if it works */
59798 +       out_le32(mbase + PECFG_PIM0LAL, 0x00000000);
59799 +       out_le32(mbase + PECFG_PIM0LAH, 0x00000000);
59800 +       out_le32(mbase + PECFG_PIM1LAL, 0x00000000);
59801 +       out_le32(mbase + PECFG_PIM1LAH, 0x00000000);
59802 +       out_le32(mbase + PECFG_PIM01SAH, 0xffff0000);
59803 +       out_le32(mbase + PECFG_PIM01SAL, 0x00000000);
59804 +
59805 +       /* Enable inbound mapping */
59806 +       out_le32(mbase + PECFG_PIMEN, 0x1);
59807 +
59808 +       out_le32(mbase + PCI_BASE_ADDRESS_0, RES_TO_U32_LOW(res->start));
59809 +       out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(res->start));
59810 +
59811 +       /* Enable I/O, Mem, and Busmaster cycles */
59812 +       out_le16(mbase + PCI_COMMAND,
59813 +                in_le16(mbase + PCI_COMMAND) |
59814 +                PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
59815 +}
59816 +
59817 +static void __init ppc4xx_pciex_port_setup_hose(struct ppc4xx_pciex_port *port)
59818 +{
59819 +       struct resource dma_window;
59820 +       struct pci_controller *hose = NULL;
59821 +       const int *bus_range;
59822 +       int primary = 0, busses;
59823 +       void __iomem *mbase = NULL, *cfg_data = NULL;
59824 +
59825 +       /* XXX FIXME: Handle endpoint mode properly */
59826 +       if (port->endpoint) {
59827 +               printk(KERN_WARNING "PCIE%d: Port in endpoint mode !\n",
59828 +                      port->index);
59829 +               return;
59830 +       }
59831 +
59832 +       /* Check if primary bridge */
59833 +       if (of_get_property(port->node, "primary", NULL))
59834 +               primary = 1;
59835 +
59836 +       /* Get bus range if any */
59837 +       bus_range = of_get_property(port->node, "bus-range", NULL);
59838 +
59839 +       /* Allocate the host controller data structure */
59840 +       hose = pcibios_alloc_controller(port->node);
59841 +       if (!hose)
59842 +               goto fail;
59843 +
59844 +       /* We stick the port number in "indirect_type" so the config space
59845 +        * ops can retrieve the port data structure easily
59846 +        */
59847 +       hose->indirect_type = port->index;
59848 +
59849 +       /* Get bus range */
59850 +       hose->first_busno = bus_range ? bus_range[0] : 0x0;
59851 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
59852 +
59853 +       /* Because of how big mapping the config space is (1M per bus), we
59854 +        * limit how many busses we support. In the long run, we could replace
59855 +        * that with something akin to kmap_atomic instead. We set aside 1 bus
59856 +        * for the host itself too.
59857 +        */
59858 +       busses = hose->last_busno - hose->first_busno; /* This is off by 1 */
59859 +       if (busses > MAX_PCIE_BUS_MAPPED) {
59860 +               busses = MAX_PCIE_BUS_MAPPED;
59861 +               hose->last_busno = hose->first_busno + busses;
59862 +       }
59863 +
59864 +       /* We map the external config space in cfg_data and the host config
59865 +        * space in cfg_addr. External space is 1M per bus, internal space
59866 +        * is 4K
59867 +        */
59868 +       cfg_data = ioremap(port->cfg_space.start +
59869 +                                (hose->first_busno + 1) * 0x100000,
59870 +                                busses * 0x100000);
59871 +       mbase = ioremap(port->cfg_space.start + 0x10000000, 0x1000);
59872 +       if (cfg_data == NULL || mbase == NULL) {
59873 +               printk(KERN_ERR "%s: Can't map config space !",
59874 +                      port->node->full_name);
59875 +               goto fail;
59876 +       }
59877 +
59878 +       hose->cfg_data = cfg_data;
59879 +       hose->cfg_addr = mbase;
59880 +
59881 +       pr_debug("PCIE %s, bus %d..%d\n", port->node->full_name,
59882 +                hose->first_busno, hose->last_busno);
59883 +       pr_debug("     config space mapped at: root @0x%p, other @0x%p\n",
59884 +                hose->cfg_addr, hose->cfg_data);
59885 +
59886 +       /* Setup config space */
59887 +       hose->ops = &ppc4xx_pciex_pci_ops;
59888 +       port->hose = hose;
59889 +       mbase = (void __iomem *)hose->cfg_addr;
59890 +
59891 +       /*
59892 +        * Set bus numbers on our root port
59893 +        */
59894 +       out_8(mbase + PCI_PRIMARY_BUS, hose->first_busno);
59895 +       out_8(mbase + PCI_SECONDARY_BUS, hose->first_busno + 1);
59896 +       out_8(mbase + PCI_SUBORDINATE_BUS, hose->last_busno);
59897 +
59898 +       /*
59899 +        * OMRs are already reset, also disable PIMs
59900 +        */
59901 +       out_le32(mbase + PECFG_PIMEN, 0);
59902 +
59903 +       /* Parse outbound mapping resources */
59904 +       pci_process_bridge_OF_ranges(hose, port->node, primary);
59905 +
59906 +       /* Parse inbound mapping resources */
59907 +       if (ppc4xx_parse_dma_ranges(hose, mbase, &dma_window) != 0)
59908 +               goto fail;
59909 +
59910 +       /* Configure outbound ranges POMs */
59911 +       ppc4xx_configure_pciex_POMs(port, hose, mbase);
59912 +
59913 +       /* Configure inbound ranges PIMs */
59914 +       ppc4xx_configure_pciex_PIMs(port, hose, mbase, &dma_window);
59915 +
59916 +       /* The root complex doesn't show up if we don't set some vendor
59917 +        * and device IDs into it. Those are the same bogus one that the
59918 +        * initial code in arch/ppc add. We might want to change that.
59919 +        */
59920 +       out_le16(mbase + 0x200, 0xaaa0 + port->index);
59921 +       out_le16(mbase + 0x202, 0xbed0 + port->index);
59922 +
59923 +       /* Set Class Code to PCI-PCI bridge and Revision Id to 1 */
59924 +       out_le32(mbase + 0x208, 0x06040001);
59925 +
59926 +       printk(KERN_INFO "PCIE%d: successfully set as root-complex\n",
59927 +              port->index);
59928 +       return;
59929 + fail:
59930 +       if (hose)
59931 +               pcibios_free_controller(hose);
59932 +       if (cfg_data)
59933 +               iounmap(cfg_data);
59934 +       if (mbase)
59935 +               iounmap(mbase);
59936 +}
59937 +
59938 +static void __init ppc4xx_probe_pciex_bridge(struct device_node *np)
59939 +{
59940 +       struct ppc4xx_pciex_port *port;
59941 +       const u32 *pval;
59942 +       int portno;
59943 +       unsigned int dcrs;
59944 +
59945 +       /* First, proceed to core initialization as we assume there's
59946 +        * only one PCIe core in the system
59947 +        */
59948 +       if (ppc4xx_pciex_check_core_init(np))
59949 +               return;
59950 +
59951 +       /* Get the port number from the device-tree */
59952 +       pval = of_get_property(np, "port", NULL);
59953 +       if (pval == NULL) {
59954 +               printk(KERN_ERR "PCIE: Can't find port number for %s\n",
59955 +                      np->full_name);
59956 +               return;
59957 +       }
59958 +       portno = *pval;
59959 +       if (portno >= ppc4xx_pciex_port_count) {
59960 +               printk(KERN_ERR "PCIE: port number out of range for %s\n",
59961 +                      np->full_name);
59962 +               return;
59963 +       }
59964 +       port = &ppc4xx_pciex_ports[portno];
59965 +       port->index = portno;
59966 +       port->node = of_node_get(np);
59967 +       pval = of_get_property(np, "sdr-base", NULL);
59968 +       if (pval == NULL) {
59969 +               printk(KERN_ERR "PCIE: missing sdr-base for %s\n",
59970 +                      np->full_name);
59971 +               return;
59972 +       }
59973 +       port->sdr_base = *pval;
59974 +
59975 +       /* XXX Currently, we only support root complex mode */
59976 +       port->endpoint = 0;
59977 +
59978 +       /* Fetch config space registers address */
59979 +       if (of_address_to_resource(np, 0, &port->cfg_space)) {
59980 +               printk(KERN_ERR "%s: Can't get PCI-E config space !",
59981 +                      np->full_name);
59982 +               return;
59983 +       }
59984 +       /* Fetch host bridge internal registers address */
59985 +       if (of_address_to_resource(np, 1, &port->utl_regs)) {
59986 +               printk(KERN_ERR "%s: Can't get UTL register base !",
59987 +                      np->full_name);
59988 +               return;
59989 +       }
59990 +
59991 +       /* Map DCRs */
59992 +       dcrs = dcr_resource_start(np, 0);
59993 +       if (dcrs == 0) {
59994 +               printk(KERN_ERR "%s: Can't get DCR register base !",
59995 +                      np->full_name);
59996 +               return;
59997 +       }
59998 +       port->dcrs = dcr_map(np, dcrs, dcr_resource_len(np, 0));
59999 +
60000 +       /* Initialize the port specific registers */
60001 +       if (ppc4xx_pciex_port_init(port)) {
60002 +               printk(KERN_WARNING "PCIE%d: Port init failed\n", port->index);
60003 +               return;
60004 +       }
60005 +
60006 +       /* Setup the linux hose data structure */
60007 +       ppc4xx_pciex_port_setup_hose(port);
60008 +}
60009 +
60010 +#endif /* CONFIG_PPC4xx_PCI_EXPRESS */
60011 +
60012 +static int __init ppc4xx_pci_find_bridges(void)
60013 +{
60014 +       struct device_node *np;
60015 +
60016 +#ifdef CONFIG_PPC4xx_PCI_EXPRESS
60017 +       for_each_compatible_node(np, NULL, "ibm,plb-pciex")
60018 +               ppc4xx_probe_pciex_bridge(np);
60019 +#endif
60020 +       for_each_compatible_node(np, NULL, "ibm,plb-pcix")
60021 +               ppc4xx_probe_pcix_bridge(np);
60022 +       for_each_compatible_node(np, NULL, "ibm,plb-pci")
60023 +               ppc4xx_probe_pci_bridge(np);
60024 +
60025 +       return 0;
60026 +}
60027 +arch_initcall(ppc4xx_pci_find_bridges);
60028 +
60029 Index: linux-2.6.24.7/arch/powerpc/sysdev/ppc4xx_pci.h
60030 ===================================================================
60031 --- /dev/null
60032 +++ linux-2.6.24.7/arch/powerpc/sysdev/ppc4xx_pci.h
60033 @@ -0,0 +1,369 @@
60034 +/*
60035 + * PCI / PCI-X / PCI-Express support for 4xx parts
60036 + *
60037 + * Copyright 2007 Ben. Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
60038 + *
60039 + * Bits and pieces extracted from arch/ppc support by
60040 + *
60041 + * Matt Porter <mporter@kernel.crashing.org>
60042 + *
60043 + * Copyright 2002-2005 MontaVista Software Inc.
60044 + */
60045 +#ifndef __PPC4XX_PCI_H__
60046 +#define __PPC4XX_PCI_H__
60047 +
60048 +/*
60049 + * 4xx PCI-X bridge register definitions
60050 + */
60051 +#define PCIX0_VENDID           0x000
60052 +#define PCIX0_DEVID            0x002
60053 +#define PCIX0_COMMAND          0x004
60054 +#define PCIX0_STATUS           0x006
60055 +#define PCIX0_REVID            0x008
60056 +#define PCIX0_CLS              0x009
60057 +#define PCIX0_CACHELS          0x00c
60058 +#define PCIX0_LATTIM           0x00d
60059 +#define PCIX0_HDTYPE           0x00e
60060 +#define PCIX0_BIST             0x00f
60061 +#define PCIX0_BAR0L            0x010
60062 +#define PCIX0_BAR0H            0x014
60063 +#define PCIX0_BAR1             0x018
60064 +#define PCIX0_BAR2L            0x01c
60065 +#define PCIX0_BAR2H            0x020
60066 +#define PCIX0_BAR3             0x024
60067 +#define PCIX0_CISPTR           0x028
60068 +#define PCIX0_SBSYSVID         0x02c
60069 +#define PCIX0_SBSYSID          0x02e
60070 +#define PCIX0_EROMBA           0x030
60071 +#define PCIX0_CAP              0x034
60072 +#define PCIX0_RES0             0x035
60073 +#define PCIX0_RES1             0x036
60074 +#define PCIX0_RES2             0x038
60075 +#define PCIX0_INTLN            0x03c
60076 +#define PCIX0_INTPN            0x03d
60077 +#define PCIX0_MINGNT           0x03e
60078 +#define PCIX0_MAXLTNCY         0x03f
60079 +#define PCIX0_BRDGOPT1         0x040
60080 +#define PCIX0_BRDGOPT2         0x044
60081 +#define PCIX0_ERREN            0x050
60082 +#define PCIX0_ERRSTS           0x054
60083 +#define PCIX0_PLBBESR          0x058
60084 +#define PCIX0_PLBBEARL         0x05c
60085 +#define PCIX0_PLBBEARH         0x060
60086 +#define PCIX0_POM0LAL          0x068
60087 +#define PCIX0_POM0LAH          0x06c
60088 +#define PCIX0_POM0SA           0x070
60089 +#define PCIX0_POM0PCIAL                0x074
60090 +#define PCIX0_POM0PCIAH                0x078
60091 +#define PCIX0_POM1LAL          0x07c
60092 +#define PCIX0_POM1LAH          0x080
60093 +#define PCIX0_POM1SA           0x084
60094 +#define PCIX0_POM1PCIAL                0x088
60095 +#define PCIX0_POM1PCIAH                0x08c
60096 +#define PCIX0_POM2SA           0x090
60097 +#define PCIX0_PIM0SAL          0x098
60098 +#define PCIX0_PIM0SA           PCIX0_PIM0SAL
60099 +#define PCIX0_PIM0LAL          0x09c
60100 +#define PCIX0_PIM0LAH          0x0a0
60101 +#define PCIX0_PIM1SA           0x0a4
60102 +#define PCIX0_PIM1LAL          0x0a8
60103 +#define PCIX0_PIM1LAH          0x0ac
60104 +#define PCIX0_PIM2SAL          0x0b0
60105 +#define PCIX0_PIM2SA           PCIX0_PIM2SAL
60106 +#define PCIX0_PIM2LAL          0x0b4
60107 +#define PCIX0_PIM2LAH          0x0b8
60108 +#define PCIX0_OMCAPID          0x0c0
60109 +#define PCIX0_OMNIPTR          0x0c1
60110 +#define PCIX0_OMMC             0x0c2
60111 +#define PCIX0_OMMA             0x0c4
60112 +#define PCIX0_OMMUA            0x0c8
60113 +#define PCIX0_OMMDATA          0x0cc
60114 +#define PCIX0_OMMEOI           0x0ce
60115 +#define PCIX0_PMCAPID          0x0d0
60116 +#define PCIX0_PMNIPTR          0x0d1
60117 +#define PCIX0_PMC              0x0d2
60118 +#define PCIX0_PMCSR            0x0d4
60119 +#define PCIX0_PMCSRBSE         0x0d6
60120 +#define PCIX0_PMDATA           0x0d7
60121 +#define PCIX0_PMSCRR           0x0d8
60122 +#define PCIX0_CAPID            0x0dc
60123 +#define PCIX0_NIPTR            0x0dd
60124 +#define PCIX0_CMD              0x0de
60125 +#define PCIX0_STS              0x0e0
60126 +#define PCIX0_IDR              0x0e4
60127 +#define PCIX0_CID              0x0e8
60128 +#define PCIX0_RID              0x0ec
60129 +#define PCIX0_PIM0SAH          0x0f8
60130 +#define PCIX0_PIM2SAH          0x0fc
60131 +#define PCIX0_MSGIL            0x100
60132 +#define PCIX0_MSGIH            0x104
60133 +#define PCIX0_MSGOL            0x108
60134 +#define PCIX0_MSGOH            0x10c
60135 +#define PCIX0_IM               0x1f8
60136 +
60137 +/*
60138 + * 4xx PCI bridge register definitions
60139 + */
60140 +#define PCIL0_PMM0LA           0x00
60141 +#define PCIL0_PMM0MA           0x04
60142 +#define PCIL0_PMM0PCILA                0x08
60143 +#define PCIL0_PMM0PCIHA                0x0c
60144 +#define PCIL0_PMM1LA           0x10
60145 +#define PCIL0_PMM1MA           0x14
60146 +#define PCIL0_PMM1PCILA                0x18
60147 +#define PCIL0_PMM1PCIHA                0x1c
60148 +#define PCIL0_PMM2LA           0x20
60149 +#define PCIL0_PMM2MA           0x24
60150 +#define PCIL0_PMM2PCILA                0x28
60151 +#define PCIL0_PMM2PCIHA                0x2c
60152 +#define PCIL0_PTM1MS           0x30
60153 +#define PCIL0_PTM1LA           0x34
60154 +#define PCIL0_PTM2MS           0x38
60155 +#define PCIL0_PTM2LA           0x3c
60156 +
60157 +/*
60158 + * 4xx PCIe bridge register definitions
60159 + */
60160 +
60161 +/* DCR offsets */
60162 +#define DCRO_PEGPL_CFGBAH              0x00
60163 +#define DCRO_PEGPL_CFGBAL              0x01
60164 +#define DCRO_PEGPL_CFGMSK              0x02
60165 +#define DCRO_PEGPL_MSGBAH              0x03
60166 +#define DCRO_PEGPL_MSGBAL              0x04
60167 +#define DCRO_PEGPL_MSGMSK              0x05
60168 +#define DCRO_PEGPL_OMR1BAH             0x06
60169 +#define DCRO_PEGPL_OMR1BAL             0x07
60170 +#define DCRO_PEGPL_OMR1MSKH            0x08
60171 +#define DCRO_PEGPL_OMR1MSKL            0x09
60172 +#define DCRO_PEGPL_OMR2BAH             0x0a
60173 +#define DCRO_PEGPL_OMR2BAL             0x0b
60174 +#define DCRO_PEGPL_OMR2MSKH            0x0c
60175 +#define DCRO_PEGPL_OMR2MSKL            0x0d
60176 +#define DCRO_PEGPL_OMR3BAH             0x0e
60177 +#define DCRO_PEGPL_OMR3BAL             0x0f
60178 +#define DCRO_PEGPL_OMR3MSKH            0x10
60179 +#define DCRO_PEGPL_OMR3MSKL            0x11
60180 +#define DCRO_PEGPL_REGBAH              0x12
60181 +#define DCRO_PEGPL_REGBAL              0x13
60182 +#define DCRO_PEGPL_REGMSK              0x14
60183 +#define DCRO_PEGPL_SPECIAL             0x15
60184 +#define DCRO_PEGPL_CFG                 0x16
60185 +#define DCRO_PEGPL_ESR                 0x17
60186 +#define DCRO_PEGPL_EARH                        0x18
60187 +#define DCRO_PEGPL_EARL                        0x19
60188 +#define DCRO_PEGPL_EATR                        0x1a
60189 +
60190 +/* DMER mask */
60191 +#define GPL_DMER_MASK_DISA     0x02000000
60192 +
60193 +/*
60194 + * System DCRs (SDRs)
60195 + */
60196 +#define PESDR0_PLLLCT1                 0x03a0
60197 +#define PESDR0_PLLLCT2                 0x03a1
60198 +#define PESDR0_PLLLCT3                 0x03a2
60199 +
60200 +/*
60201 + * 440SPe additional DCRs
60202 + */
60203 +#define PESDR0_440SPE_UTLSET1          0x0300
60204 +#define PESDR0_440SPE_UTLSET2          0x0301
60205 +#define PESDR0_440SPE_DLPSET           0x0302
60206 +#define PESDR0_440SPE_LOOP             0x0303
60207 +#define PESDR0_440SPE_RCSSET           0x0304
60208 +#define PESDR0_440SPE_RCSSTS           0x0305
60209 +#define PESDR0_440SPE_HSSL0SET1                0x0306
60210 +#define PESDR0_440SPE_HSSL0SET2                0x0307
60211 +#define PESDR0_440SPE_HSSL0STS         0x0308
60212 +#define PESDR0_440SPE_HSSL1SET1                0x0309
60213 +#define PESDR0_440SPE_HSSL1SET2                0x030a
60214 +#define PESDR0_440SPE_HSSL1STS         0x030b
60215 +#define PESDR0_440SPE_HSSL2SET1                0x030c
60216 +#define PESDR0_440SPE_HSSL2SET2                0x030d
60217 +#define PESDR0_440SPE_HSSL2STS         0x030e
60218 +#define PESDR0_440SPE_HSSL3SET1                0x030f
60219 +#define PESDR0_440SPE_HSSL3SET2                0x0310
60220 +#define PESDR0_440SPE_HSSL3STS         0x0311
60221 +#define PESDR0_440SPE_HSSL4SET1                0x0312
60222 +#define PESDR0_440SPE_HSSL4SET2                0x0313
60223 +#define PESDR0_440SPE_HSSL4STS         0x0314
60224 +#define PESDR0_440SPE_HSSL5SET1                0x0315
60225 +#define PESDR0_440SPE_HSSL5SET2                0x0316
60226 +#define PESDR0_440SPE_HSSL5STS         0x0317
60227 +#define PESDR0_440SPE_HSSL6SET1                0x0318
60228 +#define PESDR0_440SPE_HSSL6SET2                0x0319
60229 +#define PESDR0_440SPE_HSSL6STS         0x031a
60230 +#define PESDR0_440SPE_HSSL7SET1                0x031b
60231 +#define PESDR0_440SPE_HSSL7SET2                0x031c
60232 +#define PESDR0_440SPE_HSSL7STS         0x031d
60233 +#define PESDR0_440SPE_HSSCTLSET                0x031e
60234 +#define PESDR0_440SPE_LANE_ABCD                0x031f
60235 +#define PESDR0_440SPE_LANE_EFGH                0x0320
60236 +
60237 +#define PESDR1_440SPE_UTLSET1          0x0340
60238 +#define PESDR1_440SPE_UTLSET2          0x0341
60239 +#define PESDR1_440SPE_DLPSET           0x0342
60240 +#define PESDR1_440SPE_LOOP             0x0343
60241 +#define PESDR1_440SPE_RCSSET           0x0344
60242 +#define PESDR1_440SPE_RCSSTS           0x0345
60243 +#define PESDR1_440SPE_HSSL0SET1                0x0346
60244 +#define PESDR1_440SPE_HSSL0SET2                0x0347
60245 +#define PESDR1_440SPE_HSSL0STS         0x0348
60246 +#define PESDR1_440SPE_HSSL1SET1                0x0349
60247 +#define PESDR1_440SPE_HSSL1SET2                0x034a
60248 +#define PESDR1_440SPE_HSSL1STS         0x034b
60249 +#define PESDR1_440SPE_HSSL2SET1                0x034c
60250 +#define PESDR1_440SPE_HSSL2SET2                0x034d
60251 +#define PESDR1_440SPE_HSSL2STS         0x034e
60252 +#define PESDR1_440SPE_HSSL3SET1                0x034f
60253 +#define PESDR1_440SPE_HSSL3SET2                0x0350
60254 +#define PESDR1_440SPE_HSSL3STS         0x0351
60255 +#define PESDR1_440SPE_HSSCTLSET                0x0352
60256 +#define PESDR1_440SPE_LANE_ABCD                0x0353
60257 +
60258 +#define PESDR2_440SPE_UTLSET1          0x0370
60259 +#define PESDR2_440SPE_UTLSET2          0x0371
60260 +#define PESDR2_440SPE_DLPSET           0x0372
60261 +#define PESDR2_440SPE_LOOP             0x0373
60262 +#define PESDR2_440SPE_RCSSET           0x0374
60263 +#define PESDR2_440SPE_RCSSTS           0x0375
60264 +#define PESDR2_440SPE_HSSL0SET1                0x0376
60265 +#define PESDR2_440SPE_HSSL0SET2                0x0377
60266 +#define PESDR2_440SPE_HSSL0STS         0x0378
60267 +#define PESDR2_440SPE_HSSL1SET1                0x0379
60268 +#define PESDR2_440SPE_HSSL1SET2                0x037a
60269 +#define PESDR2_440SPE_HSSL1STS         0x037b
60270 +#define PESDR2_440SPE_HSSL2SET1                0x037c
60271 +#define PESDR2_440SPE_HSSL2SET2                0x037d
60272 +#define PESDR2_440SPE_HSSL2STS         0x037e
60273 +#define PESDR2_440SPE_HSSL3SET1                0x037f
60274 +#define PESDR2_440SPE_HSSL3SET2                0x0380
60275 +#define PESDR2_440SPE_HSSL3STS         0x0381
60276 +#define PESDR2_440SPE_HSSCTLSET                0x0382
60277 +#define PESDR2_440SPE_LANE_ABCD                0x0383
60278 +
60279 +/*
60280 + * 405EX additional DCRs
60281 + */
60282 +#define PESDR0_405EX_UTLSET1           0x0400
60283 +#define PESDR0_405EX_UTLSET2           0x0401
60284 +#define PESDR0_405EX_DLPSET            0x0402
60285 +#define PESDR0_405EX_LOOP              0x0403
60286 +#define PESDR0_405EX_RCSSET            0x0404
60287 +#define PESDR0_405EX_RCSSTS            0x0405
60288 +#define PESDR0_405EX_PHYSET1           0x0406
60289 +#define PESDR0_405EX_PHYSET2           0x0407
60290 +#define PESDR0_405EX_BIST              0x0408
60291 +#define PESDR0_405EX_LPB               0x040B
60292 +#define PESDR0_405EX_PHYSTA            0x040C
60293 +
60294 +#define PESDR1_405EX_UTLSET1           0x0440
60295 +#define PESDR1_405EX_UTLSET2           0x0441
60296 +#define PESDR1_405EX_DLPSET            0x0442
60297 +#define PESDR1_405EX_LOOP              0x0443
60298 +#define PESDR1_405EX_RCSSET            0x0444
60299 +#define PESDR1_405EX_RCSSTS            0x0445
60300 +#define PESDR1_405EX_PHYSET1           0x0446
60301 +#define PESDR1_405EX_PHYSET2           0x0447
60302 +#define PESDR1_405EX_BIST              0x0448
60303 +#define PESDR1_405EX_LPB               0x044B
60304 +#define PESDR1_405EX_PHYSTA            0x044C
60305 +
60306 +/*
60307 + * Of the above, some are common offsets from the base
60308 + */
60309 +#define PESDRn_UTLSET1                 0x00
60310 +#define PESDRn_UTLSET2                 0x01
60311 +#define PESDRn_DLPSET                  0x02
60312 +#define PESDRn_LOOP                    0x03
60313 +#define PESDRn_RCSSET                  0x04
60314 +#define PESDRn_RCSSTS                  0x05
60315 +
60316 +/* 440spe only */
60317 +#define PESDRn_440SPE_HSSL0SET1                0x06
60318 +#define PESDRn_440SPE_HSSL0SET2                0x07
60319 +#define PESDRn_440SPE_HSSL0STS         0x08
60320 +#define PESDRn_440SPE_HSSL1SET1                0x09
60321 +#define PESDRn_440SPE_HSSL1SET2                0x0a
60322 +#define PESDRn_440SPE_HSSL1STS         0x0b
60323 +#define PESDRn_440SPE_HSSL2SET1                0x0c
60324 +#define PESDRn_440SPE_HSSL2SET2                0x0d
60325 +#define PESDRn_440SPE_HSSL2STS         0x0e
60326 +#define PESDRn_440SPE_HSSL3SET1                0x0f
60327 +#define PESDRn_440SPE_HSSL3SET2                0x10
60328 +#define PESDRn_440SPE_HSSL3STS         0x11
60329 +
60330 +/* 440spe port 0 only */
60331 +#define PESDRn_440SPE_HSSL4SET1                0x12
60332 +#define PESDRn_440SPE_HSSL4SET2                0x13
60333 +#define PESDRn_440SPE_HSSL4STS         0x14
60334 +#define PESDRn_440SPE_HSSL5SET1                0x15
60335 +#define PESDRn_440SPE_HSSL5SET2                0x16
60336 +#define PESDRn_440SPE_HSSL5STS         0x17
60337 +#define PESDRn_440SPE_HSSL6SET1                0x18
60338 +#define PESDRn_440SPE_HSSL6SET2                0x19
60339 +#define PESDRn_440SPE_HSSL6STS         0x1a
60340 +#define PESDRn_440SPE_HSSL7SET1                0x1b
60341 +#define PESDRn_440SPE_HSSL7SET2                0x1c
60342 +#define PESDRn_440SPE_HSSL7STS         0x1d
60343 +
60344 +/* 405ex only */
60345 +#define PESDRn_405EX_PHYSET1           0x06
60346 +#define PESDRn_405EX_PHYSET2           0x07
60347 +#define PESDRn_405EX_PHYSTA            0x0c
60348 +
60349 +/*
60350 + * UTL register offsets
60351 + */
60352 +#define PEUTL_PBCTL            0x00
60353 +#define PEUTL_PBBSZ            0x20
60354 +#define PEUTL_OPDBSZ           0x68
60355 +#define PEUTL_IPHBSZ           0x70
60356 +#define PEUTL_IPDBSZ           0x78
60357 +#define PEUTL_OUTTR            0x90
60358 +#define PEUTL_INTR             0x98
60359 +#define PEUTL_PCTL             0xa0
60360 +#define PEUTL_RCSTA            0xB0
60361 +#define PEUTL_RCIRQEN          0xb8
60362 +
60363 +/*
60364 + * Config space register offsets
60365 + */
60366 +#define PECFG_ECRTCTL          0x074
60367 +
60368 +#define PECFG_BAR0LMPA         0x210
60369 +#define PECFG_BAR0HMPA         0x214
60370 +#define PECFG_BAR1MPA          0x218
60371 +#define PECFG_BAR2LMPA         0x220
60372 +#define PECFG_BAR2HMPA         0x224
60373 +
60374 +#define PECFG_PIMEN            0x33c
60375 +#define PECFG_PIM0LAL          0x340
60376 +#define PECFG_PIM0LAH          0x344
60377 +#define PECFG_PIM1LAL          0x348
60378 +#define PECFG_PIM1LAH          0x34c
60379 +#define PECFG_PIM01SAL         0x350
60380 +#define PECFG_PIM01SAH         0x354
60381 +
60382 +#define PECFG_POM0LAL          0x380
60383 +#define PECFG_POM0LAH          0x384
60384 +#define PECFG_POM1LAL          0x388
60385 +#define PECFG_POM1LAH          0x38c
60386 +#define PECFG_POM2LAL          0x390
60387 +#define PECFG_POM2LAH          0x394
60388 +
60389 +
60390 +enum
60391 +{
60392 +       PTYPE_ENDPOINT          = 0x0,
60393 +       PTYPE_LEGACY_ENDPOINT   = 0x1,
60394 +       PTYPE_ROOT_PORT         = 0x4,
60395 +
60396 +       LNKW_X1                 = 0x1,
60397 +       LNKW_X4                 = 0x4,
60398 +       LNKW_X8                 = 0x8
60399 +};
60400 +
60401 +
60402 +#endif /* __PPC4XX_PCI_H__ */
60403 Index: linux-2.6.24.7/arch/powerpc/sysdev/qe_lib/Kconfig
60404 ===================================================================
60405 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/qe_lib/Kconfig
60406 +++ linux-2.6.24.7/arch/powerpc/sysdev/qe_lib/Kconfig
60407 @@ -4,7 +4,7 @@
60408  
60409  config UCC_SLOW
60410         bool
60411 -       default n
60412 +       default y if SERIAL_QE
60413         help
60414           This option provides qe_lib support to UCC slow
60415           protocols: UART, BISYNC, QMC
60416 Index: linux-2.6.24.7/arch/powerpc/sysdev/qe_lib/qe.c
60417 ===================================================================
60418 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/qe_lib/qe.c
60419 +++ linux-2.6.24.7/arch/powerpc/sysdev/qe_lib/qe.c
60420 @@ -25,6 +25,7 @@
60421  #include <linux/module.h>
60422  #include <linux/delay.h>
60423  #include <linux/ioport.h>
60424 +#include <linux/crc32.h>
60425  #include <asm/irq.h>
60426  #include <asm/page.h>
60427  #include <asm/pgtable.h>
60428 @@ -167,19 +168,20 @@ unsigned int get_brg_clk(void)
60429  
60430  /* Program the BRG to the given sampling rate and multiplier
60431   *
60432 - * @brg: the BRG, 1-16
60433 + * @brg: the BRG, QE_BRG1 - QE_BRG16
60434   * @rate: the desired sampling rate
60435   * @multiplier: corresponds to the value programmed in GUMR_L[RDCR] or
60436   * GUMR_L[TDCR].  E.g., if this BRG is the RX clock, and GUMR_L[RDCR]=01,
60437   * then 'multiplier' should be 8.
60438 - *
60439 - * Also note that the value programmed into the BRGC register must be even.
60440   */
60441 -void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier)
60442 +int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
60443  {
60444         u32 divisor, tempval;
60445         u32 div16 = 0;
60446  
60447 +       if ((brg < QE_BRG1) || (brg > QE_BRG16))
60448 +               return -EINVAL;
60449 +
60450         divisor = get_brg_clk() / (rate * multiplier);
60451  
60452         if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
60453 @@ -196,8 +198,43 @@ void qe_setbrg(unsigned int brg, unsigne
60454         tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
60455                 QE_BRGC_ENABLE | div16;
60456  
60457 -       out_be32(&qe_immr->brg.brgc[brg - 1], tempval);
60458 +       out_be32(&qe_immr->brg.brgc[brg - QE_BRG1], tempval);
60459 +
60460 +       return 0;
60461 +}
60462 +EXPORT_SYMBOL(qe_setbrg);
60463 +
60464 +/* Convert a string to a QE clock source enum
60465 + *
60466 + * This function takes a string, typically from a property in the device
60467 + * tree, and returns the corresponding "enum qe_clock" value.
60468 +*/
60469 +enum qe_clock qe_clock_source(const char *source)
60470 +{
60471 +       unsigned int i;
60472 +
60473 +       if (strcasecmp(source, "none") == 0)
60474 +               return QE_CLK_NONE;
60475 +
60476 +       if (strncasecmp(source, "brg", 3) == 0) {
60477 +               i = simple_strtoul(source + 3, NULL, 10);
60478 +               if ((i >= 1) && (i <= 16))
60479 +                       return (QE_BRG1 - 1) + i;
60480 +               else
60481 +                       return QE_CLK_DUMMY;
60482 +       }
60483 +
60484 +       if (strncasecmp(source, "clk", 3) == 0) {
60485 +               i = simple_strtoul(source + 3, NULL, 10);
60486 +               if ((i >= 1) && (i <= 24))
60487 +                       return (QE_CLK1 - 1) + i;
60488 +               else
60489 +                       return QE_CLK_DUMMY;
60490 +       }
60491 +
60492 +       return QE_CLK_DUMMY;
60493  }
60494 +EXPORT_SYMBOL(qe_clock_source);
60495  
60496  /* Initialize SNUMs (thread serial numbers) according to
60497   * QE Module Control chapter, SNUM table
60498 @@ -358,3 +395,249 @@ void *qe_muram_addr(unsigned long offset
60499         return (void *)&qe_immr->muram[offset];
60500  }
60501  EXPORT_SYMBOL(qe_muram_addr);
60502 +
60503 +/* The maximum number of RISCs we support */
60504 +#define MAX_QE_RISC     2
60505 +
60506 +/* Firmware information stored here for qe_get_firmware_info() */
60507 +static struct qe_firmware_info qe_firmware_info;
60508 +
60509 +/*
60510 + * Set to 1 if QE firmware has been uploaded, and therefore
60511 + * qe_firmware_info contains valid data.
60512 + */
60513 +static int qe_firmware_uploaded;
60514 +
60515 +/*
60516 + * Upload a QE microcode
60517 + *
60518 + * This function is a worker function for qe_upload_firmware().  It does
60519 + * the actual uploading of the microcode.
60520 + */
60521 +static void qe_upload_microcode(const void *base,
60522 +       const struct qe_microcode *ucode)
60523 +{
60524 +       const __be32 *code = base + be32_to_cpu(ucode->code_offset);
60525 +       unsigned int i;
60526 +
60527 +       if (ucode->major || ucode->minor || ucode->revision)
60528 +               printk(KERN_INFO "qe-firmware: "
60529 +                       "uploading microcode '%s' version %u.%u.%u\n",
60530 +                       ucode->id, ucode->major, ucode->minor, ucode->revision);
60531 +       else
60532 +               printk(KERN_INFO "qe-firmware: "
60533 +                       "uploading microcode '%s'\n", ucode->id);
60534 +
60535 +       /* Use auto-increment */
60536 +       out_be32(&qe_immr->iram.iadd, be32_to_cpu(ucode->iram_offset) |
60537 +               QE_IRAM_IADD_AIE | QE_IRAM_IADD_BADDR);
60538 +
60539 +       for (i = 0; i < be32_to_cpu(ucode->count); i++)
60540 +               out_be32(&qe_immr->iram.idata, be32_to_cpu(code[i]));
60541 +}
60542 +
60543 +/*
60544 + * Upload a microcode to the I-RAM at a specific address.
60545 + *
60546 + * See Documentation/powerpc/qe-firmware.txt for information on QE microcode
60547 + * uploading.
60548 + *
60549 + * Currently, only version 1 is supported, so the 'version' field must be
60550 + * set to 1.
60551 + *
60552 + * The SOC model and revision are not validated, they are only displayed for
60553 + * informational purposes.
60554 + *
60555 + * 'calc_size' is the calculated size, in bytes, of the firmware structure and
60556 + * all of the microcode structures, minus the CRC.
60557 + *
60558 + * 'length' is the size that the structure says it is, including the CRC.
60559 + */
60560 +int qe_upload_firmware(const struct qe_firmware *firmware)
60561 +{
60562 +       unsigned int i;
60563 +       unsigned int j;
60564 +       u32 crc;
60565 +       size_t calc_size = sizeof(struct qe_firmware);
60566 +       size_t length;
60567 +       const struct qe_header *hdr;
60568 +
60569 +       if (!firmware) {
60570 +               printk(KERN_ERR "qe-firmware: invalid pointer\n");
60571 +               return -EINVAL;
60572 +       }
60573 +
60574 +       hdr = &firmware->header;
60575 +       length = be32_to_cpu(hdr->length);
60576 +
60577 +       /* Check the magic */
60578 +       if ((hdr->magic[0] != 'Q') || (hdr->magic[1] != 'E') ||
60579 +           (hdr->magic[2] != 'F')) {
60580 +               printk(KERN_ERR "qe-firmware: not a microcode\n");
60581 +               return -EPERM;
60582 +       }
60583 +
60584 +       /* Check the version */
60585 +       if (hdr->version != 1) {
60586 +               printk(KERN_ERR "qe-firmware: unsupported version\n");
60587 +               return -EPERM;
60588 +       }
60589 +
60590 +       /* Validate some of the fields */
60591 +       if ((firmware->count < 1) || (firmware->count >= MAX_QE_RISC)) {
60592 +               printk(KERN_ERR "qe-firmware: invalid data\n");
60593 +               return -EINVAL;
60594 +       }
60595 +
60596 +       /* Validate the length and check if there's a CRC */
60597 +       calc_size += (firmware->count - 1) * sizeof(struct qe_microcode);
60598 +
60599 +       for (i = 0; i < firmware->count; i++)
60600 +               /*
60601 +                * For situations where the second RISC uses the same microcode
60602 +                * as the first, the 'code_offset' and 'count' fields will be
60603 +                * zero, so it's okay to add those.
60604 +                */
60605 +               calc_size += sizeof(__be32) *
60606 +                       be32_to_cpu(firmware->microcode[i].count);
60607 +
60608 +       /* Validate the length */
60609 +       if (length != calc_size + sizeof(__be32)) {
60610 +               printk(KERN_ERR "qe-firmware: invalid length\n");
60611 +               return -EPERM;
60612 +       }
60613 +
60614 +       /* Validate the CRC */
60615 +       crc = be32_to_cpu(*(__be32 *)((void *)firmware + calc_size));
60616 +       if (crc != crc32(0, firmware, calc_size)) {
60617 +               printk(KERN_ERR "qe-firmware: firmware CRC is invalid\n");
60618 +               return -EIO;
60619 +       }
60620 +
60621 +       /*
60622 +        * If the microcode calls for it, split the I-RAM.
60623 +        */
60624 +       if (!firmware->split)
60625 +               setbits16(&qe_immr->cp.cercr, QE_CP_CERCR_CIR);
60626 +
60627 +       if (firmware->soc.model)
60628 +               printk(KERN_INFO
60629 +                       "qe-firmware: firmware '%s' for %u V%u.%u\n",
60630 +                       firmware->id, be16_to_cpu(firmware->soc.model),
60631 +                       firmware->soc.major, firmware->soc.minor);
60632 +       else
60633 +               printk(KERN_INFO "qe-firmware: firmware '%s'\n",
60634 +                       firmware->id);
60635 +
60636 +       /*
60637 +        * The QE only supports one microcode per RISC, so clear out all the
60638 +        * saved microcode information and put in the new.
60639 +        */
60640 +       memset(&qe_firmware_info, 0, sizeof(qe_firmware_info));
60641 +       strcpy(qe_firmware_info.id, firmware->id);
60642 +       qe_firmware_info.extended_modes = firmware->extended_modes;
60643 +       memcpy(qe_firmware_info.vtraps, firmware->vtraps,
60644 +               sizeof(firmware->vtraps));
60645 +
60646 +       /* Loop through each microcode. */
60647 +       for (i = 0; i < firmware->count; i++) {
60648 +               const struct qe_microcode *ucode = &firmware->microcode[i];
60649 +
60650 +               /* Upload a microcode if it's present */
60651 +               if (ucode->code_offset)
60652 +                       qe_upload_microcode(firmware, ucode);
60653 +
60654 +               /* Program the traps for this processor */
60655 +               for (j = 0; j < 16; j++) {
60656 +                       u32 trap = be32_to_cpu(ucode->traps[j]);
60657 +
60658 +                       if (trap)
60659 +                               out_be32(&qe_immr->rsp[i].tibcr[j], trap);
60660 +               }
60661 +
60662 +               /* Enable traps */
60663 +               out_be32(&qe_immr->rsp[i].eccr, be32_to_cpu(ucode->eccr));
60664 +       }
60665 +
60666 +       qe_firmware_uploaded = 1;
60667 +
60668 +       return 0;
60669 +}
60670 +EXPORT_SYMBOL(qe_upload_firmware);
60671 +
60672 +/*
60673 + * Get info on the currently-loaded firmware
60674 + *
60675 + * This function also checks the device tree to see if the boot loader has
60676 + * uploaded a firmware already.
60677 + */
60678 +struct qe_firmware_info *qe_get_firmware_info(void)
60679 +{
60680 +       static int initialized;
60681 +       struct property *prop;
60682 +       struct device_node *qe;
60683 +       struct device_node *fw = NULL;
60684 +       const char *sprop;
60685 +       unsigned int i;
60686 +
60687 +       /*
60688 +        * If we haven't checked yet, and a driver hasn't uploaded a firmware
60689 +        * yet, then check the device tree for information.
60690 +        */
60691 +       if (initialized || qe_firmware_uploaded)
60692 +               return NULL;
60693 +
60694 +       initialized = 1;
60695 +
60696 +       /*
60697 +        * Newer device trees have an "fsl,qe" compatible property for the QE
60698 +        * node, but we still need to support older device trees.
60699 +       */
60700 +       qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
60701 +       if (!qe) {
60702 +               qe = of_find_node_by_type(NULL, "qe");
60703 +               if (!qe)
60704 +                       return NULL;
60705 +       }
60706 +
60707 +       /* Find the 'firmware' child node */
60708 +       for_each_child_of_node(qe, fw) {
60709 +               if (strcmp(fw->name, "firmware") == 0)
60710 +                       break;
60711 +       }
60712 +
60713 +       of_node_put(qe);
60714 +
60715 +       /* Did we find the 'firmware' node? */
60716 +       if (!fw)
60717 +               return NULL;
60718 +
60719 +       qe_firmware_uploaded = 1;
60720 +
60721 +       /* Copy the data into qe_firmware_info*/
60722 +       sprop = of_get_property(fw, "id", NULL);
60723 +       if (sprop)
60724 +               strncpy(qe_firmware_info.id, sprop,
60725 +                       sizeof(qe_firmware_info.id) - 1);
60726 +
60727 +       prop = of_find_property(fw, "extended-modes", NULL);
60728 +       if (prop && (prop->length == sizeof(u64))) {
60729 +               const u64 *iprop = prop->value;
60730 +
60731 +               qe_firmware_info.extended_modes = *iprop;
60732 +       }
60733 +
60734 +       prop = of_find_property(fw, "virtual-traps", NULL);
60735 +       if (prop && (prop->length == 32)) {
60736 +               const u32 *iprop = prop->value;
60737 +
60738 +               for (i = 0; i < ARRAY_SIZE(qe_firmware_info.vtraps); i++)
60739 +                       qe_firmware_info.vtraps[i] = iprop[i];
60740 +       }
60741 +
60742 +       of_node_put(fw);
60743 +
60744 +       return &qe_firmware_info;
60745 +}
60746 +EXPORT_SYMBOL(qe_get_firmware_info);
60747 +
60748 Index: linux-2.6.24.7/arch/powerpc/sysdev/qe_lib/ucc_slow.c
60749 ===================================================================
60750 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/qe_lib/ucc_slow.c
60751 +++ linux-2.6.24.7/arch/powerpc/sysdev/qe_lib/ucc_slow.c
60752 @@ -19,6 +19,7 @@
60753  #include <linux/stddef.h>
60754  #include <linux/interrupt.h>
60755  #include <linux/err.h>
60756 +#include <linux/module.h>
60757  
60758  #include <asm/io.h>
60759  #include <asm/immap_qe.h>
60760 @@ -41,6 +42,7 @@ u32 ucc_slow_get_qe_cr_subblock(int uccs
60761         default: return QE_CR_SUBBLOCK_INVALID;
60762         }
60763  }
60764 +EXPORT_SYMBOL(ucc_slow_get_qe_cr_subblock);
60765  
60766  void ucc_slow_poll_transmitter_now(struct ucc_slow_private * uccs)
60767  {
60768 @@ -56,6 +58,7 @@ void ucc_slow_graceful_stop_tx(struct uc
60769         qe_issue_cmd(QE_GRACEFUL_STOP_TX, id,
60770                          QE_CR_PROTOCOL_UNSPECIFIED, 0);
60771  }
60772 +EXPORT_SYMBOL(ucc_slow_graceful_stop_tx);
60773  
60774  void ucc_slow_stop_tx(struct ucc_slow_private * uccs)
60775  {
60776 @@ -65,6 +68,7 @@ void ucc_slow_stop_tx(struct ucc_slow_pr
60777         id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
60778         qe_issue_cmd(QE_STOP_TX, id, QE_CR_PROTOCOL_UNSPECIFIED, 0);
60779  }
60780 +EXPORT_SYMBOL(ucc_slow_stop_tx);
60781  
60782  void ucc_slow_restart_tx(struct ucc_slow_private * uccs)
60783  {
60784 @@ -74,6 +78,7 @@ void ucc_slow_restart_tx(struct ucc_slow
60785         id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
60786         qe_issue_cmd(QE_RESTART_TX, id, QE_CR_PROTOCOL_UNSPECIFIED, 0);
60787  }
60788 +EXPORT_SYMBOL(ucc_slow_restart_tx);
60789  
60790  void ucc_slow_enable(struct ucc_slow_private * uccs, enum comm_dir mode)
60791  {
60792 @@ -94,6 +99,7 @@ void ucc_slow_enable(struct ucc_slow_pri
60793         }
60794         out_be32(&us_regs->gumr_l, gumr_l);
60795  }
60796 +EXPORT_SYMBOL(ucc_slow_enable);
60797  
60798  void ucc_slow_disable(struct ucc_slow_private * uccs, enum comm_dir mode)
60799  {
60800 @@ -114,6 +120,7 @@ void ucc_slow_disable(struct ucc_slow_pr
60801         }
60802         out_be32(&us_regs->gumr_l, gumr_l);
60803  }
60804 +EXPORT_SYMBOL(ucc_slow_disable);
60805  
60806  /* Initialize the UCC for Slow operations
60807   *
60808 @@ -347,6 +354,7 @@ int ucc_slow_init(struct ucc_slow_info *
60809         *uccs_ret = uccs;
60810         return 0;
60811  }
60812 +EXPORT_SYMBOL(ucc_slow_init);
60813  
60814  void ucc_slow_free(struct ucc_slow_private * uccs)
60815  {
60816 @@ -366,5 +374,5 @@ void ucc_slow_free(struct ucc_slow_priva
60817  
60818         kfree(uccs);
60819  }
60820 -
60821 +EXPORT_SYMBOL(ucc_slow_free);
60822  
60823 Index: linux-2.6.24.7/arch/powerpc/sysdev/tsi108_dev.c
60824 ===================================================================
60825 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/tsi108_dev.c
60826 +++ linux-2.6.24.7/arch/powerpc/sysdev/tsi108_dev.c
60827 @@ -66,14 +66,12 @@ EXPORT_SYMBOL(get_vir_csrbase);
60828  static int __init tsi108_eth_of_init(void)
60829  {
60830         struct device_node *np;
60831 -       unsigned int i;
60832 +       unsigned int i = 0;
60833         struct platform_device *tsi_eth_dev;
60834         struct resource res;
60835         int ret;
60836  
60837 -       for (np = NULL, i = 0;
60838 -            (np = of_find_compatible_node(np, "network", "tsi108-ethernet")) != NULL;
60839 -            i++) {
60840 +       for_each_compatible_node(np, "network", "tsi108-ethernet") {
60841                 struct resource r[2];
60842                 struct device_node *phy, *mdio;
60843                 hw_info tsi_eth_data;
60844 @@ -98,7 +96,7 @@ static int __init tsi108_eth_of_init(voi
60845                         __FUNCTION__,r[1].name, r[1].start, r[1].end);
60846  
60847                 tsi_eth_dev =
60848 -                   platform_device_register_simple("tsi-ethernet", i, &r[0],
60849 +                   platform_device_register_simple("tsi-ethernet", i++, &r[0],
60850                                                     1);
60851  
60852                 if (IS_ERR(tsi_eth_dev)) {
60853 @@ -154,6 +152,7 @@ static int __init tsi108_eth_of_init(voi
60854  unreg:
60855         platform_device_unregister(tsi_eth_dev);
60856  err:
60857 +       of_node_put(np);
60858         return ret;
60859  }
60860  
60861 Index: linux-2.6.24.7/arch/powerpc/sysdev/uic.c
60862 ===================================================================
60863 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/uic.c
60864 +++ linux-2.6.24.7/arch/powerpc/sysdev/uic.c
60865 @@ -53,21 +53,23 @@ struct uic {
60866  
60867         /* The remapper for this UIC */
60868         struct irq_host *irqhost;
60869 -
60870 -       /* For secondary UICs, the cascade interrupt's irqaction */
60871 -       struct irqaction cascade;
60872  };
60873  
60874  static void uic_unmask_irq(unsigned int virq)
60875  {
60876 +       struct irq_desc *desc = get_irq_desc(virq);
60877         struct uic *uic = get_irq_chip_data(virq);
60878         unsigned int src = uic_irq_to_hw(virq);
60879         unsigned long flags;
60880 -       u32 er;
60881 +       u32 er, sr;
60882  
60883 +       sr = 1 << (31-src);
60884         spin_lock_irqsave(&uic->lock, flags);
60885 +       /* ack level-triggered interrupts here */
60886 +       if (desc->status & IRQ_LEVEL)
60887 +               mtdcr(uic->dcrbase + UIC_SR, sr);
60888         er = mfdcr(uic->dcrbase + UIC_ER);
60889 -       er |= 1 << (31 - src);
60890 +       er |= sr;
60891         mtdcr(uic->dcrbase + UIC_ER, er);
60892         spin_unlock_irqrestore(&uic->lock, flags);
60893  }
60894 @@ -99,6 +101,7 @@ static void uic_ack_irq(unsigned int vir
60895  
60896  static void uic_mask_ack_irq(unsigned int virq)
60897  {
60898 +       struct irq_desc *desc = get_irq_desc(virq);
60899         struct uic *uic = get_irq_chip_data(virq);
60900         unsigned int src = uic_irq_to_hw(virq);
60901         unsigned long flags;
60902 @@ -109,7 +112,16 @@ static void uic_mask_ack_irq(unsigned in
60903         er = mfdcr(uic->dcrbase + UIC_ER);
60904         er &= ~sr;
60905         mtdcr(uic->dcrbase + UIC_ER, er);
60906 -       mtdcr(uic->dcrbase + UIC_SR, sr);
60907 +       /* On the UIC, acking (i.e. clearing the SR bit)
60908 +        * a level irq will have no effect if the interrupt
60909 +        * is still asserted by the device, even if
60910 +        * the interrupt is already masked. Therefore
60911 +        * we only ack the egde interrupts here, while
60912 +        * level interrupts are ack'ed after the actual
60913 +        * isr call in the uic_unmask_irq()
60914 +        */
60915 +       if (!(desc->status & IRQ_LEVEL))
60916 +               mtdcr(uic->dcrbase + UIC_SR, sr);
60917         spin_unlock_irqrestore(&uic->lock, flags);
60918  }
60919  
60920 @@ -173,64 +185,6 @@ static struct irq_chip uic_irq_chip = {
60921         .set_type       = uic_set_irq_type,
60922  };
60923  
60924 -/**
60925 - *     handle_uic_irq - irq flow handler for UIC
60926 - *     @irq:   the interrupt number
60927 - *     @desc:  the interrupt description structure for this irq
60928 - *
60929 - * This is modified version of the generic handle_level_irq() suitable
60930 - * for the UIC.  On the UIC, acking (i.e. clearing the SR bit) a level
60931 - * irq will have no effect if the interrupt is still asserted by the
60932 - * device, even if the interrupt is already masked.  Therefore, unlike
60933 - * the standard handle_level_irq(), we must ack the interrupt *after*
60934 - * invoking the ISR (which should have de-asserted the interrupt in
60935 - * the external source).  For edge interrupts we ack at the beginning
60936 - * instead of the end, to keep the window in which we can miss an
60937 - * interrupt as small as possible.
60938 - */
60939 -void fastcall handle_uic_irq(unsigned int irq, struct irq_desc *desc)
60940 -{
60941 -       unsigned int cpu = smp_processor_id();
60942 -       struct irqaction *action;
60943 -       irqreturn_t action_ret;
60944 -
60945 -       spin_lock(&desc->lock);
60946 -       if (desc->status & IRQ_LEVEL)
60947 -               desc->chip->mask(irq);
60948 -       else
60949 -               desc->chip->mask_ack(irq);
60950 -
60951 -       if (unlikely(desc->status & IRQ_INPROGRESS))
60952 -               goto out_unlock;
60953 -       desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
60954 -       kstat_cpu(cpu).irqs[irq]++;
60955 -
60956 -       /*
60957 -        * If its disabled or no action available
60958 -        * keep it masked and get out of here
60959 -        */
60960 -       action = desc->action;
60961 -       if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
60962 -               desc->status |= IRQ_PENDING;
60963 -               goto out_unlock;
60964 -       }
60965 -
60966 -       desc->status |= IRQ_INPROGRESS;
60967 -       desc->status &= ~IRQ_PENDING;
60968 -       spin_unlock(&desc->lock);
60969 -
60970 -       action_ret = handle_IRQ_event(irq, action);
60971 -
60972 -       spin_lock(&desc->lock);
60973 -       desc->status &= ~IRQ_INPROGRESS;
60974 -       if (desc->status & IRQ_LEVEL)
60975 -               desc->chip->ack(irq);
60976 -       if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
60977 -               desc->chip->unmask(irq);
60978 -out_unlock:
60979 -       spin_unlock(&desc->lock);
60980 -}
60981 -
60982  static int uic_host_map(struct irq_host *h, unsigned int virq,
60983                         irq_hw_number_t hw)
60984  {
60985 @@ -239,7 +193,7 @@ static int uic_host_map(struct irq_host 
60986         set_irq_chip_data(virq, uic);
60987         /* Despite the name, handle_level_irq() works for both level
60988          * and edge irqs on UIC.  FIXME: check this is correct */
60989 -       set_irq_chip_and_handler(virq, &uic_irq_chip, handle_uic_irq);
60990 +       set_irq_chip_and_handler(virq, &uic_irq_chip, handle_level_irq);
60991  
60992         /* Set default irq type */
60993         set_irq_type(virq, IRQ_TYPE_NONE);
60994 @@ -264,23 +218,36 @@ static struct irq_host_ops uic_host_ops 
60995         .xlate  = uic_host_xlate,
60996  };
60997  
60998 -irqreturn_t uic_cascade(int virq, void *data)
60999 +void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
61000  {
61001 -       struct uic *uic = data;
61002 +       struct uic *uic = get_irq_data(virq);
61003         u32 msr;
61004         int src;
61005         int subvirq;
61006  
61007 +       spin_lock(&desc->lock);
61008 +       if (desc->status & IRQ_LEVEL)
61009 +               desc->chip->mask(virq);
61010 +       else
61011 +               desc->chip->mask_ack(virq);
61012 +       spin_unlock(&desc->lock);
61013 +
61014         msr = mfdcr(uic->dcrbase + UIC_MSR);
61015         if (!msr) /* spurious interrupt */
61016 -               return IRQ_HANDLED;
61017 +               goto uic_irq_ret;
61018  
61019         src = 32 - ffs(msr);
61020  
61021         subvirq = irq_linear_revmap(uic->irqhost, src);
61022         generic_handle_irq(subvirq);
61023  
61024 -       return IRQ_HANDLED;
61025 +uic_irq_ret:
61026 +       spin_lock(&desc->lock);
61027 +       if (desc->status & IRQ_LEVEL)
61028 +               desc->chip->ack(virq);
61029 +       if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
61030 +               desc->chip->unmask(virq);
61031 +       spin_unlock(&desc->lock);
61032  }
61033  
61034  static struct uic * __init uic_init_one(struct device_node *node)
61035 @@ -342,33 +309,27 @@ void __init uic_init_tree(void)
61036         const u32 *interrupts;
61037  
61038         /* First locate and initialize the top-level UIC */
61039 -
61040 -       np = of_find_compatible_node(NULL, NULL, "ibm,uic");
61041 -       while (np) {
61042 +       for_each_compatible_node(np, NULL, "ibm,uic") {
61043                 interrupts = of_get_property(np, "interrupts", NULL);
61044 -               if (! interrupts)
61045 +               if (!interrupts)
61046                         break;
61047 -
61048 -               np = of_find_compatible_node(np, NULL, "ibm,uic");
61049         }
61050  
61051         BUG_ON(!np); /* uic_init_tree() assumes there's a UIC as the
61052                       * top-level interrupt controller */
61053         primary_uic = uic_init_one(np);
61054 -       if (! primary_uic)
61055 +       if (!primary_uic)
61056                 panic("Unable to initialize primary UIC %s\n", np->full_name);
61057  
61058         irq_set_default_host(primary_uic->irqhost);
61059         of_node_put(np);
61060  
61061         /* The scan again for cascaded UICs */
61062 -       np = of_find_compatible_node(NULL, NULL, "ibm,uic");
61063 -       while (np) {
61064 +       for_each_compatible_node(np, NULL, "ibm,uic") {
61065                 interrupts = of_get_property(np, "interrupts", NULL);
61066                 if (interrupts) {
61067                         /* Secondary UIC */
61068                         int cascade_virq;
61069 -                       int ret;
61070  
61071                         uic = uic_init_one(np);
61072                         if (! uic)
61073 @@ -377,20 +338,11 @@ void __init uic_init_tree(void)
61074  
61075                         cascade_virq = irq_of_parse_and_map(np, 0);
61076  
61077 -                       uic->cascade.handler = uic_cascade;
61078 -                       uic->cascade.name = "UIC cascade";
61079 -                       uic->cascade.dev_id = uic;
61080 -
61081 -                       ret = setup_irq(cascade_virq, &uic->cascade);
61082 -                       if (ret)
61083 -                               printk(KERN_ERR "Failed to setup_irq(%d) for "
61084 -                                      "UIC%d cascade\n", cascade_virq,
61085 -                                      uic->index);
61086 +                       set_irq_data(cascade_virq, uic);
61087 +                       set_irq_chained_handler(cascade_virq, uic_irq_cascade);
61088  
61089                         /* FIXME: setup critical cascade?? */
61090                 }
61091 -
61092 -               np = of_find_compatible_node(np, NULL, "ibm,uic");
61093         }
61094  }
61095  
61096 Index: linux-2.6.24.7/arch/powerpc/sysdev/xilinx_intc.c
61097 ===================================================================
61098 --- linux-2.6.24.7.orig/arch/powerpc/sysdev/xilinx_intc.c
61099 +++ linux-2.6.24.7/arch/powerpc/sysdev/xilinx_intc.c
61100 @@ -135,10 +135,16 @@ void __init xilinx_intc_init_tree(void)
61101         struct device_node *np;
61102  
61103         /* find top level interrupt controller */
61104 -       for_each_compatible_node(np, NULL, "xilinx,intc") {
61105 +       for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") {
61106                 if (!of_get_property(np, "interrupts", NULL))
61107                         break;
61108         }
61109 +       if (!np) {
61110 +               for_each_compatible_node(np, NULL, "xlnx,xps-intc-1.00.a") {
61111 +                       if (!of_get_property(np, "interrupts", NULL))
61112 +                               break;
61113 +               }
61114 +       }
61115  
61116         /* xilinx interrupt controller needs to be top level */
61117         BUG_ON(!np);
61118 Index: linux-2.6.24.7/arch/powerpc/xmon/setjmp.S
61119 ===================================================================
61120 --- linux-2.6.24.7.orig/arch/powerpc/xmon/setjmp.S
61121 +++ linux-2.6.24.7/arch/powerpc/xmon/setjmp.S
61122 @@ -12,67 +12,6 @@
61123  #include <asm/ppc_asm.h>
61124  #include <asm/asm-offsets.h>
61125  
61126 -_GLOBAL(xmon_setjmp)
61127 -       mflr    r0
61128 -       PPC_STL r0,0(r3)
61129 -       PPC_STL r1,SZL(r3)
61130 -       PPC_STL r2,2*SZL(r3)
61131 -       mfcr    r0
61132 -       PPC_STL r0,3*SZL(r3)
61133 -       PPC_STL r13,4*SZL(r3)
61134 -       PPC_STL r14,5*SZL(r3)
61135 -       PPC_STL r15,6*SZL(r3)
61136 -       PPC_STL r16,7*SZL(r3)
61137 -       PPC_STL r17,8*SZL(r3)
61138 -       PPC_STL r18,9*SZL(r3)
61139 -       PPC_STL r19,10*SZL(r3)
61140 -       PPC_STL r20,11*SZL(r3)
61141 -       PPC_STL r21,12*SZL(r3)
61142 -       PPC_STL r22,13*SZL(r3)
61143 -       PPC_STL r23,14*SZL(r3)
61144 -       PPC_STL r24,15*SZL(r3)
61145 -       PPC_STL r25,16*SZL(r3)
61146 -       PPC_STL r26,17*SZL(r3)
61147 -       PPC_STL r27,18*SZL(r3)
61148 -       PPC_STL r28,19*SZL(r3)
61149 -       PPC_STL r29,20*SZL(r3)
61150 -       PPC_STL r30,21*SZL(r3)
61151 -       PPC_STL r31,22*SZL(r3)
61152 -       li      r3,0
61153 -       blr
61154 -
61155 -_GLOBAL(xmon_longjmp)
61156 -       PPC_LCMPI r4,0
61157 -       bne     1f
61158 -       li      r4,1
61159 -1:     PPC_LL  r13,4*SZL(r3)
61160 -       PPC_LL  r14,5*SZL(r3)
61161 -       PPC_LL  r15,6*SZL(r3)
61162 -       PPC_LL  r16,7*SZL(r3)
61163 -       PPC_LL  r17,8*SZL(r3)
61164 -       PPC_LL  r18,9*SZL(r3)
61165 -       PPC_LL  r19,10*SZL(r3)
61166 -       PPC_LL  r20,11*SZL(r3)
61167 -       PPC_LL  r21,12*SZL(r3)
61168 -       PPC_LL  r22,13*SZL(r3)
61169 -       PPC_LL  r23,14*SZL(r3)
61170 -       PPC_LL  r24,15*SZL(r3)
61171 -       PPC_LL  r25,16*SZL(r3)
61172 -       PPC_LL  r26,17*SZL(r3)
61173 -       PPC_LL  r27,18*SZL(r3)
61174 -       PPC_LL  r28,19*SZL(r3)
61175 -       PPC_LL  r29,20*SZL(r3)
61176 -       PPC_LL  r30,21*SZL(r3)
61177 -       PPC_LL  r31,22*SZL(r3)
61178 -       PPC_LL  r0,3*SZL(r3)
61179 -       mtcrf   0x38,r0
61180 -       PPC_LL  r0,0(r3)
61181 -       PPC_LL  r1,SZL(r3)
61182 -       PPC_LL  r2,2*SZL(r3)
61183 -       mtlr    r0
61184 -       mr      r3,r4
61185 -       blr
61186 -
61187  /*
61188   * Grab the register values as they are now.
61189   * This won't do a particularily good job because we really
61190 Index: linux-2.6.24.7/arch/powerpc/xmon/xmon.c
61191 ===================================================================
61192 --- linux-2.6.24.7.orig/arch/powerpc/xmon/xmon.c
61193 +++ linux-2.6.24.7/arch/powerpc/xmon/xmon.c
61194 @@ -40,6 +40,7 @@
61195  #include <asm/spu.h>
61196  #include <asm/spu_priv1.h>
61197  #include <asm/firmware.h>
61198 +#include <asm/setjmp.h>
61199  
61200  #ifdef CONFIG_PPC64
61201  #include <asm/hvcall.h>
61202 @@ -71,12 +72,9 @@ static unsigned long ncsum = 4096;
61203  static int termch;
61204  static char tmpstr[128];
61205  
61206 -#define JMP_BUF_LEN    23
61207  static long bus_error_jmp[JMP_BUF_LEN];
61208  static int catch_memory_errors;
61209  static long *xmon_fault_jmp[NR_CPUS];
61210 -#define setjmp xmon_setjmp
61211 -#define longjmp xmon_longjmp
61212  
61213  /* Breakpoint stuff */
61214  struct bpt {
61215 @@ -153,13 +151,15 @@ static const char *getvecname(unsigned l
61216  
61217  static int do_spu_cmd(void);
61218  
61219 +#ifdef CONFIG_44x
61220 +static void dump_tlb_44x(void);
61221 +#endif
61222 +
61223  int xmon_no_auto_backtrace;
61224  
61225  extern void xmon_enter(void);
61226  extern void xmon_leave(void);
61227  
61228 -extern long setjmp(long *);
61229 -extern void longjmp(long *, long);
61230  extern void xmon_save_regs(struct pt_regs *);
61231  
61232  #ifdef CONFIG_PPC64
61233 @@ -231,6 +231,9 @@ Commands:\n\
61234  #ifdef CONFIG_PPC_STD_MMU_32
61235  "  u   dump segment registers\n"
61236  #endif
61237 +#ifdef CONFIG_44x
61238 +"  u   dump TLB\n"
61239 +#endif
61240  "  ?   help\n"
61241  "  zr  reboot\n\
61242    zh   halt\n"
61243 @@ -856,6 +859,11 @@ cmds(struct pt_regs *excp)
61244                         dump_segments();
61245                         break;
61246  #endif
61247 +#ifdef CONFIG_4xx
61248 +               case 'u':
61249 +                       dump_tlb_44x();
61250 +                       break;
61251 +#endif
61252                 default:
61253                         printf("Unrecognized command: ");
61254                         do {
61255 @@ -2527,16 +2535,33 @@ static void xmon_print_symbol(unsigned l
61256  static void dump_slb(void)
61257  {
61258         int i;
61259 -       unsigned long tmp;
61260 +       unsigned long esid,vsid,valid;
61261 +       unsigned long llp;
61262  
61263         printf("SLB contents of cpu %x\n", smp_processor_id());
61264  
61265 -       for (i = 0; i < SLB_NUM_ENTRIES; i++) {
61266 -               asm volatile("slbmfee  %0,%1" : "=r" (tmp) : "r" (i));
61267 -               printf("%02d %016lx ", i, tmp);
61268 -
61269 -               asm volatile("slbmfev  %0,%1" : "=r" (tmp) : "r" (i));
61270 -               printf("%016lx\n", tmp);
61271 +       for (i = 0; i < mmu_slb_size; i++) {
61272 +               asm volatile("slbmfee  %0,%1" : "=r" (esid) : "r" (i));
61273 +               asm volatile("slbmfev  %0,%1" : "=r" (vsid) : "r" (i));
61274 +               valid = (esid & SLB_ESID_V);
61275 +               if (valid | esid | vsid) {
61276 +                       printf("%02d %016lx %016lx", i, esid, vsid);
61277 +                       if (valid) {
61278 +                               llp = vsid & SLB_VSID_LLP;
61279 +                               if (vsid & SLB_VSID_B_1T) {
61280 +                                       printf("  1T  ESID=%9lx  VSID=%13lx LLP:%3lx \n",
61281 +                                               GET_ESID_1T(esid),
61282 +                                               (vsid & ~SLB_VSID_B) >> SLB_VSID_SHIFT_1T,
61283 +                                               llp);
61284 +                               } else {
61285 +                                       printf(" 256M ESID=%9lx  VSID=%13lx LLP:%3lx \n",
61286 +                                               GET_ESID(esid),
61287 +                                               (vsid & ~SLB_VSID_B) >> SLB_VSID_SHIFT,
61288 +                                               llp);
61289 +                               }
61290 +                       } else
61291 +                               printf("\n");
61292 +               }
61293         }
61294  }
61295  
61296 @@ -2581,6 +2606,32 @@ void dump_segments(void)
61297  }
61298  #endif
61299  
61300 +#ifdef CONFIG_44x
61301 +static void dump_tlb_44x(void)
61302 +{
61303 +       int i;
61304 +
61305 +       for (i = 0; i < PPC44x_TLB_SIZE; i++) {
61306 +               unsigned long w0,w1,w2;
61307 +               asm volatile("tlbre  %0,%1,0" : "=r" (w0) : "r" (i));
61308 +               asm volatile("tlbre  %0,%1,1" : "=r" (w1) : "r" (i));
61309 +               asm volatile("tlbre  %0,%1,2" : "=r" (w2) : "r" (i));
61310 +               printf("[%02x] %08x %08x %08x ", i, w0, w1, w2);
61311 +               if (w0 & PPC44x_TLB_VALID) {
61312 +                       printf("V %08x -> %01x%08x %c%c%c%c%c",
61313 +                              w0 & PPC44x_TLB_EPN_MASK,
61314 +                              w1 & PPC44x_TLB_ERPN_MASK,
61315 +                              w1 & PPC44x_TLB_RPN_MASK,
61316 +                              (w2 & PPC44x_TLB_W) ? 'W' : 'w',
61317 +                              (w2 & PPC44x_TLB_I) ? 'I' : 'i',
61318 +                              (w2 & PPC44x_TLB_M) ? 'M' : 'm',
61319 +                              (w2 & PPC44x_TLB_G) ? 'G' : 'g',
61320 +                              (w2 & PPC44x_TLB_E) ? 'E' : 'e');
61321 +               }
61322 +               printf("\n");
61323 +       }
61324 +}
61325 +#endif /* CONFIG_44x */
61326  void xmon_init(int enable)
61327  {
61328  #ifdef CONFIG_PPC_ISERIES
61329 Index: linux-2.6.24.7/arch/ppc/kernel/Makefile
61330 ===================================================================
61331 --- linux-2.6.24.7.orig/arch/ppc/kernel/Makefile
61332 +++ linux-2.6.24.7/arch/ppc/kernel/Makefile
61333 @@ -13,7 +13,6 @@ obj-y                         := entry.o traps.o time.o misc.
61334                                         ppc_htab.o
61335  obj-$(CONFIG_MODULES)          += ppc_ksyms.o
61336  obj-$(CONFIG_PCI)              += pci.o
61337 -obj-$(CONFIG_RAPIDIO)          += rio.o
61338  obj-$(CONFIG_KGDB)             += ppc-stub.o
61339  obj-$(CONFIG_SMP)              += smp.o smp-tbsync.o
61340  obj-$(CONFIG_KEXEC)            += machine_kexec.o relocate_kernel.o
61341 Index: linux-2.6.24.7/arch/ppc/kernel/head_44x.S
61342 ===================================================================
61343 --- linux-2.6.24.7.orig/arch/ppc/kernel/head_44x.S
61344 +++ linux-2.6.24.7/arch/ppc/kernel/head_44x.S
61345 @@ -195,7 +195,7 @@ skpinv:     addi    r4,r4,1                         /* Increment */
61346         li      r5,0
61347         ori     r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G)
61348  
61349 -        li      r0,0                    /* TLB slot 0 */
61350 +       li      r0,62                   /* TLB slot 62 */
61351  
61352         tlbwe   r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
61353         tlbwe   r4,r0,PPC44x_TLB_XLAT   /* Load the translation fields */
61354 Index: linux-2.6.24.7/arch/ppc/kernel/rio.c
61355 ===================================================================
61356 --- linux-2.6.24.7.orig/arch/ppc/kernel/rio.c
61357 +++ /dev/null
61358 @@ -1,52 +0,0 @@
61359 -/*
61360 - * RapidIO PPC32 support
61361 - *
61362 - * Copyright 2005 MontaVista Software, Inc.
61363 - * Matt Porter <mporter@kernel.crashing.org>
61364 - *
61365 - * This program is free software; you can redistribute  it and/or modify it
61366 - * under  the terms of  the GNU General  Public License as published by the
61367 - * Free Software Foundation;  either version 2 of the  License, or (at your
61368 - * option) any later version.
61369 - */
61370 -
61371 -#include <linux/init.h>
61372 -#include <linux/kernel.h>
61373 -#include <linux/rio.h>
61374 -
61375 -#include <asm/rio.h>
61376 -
61377 -/**
61378 - * platform_rio_init - Do platform specific RIO init
61379 - *
61380 - * Any platform specific initialization of RapdIO
61381 - * hardware is done here as well as registration
61382 - * of any active master ports in the system.
61383 - */
61384 -void __attribute__ ((weak))
61385 -    platform_rio_init(void)
61386 -{
61387 -       printk(KERN_WARNING "RIO: No platform_rio_init() present\n");
61388 -}
61389 -
61390 -/**
61391 - * ppc_rio_init - Do PPC32 RIO init
61392 - *
61393 - * Calls platform-specific RIO init code and then calls
61394 - * rio_init_mports() to initialize any master ports that
61395 - * have been registered with the RIO subsystem.
61396 - */
61397 -static int __init ppc_rio_init(void)
61398 -{
61399 -       printk(KERN_INFO "RIO: RapidIO init\n");
61400 -
61401 -       /* Platform specific initialization */
61402 -       platform_rio_init();
61403 -
61404 -       /* Enumerate all registered ports */
61405 -       rio_init_mports();
61406 -
61407 -       return 0;
61408 -}
61409 -
61410 -subsys_initcall(ppc_rio_init);
61411 Index: linux-2.6.24.7/arch/ppc/kernel/setup.c
61412 ===================================================================
61413 --- linux-2.6.24.7.orig/arch/ppc/kernel/setup.c
61414 +++ linux-2.6.24.7/arch/ppc/kernel/setup.c
61415 @@ -37,7 +37,6 @@
61416  #include <asm/nvram.h>
61417  #include <asm/xmon.h>
61418  #include <asm/ocp.h>
61419 -#include <asm/prom.h>
61420  
61421  #define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \
61422                       defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \
61423 Index: linux-2.6.24.7/arch/ppc/kernel/traps.c
61424 ===================================================================
61425 --- linux-2.6.24.7.orig/arch/ppc/kernel/traps.c
61426 +++ linux-2.6.24.7/arch/ppc/kernel/traps.c
61427 @@ -231,39 +231,25 @@ platform_machine_check(struct pt_regs *r
61428  {
61429  }
61430  
61431 -void machine_check_exception(struct pt_regs *regs)
61432 +#if defined(CONFIG_4xx)
61433 +int machine_check_4xx(struct pt_regs *regs)
61434  {
61435         unsigned long reason = get_mc_reason(regs);
61436  
61437 -       if (user_mode(regs)) {
61438 -               regs->msr |= MSR_RI;
61439 -               _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
61440 -               return;
61441 -       }
61442 -
61443 -#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
61444 -       /* the qspan pci read routines can cause machine checks -- Cort */
61445 -       bad_page_fault(regs, regs->dar, SIGBUS);
61446 -       return;
61447 -#endif
61448 -
61449 -       if (debugger_fault_handler) {
61450 -               debugger_fault_handler(regs);
61451 -               regs->msr |= MSR_RI;
61452 -               return;
61453 -       }
61454 -
61455 -       if (check_io_access(regs))
61456 -               return;
61457 -
61458 -#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
61459         if (reason & ESR_IMCP) {
61460                 printk("Instruction");
61461                 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
61462         } else
61463                 printk("Data");
61464         printk(" machine check in kernel mode.\n");
61465 -#elif defined(CONFIG_440A)
61466 +
61467 +       return 0;
61468 +}
61469 +
61470 +int machine_check_440A(struct pt_regs *regs)
61471 +{
61472 +       unsigned long reason = get_mc_reason(regs);
61473 +
61474         printk("Machine check in kernel mode.\n");
61475         if (reason & ESR_IMCP){
61476                 printk("Instruction Synchronous Machine Check exception\n");
61477 @@ -293,7 +279,13 @@ void machine_check_exception(struct pt_r
61478                 /* Clear MCSR */
61479                 mtspr(SPRN_MCSR, mcsr);
61480         }
61481 -#elif defined (CONFIG_E500)
61482 +       return 0;
61483 +}
61484 +#elif defined(CONFIG_E500)
61485 +int machine_check_e500(struct pt_regs *regs)
61486 +{
61487 +       unsigned long reason = get_mc_reason(regs);
61488 +
61489         printk("Machine check in kernel mode.\n");
61490         printk("Caused by (from MCSR=%lx): ", reason);
61491  
61492 @@ -305,8 +297,6 @@ void machine_check_exception(struct pt_r
61493                 printk("Data Cache Push Parity Error\n");
61494         if (reason & MCSR_DCPERR)
61495                 printk("Data Cache Parity Error\n");
61496 -       if (reason & MCSR_GL_CI)
61497 -               printk("Guarded Load or Cache-Inhibited stwcx.\n");
61498         if (reason & MCSR_BUS_IAERR)
61499                 printk("Bus - Instruction Address Error\n");
61500         if (reason & MCSR_BUS_RAERR)
61501 @@ -318,12 +308,19 @@ void machine_check_exception(struct pt_r
61502         if (reason & MCSR_BUS_RBERR)
61503                 printk("Bus - Read Data Bus Error\n");
61504         if (reason & MCSR_BUS_WBERR)
61505 -               printk("Bus - Write Data Bus Error\n");
61506 +               printk("Bus - Read Data Bus Error\n");
61507         if (reason & MCSR_BUS_IPERR)
61508                 printk("Bus - Instruction Parity Error\n");
61509         if (reason & MCSR_BUS_RPERR)
61510                 printk("Bus - Read Parity Error\n");
61511 -#elif defined (CONFIG_E200)
61512 +
61513 +       return 0;
61514 +}
61515 +#elif defined(CONFIG_E200)
61516 +int machine_check_e200(struct pt_regs *regs)
61517 +{
61518 +       unsigned long reason = get_mc_reason(regs);
61519 +
61520         printk("Machine check in kernel mode.\n");
61521         printk("Caused by (from MCSR=%lx): ", reason);
61522  
61523 @@ -341,7 +338,14 @@ void machine_check_exception(struct pt_r
61524                 printk("Bus - Read Bus Error on data load\n");
61525         if (reason & MCSR_BUS_WRERR)
61526                 printk("Bus - Write Bus Error on buffered store or cache line push\n");
61527 -#else /* !CONFIG_4xx && !CONFIG_E500 && !CONFIG_E200 */
61528 +
61529 +       return 0;
61530 +}
61531 +#else
61532 +int machine_check_generic(struct pt_regs *regs)
61533 +{
61534 +       unsigned long reason = get_mc_reason(regs);
61535 +
61536         printk("Machine check in kernel mode.\n");
61537         printk("Caused by (from SRR1=%lx): ", reason);
61538         switch (reason & 0x601F0000) {
61539 @@ -371,7 +375,39 @@ void machine_check_exception(struct pt_r
61540         default:
61541                 printk("Unknown values in msr\n");
61542         }
61543 -#endif /* CONFIG_4xx */
61544 +       return 0;
61545 +}
61546 +#endif /* everything else */
61547 +
61548 +void machine_check_exception(struct pt_regs *regs)
61549 +{
61550 +       int recover = 0;
61551 +
61552 +       if (cur_cpu_spec->machine_check)
61553 +               recover = cur_cpu_spec->machine_check(regs);
61554 +       if (recover > 0)
61555 +               return;
61556 +
61557 +       if (user_mode(regs)) {
61558 +               regs->msr |= MSR_RI;
61559 +               _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
61560 +               return;
61561 +       }
61562 +
61563 +#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
61564 +       /* the qspan pci read routines can cause machine checks -- Cort */
61565 +       bad_page_fault(regs, regs->dar, SIGBUS);
61566 +       return;
61567 +#endif
61568 +
61569 +       if (debugger_fault_handler) {
61570 +               debugger_fault_handler(regs);
61571 +               regs->msr |= MSR_RI;
61572 +               return;
61573 +       }
61574 +
61575 +       if (check_io_access(regs))
61576 +               return;
61577  
61578         /*
61579          * Optional platform-provided routine to print out
61580 Index: linux-2.6.24.7/arch/ppc/mm/44x_mmu.c
61581 ===================================================================
61582 --- linux-2.6.24.7.orig/arch/ppc/mm/44x_mmu.c
61583 +++ linux-2.6.24.7/arch/ppc/mm/44x_mmu.c
61584 @@ -60,38 +60,28 @@ extern char etext[], _stext[];
61585   * Just needed it declared someplace.
61586   */
61587  unsigned int tlb_44x_index = 0;
61588 -unsigned int tlb_44x_hwater = 62;
61589 +unsigned int tlb_44x_hwater = PPC4XX_TLB_SIZE - 1 - PPC44x_EARLY_TLBS;
61590  int icache_44x_need_flush;
61591  
61592  /*
61593   * "Pins" a 256MB TLB entry in AS0 for kernel lowmem
61594   */
61595 -static void __init
61596 -ppc44x_pin_tlb(int slot, unsigned int virt, unsigned int phys)
61597 +static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys)
61598  {
61599 -       unsigned long attrib = 0;
61600 -
61601 -       __asm__ __volatile__("\
61602 -       clrrwi  %2,%2,10\n\
61603 -       ori     %2,%2,%4\n\
61604 -       clrrwi  %1,%1,10\n\
61605 -       li      %0,0\n\
61606 -       ori     %0,%0,%5\n\
61607 -       tlbwe   %2,%3,%6\n\
61608 -       tlbwe   %1,%3,%7\n\
61609 -       tlbwe   %0,%3,%8"
61610 +       __asm__ __volatile__(
61611 +               "tlbwe  %2,%3,%4\n"
61612 +               "tlbwe  %1,%3,%5\n"
61613 +               "tlbwe  %0,%3,%6\n"
61614         :
61615 -       : "r" (attrib), "r" (phys), "r" (virt), "r" (slot),
61616 -         "i" (PPC44x_TLB_VALID | PPC44x_TLB_256M),
61617 -         "i" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
61618 +       : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
61619 +         "r" (phys),
61620 +         "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M),
61621 +         "r" (tlb_44x_hwater--), /* slot for this TLB entry */
61622           "i" (PPC44x_TLB_PAGEID),
61623           "i" (PPC44x_TLB_XLAT),
61624           "i" (PPC44x_TLB_ATTRIB));
61625  }
61626  
61627 -/*
61628 - * MMU_init_hw does the chip-specific initialization of the MMU hardware.
61629 - */
61630  void __init MMU_init_hw(void)
61631  {
61632         flush_instruction_cache();
61633 @@ -99,22 +89,13 @@ void __init MMU_init_hw(void)
61634  
61635  unsigned long __init mmu_mapin_ram(void)
61636  {
61637 -       unsigned int pinned_tlbs = 1;
61638 -       int i;
61639 -
61640 -       /* Determine number of entries necessary to cover lowmem */
61641 -       pinned_tlbs = (unsigned int)
61642 -               (_ALIGN(total_lowmem, PPC_PIN_SIZE) >> PPC44x_PIN_SHIFT);
61643 -
61644 -       /* Write upper watermark to save location */
61645 -       tlb_44x_hwater = PPC44x_LOW_SLOT - pinned_tlbs;
61646 +       unsigned long addr;
61647  
61648 -       /* If necessary, set additional pinned TLBs */
61649 -       if (pinned_tlbs > 1)
61650 -               for (i = (PPC44x_LOW_SLOT-(pinned_tlbs-1)); i < PPC44x_LOW_SLOT; i++) {
61651 -                       unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC_PIN_SIZE;
61652 -                       ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr);
61653 -               }
61654 +       /* Pin in enough TLBs to cover any lowmem not covered by the
61655 +        * initial 256M mapping established in head_44x.S */
61656 +       for (addr = PPC_PIN_SIZE; addr < total_lowmem;
61657 +            addr += PPC_PIN_SIZE)
61658 +               ppc44x_pin_tlb(addr + PAGE_OFFSET, addr);
61659  
61660         return total_lowmem;
61661  }
61662 Index: linux-2.6.24.7/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
61663 ===================================================================
61664 --- linux-2.6.24.7.orig/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
61665 +++ linux-2.6.24.7/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
61666 @@ -42,8 +42,6 @@
61667  
61668  #include <mm/mmu_decl.h>
61669  
61670 -#include <syslib/ppc85xx_rio.h>
61671 -
61672  #include <platforms/85xx/mpc85xx_ads_common.h>
61673  
61674  #ifndef CONFIG_PCI
61675 @@ -190,6 +188,7 @@ mpc85xx_exclude_device(u_char bus, u_cha
61676  #endif /* CONFIG_PCI */
61677  
61678  #ifdef CONFIG_RAPIDIO
61679 +extern void mpc85xx_rio_setup(int law_start, int law_size);
61680  void platform_rio_init(void)
61681  {
61682         /* 512MB RIO LAW at 0xc0000000 */
61683 Index: linux-2.6.24.7/arch/ppc/platforms/85xx/stx_gp3.c
61684 ===================================================================
61685 --- linux-2.6.24.7.orig/arch/ppc/platforms/85xx/stx_gp3.c
61686 +++ linux-2.6.24.7/arch/ppc/platforms/85xx/stx_gp3.c
61687 @@ -50,12 +50,10 @@
61688  #include <asm/irq.h>
61689  #include <asm/immap_85xx.h>
61690  #include <asm/cpm2.h>
61691 -#include <asm/mpc85xx.h>
61692  #include <asm/ppc_sys.h>
61693  
61694  #include <syslib/cpm2_pic.h>
61695  #include <syslib/ppc85xx_common.h>
61696 -#include <syslib/ppc85xx_rio.h>
61697  
61698  
61699  unsigned char __res[sizeof(bd_t)];
61700 @@ -271,6 +269,7 @@ int mpc85xx_exclude_device(u_char bus, u
61701  #endif /* CONFIG_PCI */
61702  
61703  #ifdef CONFIG_RAPIDIO
61704 +extern void mpc85xx_rio_setup(int law_start, int law_size);
61705  void
61706  platform_rio_init(void)
61707  {
61708 Index: linux-2.6.24.7/arch/ppc/platforms/85xx/tqm85xx.c
61709 ===================================================================
61710 --- linux-2.6.24.7.orig/arch/ppc/platforms/85xx/tqm85xx.c
61711 +++ linux-2.6.24.7/arch/ppc/platforms/85xx/tqm85xx.c
61712 @@ -54,7 +54,6 @@
61713  #include <syslib/ppc85xx_setup.h>
61714  #include <syslib/cpm2_pic.h>
61715  #include <syslib/ppc85xx_common.h>
61716 -#include <syslib/ppc85xx_rio.h>
61717  
61718  #ifndef CONFIG_PCI
61719  unsigned long isa_io_base = 0;
61720 @@ -309,6 +308,7 @@ int mpc85xx_exclude_device(u_char bus, u
61721  #endif /* CONFIG_PCI */
61722  
61723  #ifdef CONFIG_RAPIDIO
61724 +extern void mpc85xx_rio_setup(int law_start, int law_size);
61725  void platform_rio_init(void)
61726  {
61727         /* 512MB RIO LAW at 0xc0000000 */
61728 Index: linux-2.6.24.7/arch/ppc/platforms/ev64260.c
61729 ===================================================================
61730 --- linux-2.6.24.7.orig/arch/ppc/platforms/ev64260.c
61731 +++ linux-2.6.24.7/arch/ppc/platforms/ev64260.c
61732 @@ -336,7 +336,7 @@ ev64260_early_serial_map(void)
61733  #endif
61734  
61735                 if (early_serial_setup(&port) != 0)
61736 -                       printk(KERN_WARNING "Early serial init of port 0"
61737 +                       printk(KERN_WARNING "Early serial init of port 0 "
61738                                 "failed\n");
61739  
61740                 first_time = 0;
61741 @@ -388,7 +388,7 @@ ev64260_setup_arch(void)
61742         ev64260_early_serial_map();
61743  #endif
61744  
61745 -       printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc."
61746 +       printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc. "
61747                 "(source@mvista.com)\n", BOARD_VENDOR, BOARD_MACHINE);
61748  
61749         if (ppc_md.progress)
61750 Index: linux-2.6.24.7/arch/ppc/platforms/prep_pci.c
61751 ===================================================================
61752 --- linux-2.6.24.7.orig/arch/ppc/platforms/prep_pci.c
61753 +++ linux-2.6.24.7/arch/ppc/platforms/prep_pci.c
61754 @@ -1099,7 +1099,6 @@ prep_pib_init(void)
61755                                 pci_write_config_byte(dev, 0x43, reg);
61756                         }
61757                 }
61758 -               pci_dev_put(dev);
61759         }
61760  
61761         if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND,
61762 Index: linux-2.6.24.7/arch/ppc/syslib/Makefile
61763 ===================================================================
61764 --- linux-2.6.24.7.orig/arch/ppc/syslib/Makefile
61765 +++ linux-2.6.24.7/arch/ppc/syslib/Makefile
61766 @@ -93,7 +93,6 @@ obj-$(CONFIG_85xx)            += open_pic.o ppc85x
61767  ifeq ($(CONFIG_85xx),y)
61768  obj-$(CONFIG_PCI)              += pci_auto.o
61769  endif
61770 -obj-$(CONFIG_RAPIDIO)          += ppc85xx_rio.o
61771  obj-$(CONFIG_83xx)             += ppc83xx_setup.o ppc_sys.o \
61772                                         mpc83xx_sys.o mpc83xx_devices.o ipic.o
61773  ifeq ($(CONFIG_83xx),y)
61774 Index: linux-2.6.24.7/arch/ppc/syslib/gt64260_pic.c
61775 ===================================================================
61776 --- linux-2.6.24.7.orig/arch/ppc/syslib/gt64260_pic.c
61777 +++ linux-2.6.24.7/arch/ppc/syslib/gt64260_pic.c
61778 @@ -35,7 +35,6 @@
61779  #include <linux/interrupt.h>
61780  #include <linux/sched.h>
61781  #include <linux/signal.h>
61782 -#include <linux/stddef.h>
61783  #include <linux/delay.h>
61784  #include <linux/irq.h>
61785  
61786 Index: linux-2.6.24.7/arch/ppc/syslib/mpc52xx_pic.c
61787 ===================================================================
61788 --- linux-2.6.24.7.orig/arch/ppc/syslib/mpc52xx_pic.c
61789 +++ linux-2.6.24.7/arch/ppc/syslib/mpc52xx_pic.c
61790 @@ -20,7 +20,6 @@
61791  #include <linux/init.h>
61792  #include <linux/sched.h>
61793  #include <linux/signal.h>
61794 -#include <linux/stddef.h>
61795  #include <linux/delay.h>
61796  #include <linux/irq.h>
61797  
61798 Index: linux-2.6.24.7/arch/ppc/syslib/mv64360_pic.c
61799 ===================================================================
61800 --- linux-2.6.24.7.orig/arch/ppc/syslib/mv64360_pic.c
61801 +++ linux-2.6.24.7/arch/ppc/syslib/mv64360_pic.c
61802 @@ -36,7 +36,6 @@
61803  #include <linux/init.h>
61804  #include <linux/sched.h>
61805  #include <linux/signal.h>
61806 -#include <linux/stddef.h>
61807  #include <linux/delay.h>
61808  #include <linux/irq.h>
61809  #include <linux/interrupt.h>
61810 Index: linux-2.6.24.7/arch/ppc/syslib/ocp.c
61811 ===================================================================
61812 --- linux-2.6.24.7.orig/arch/ppc/syslib/ocp.c
61813 +++ linux-2.6.24.7/arch/ppc/syslib/ocp.c
61814 @@ -376,7 +376,7 @@ ocp_remove_one_device(unsigned int vendo
61815  
61816         down_write(&ocp_devices_sem);
61817         dev = __ocp_find_device(vendor, function, index);
61818 -       list_del((struct list_head *)dev);
61819 +       list_del(&dev->link);
61820         up_write(&ocp_devices_sem);
61821  
61822         DBG(("ocp: ocp_remove_one_device(vendor: %x, function: %x, index: %d)... done.\n", vendor, function, index));
61823 Index: linux-2.6.24.7/arch/ppc/syslib/ppc83xx_setup.c
61824 ===================================================================
61825 --- linux-2.6.24.7.orig/arch/ppc/syslib/ppc83xx_setup.c
61826 +++ linux-2.6.24.7/arch/ppc/syslib/ppc83xx_setup.c
61827 @@ -41,7 +41,6 @@
61828  
61829  #include <syslib/ppc83xx_setup.h>
61830  #if defined(CONFIG_PCI)
61831 -#include <asm/delay.h>
61832  #include <syslib/ppc83xx_pci.h>
61833  #endif
61834  
61835 Index: linux-2.6.24.7/arch/ppc/syslib/ppc85xx_rio.c
61836 ===================================================================
61837 --- linux-2.6.24.7.orig/arch/ppc/syslib/ppc85xx_rio.c
61838 +++ /dev/null
61839 @@ -1,932 +0,0 @@
61840 -/*
61841 - * MPC85xx RapidIO support
61842 - *
61843 - * Copyright 2005 MontaVista Software, Inc.
61844 - * Matt Porter <mporter@kernel.crashing.org>
61845 - *
61846 - * This program is free software; you can redistribute  it and/or modify it
61847 - * under  the terms of  the GNU General  Public License as published by the
61848 - * Free Software Foundation;  either version 2 of the  License, or (at your
61849 - * option) any later version.
61850 - */
61851 -
61852 -#include <linux/init.h>
61853 -#include <linux/module.h>
61854 -#include <linux/types.h>
61855 -#include <linux/dma-mapping.h>
61856 -#include <linux/interrupt.h>
61857 -#include <linux/rio.h>
61858 -#include <linux/rio_drv.h>
61859 -
61860 -#include <asm/io.h>
61861 -
61862 -#define RIO_REGS_BASE          (CCSRBAR + 0xc0000)
61863 -#define RIO_ATMU_REGS_OFFSET   0x10c00
61864 -#define RIO_MSG_REGS_OFFSET    0x11000
61865 -#define RIO_MAINT_WIN_SIZE     0x400000
61866 -#define RIO_DBELL_WIN_SIZE     0x1000
61867 -
61868 -#define RIO_MSG_OMR_MUI                0x00000002
61869 -#define RIO_MSG_OSR_TE         0x00000080
61870 -#define RIO_MSG_OSR_QOI                0x00000020
61871 -#define RIO_MSG_OSR_QFI                0x00000010
61872 -#define RIO_MSG_OSR_MUB                0x00000004
61873 -#define RIO_MSG_OSR_EOMI       0x00000002
61874 -#define RIO_MSG_OSR_QEI                0x00000001
61875 -
61876 -#define RIO_MSG_IMR_MI         0x00000002
61877 -#define RIO_MSG_ISR_TE         0x00000080
61878 -#define RIO_MSG_ISR_QFI                0x00000010
61879 -#define RIO_MSG_ISR_DIQI       0x00000001
61880 -
61881 -#define RIO_MSG_DESC_SIZE      32
61882 -#define RIO_MSG_BUFFER_SIZE    4096
61883 -#define RIO_MIN_TX_RING_SIZE   2
61884 -#define RIO_MAX_TX_RING_SIZE   2048
61885 -#define RIO_MIN_RX_RING_SIZE   2
61886 -#define RIO_MAX_RX_RING_SIZE   2048
61887 -
61888 -#define DOORBELL_DMR_DI                0x00000002
61889 -#define DOORBELL_DSR_TE                0x00000080
61890 -#define DOORBELL_DSR_QFI       0x00000010
61891 -#define DOORBELL_DSR_DIQI      0x00000001
61892 -#define DOORBELL_TID_OFFSET    0x03
61893 -#define DOORBELL_SID_OFFSET    0x05
61894 -#define DOORBELL_INFO_OFFSET   0x06
61895 -
61896 -#define DOORBELL_MESSAGE_SIZE  0x08
61897 -#define DBELL_SID(x)           (*(u8 *)(x + DOORBELL_SID_OFFSET))
61898 -#define DBELL_TID(x)           (*(u8 *)(x + DOORBELL_TID_OFFSET))
61899 -#define DBELL_INF(x)           (*(u16 *)(x + DOORBELL_INFO_OFFSET))
61900 -
61901 -struct rio_atmu_regs {
61902 -       u32 rowtar;
61903 -       u32 pad1;
61904 -       u32 rowbar;
61905 -       u32 pad2;
61906 -       u32 rowar;
61907 -       u32 pad3[3];
61908 -};
61909 -
61910 -struct rio_msg_regs {
61911 -       u32 omr;
61912 -       u32 osr;
61913 -       u32 pad1;
61914 -       u32 odqdpar;
61915 -       u32 pad2;
61916 -       u32 osar;
61917 -       u32 odpr;
61918 -       u32 odatr;
61919 -       u32 odcr;
61920 -       u32 pad3;
61921 -       u32 odqepar;
61922 -       u32 pad4[13];
61923 -       u32 imr;
61924 -       u32 isr;
61925 -       u32 pad5;
61926 -       u32 ifqdpar;
61927 -       u32 pad6;
61928 -       u32 ifqepar;
61929 -       u32 pad7[250];
61930 -       u32 dmr;
61931 -       u32 dsr;
61932 -       u32 pad8;
61933 -       u32 dqdpar;
61934 -       u32 pad9;
61935 -       u32 dqepar;
61936 -       u32 pad10[26];
61937 -       u32 pwmr;
61938 -       u32 pwsr;
61939 -       u32 pad11;
61940 -       u32 pwqbar;
61941 -};
61942 -
61943 -struct rio_tx_desc {
61944 -       u32 res1;
61945 -       u32 saddr;
61946 -       u32 dport;
61947 -       u32 dattr;
61948 -       u32 res2;
61949 -       u32 res3;
61950 -       u32 dwcnt;
61951 -       u32 res4;
61952 -};
61953 -
61954 -static u32 regs_win;
61955 -static struct rio_atmu_regs *atmu_regs;
61956 -static struct rio_atmu_regs *maint_atmu_regs;
61957 -static struct rio_atmu_regs *dbell_atmu_regs;
61958 -static u32 dbell_win;
61959 -static u32 maint_win;
61960 -static struct rio_msg_regs *msg_regs;
61961 -
61962 -static struct rio_dbell_ring {
61963 -       void *virt;
61964 -       dma_addr_t phys;
61965 -} dbell_ring;
61966 -
61967 -static struct rio_msg_tx_ring {
61968 -       void *virt;
61969 -       dma_addr_t phys;
61970 -       void *virt_buffer[RIO_MAX_TX_RING_SIZE];
61971 -       dma_addr_t phys_buffer[RIO_MAX_TX_RING_SIZE];
61972 -       int tx_slot;
61973 -       int size;
61974 -       void *dev_id;
61975 -} msg_tx_ring;
61976 -
61977 -static struct rio_msg_rx_ring {
61978 -       void *virt;
61979 -       dma_addr_t phys;
61980 -       void *virt_buffer[RIO_MAX_RX_RING_SIZE];
61981 -       int rx_slot;
61982 -       int size;
61983 -       void *dev_id;
61984 -} msg_rx_ring;
61985 -
61986 -/**
61987 - * mpc85xx_rio_doorbell_send - Send a MPC85xx doorbell message
61988 - * @index: ID of RapidIO interface
61989 - * @destid: Destination ID of target device
61990 - * @data: 16-bit info field of RapidIO doorbell message
61991 - *
61992 - * Sends a MPC85xx doorbell message. Returns %0 on success or
61993 - * %-EINVAL on failure.
61994 - */
61995 -static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data)
61996 -{
61997 -       pr_debug("mpc85xx_doorbell_send: index %d destid %4.4x data %4.4x\n",
61998 -                index, destid, data);
61999 -       out_be32((void *)&dbell_atmu_regs->rowtar, destid << 22);
62000 -       out_be16((void *)(dbell_win), data);
62001 -
62002 -       return 0;
62003 -}
62004 -
62005 -/**
62006 - * mpc85xx_local_config_read - Generate a MPC85xx local config space read
62007 - * @index: ID of RapdiIO interface
62008 - * @offset: Offset into configuration space
62009 - * @len: Length (in bytes) of the maintenance transaction
62010 - * @data: Value to be read into
62011 - *
62012 - * Generates a MPC85xx local configuration space read. Returns %0 on
62013 - * success or %-EINVAL on failure.
62014 - */
62015 -static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * data)
62016 -{
62017 -       pr_debug("mpc85xx_local_config_read: index %d offset %8.8x\n", index,
62018 -                offset);
62019 -       *data = in_be32((void *)(regs_win + offset));
62020 -
62021 -       return 0;
62022 -}
62023 -
62024 -/**
62025 - * mpc85xx_local_config_write - Generate a MPC85xx local config space write
62026 - * @index: ID of RapdiIO interface
62027 - * @offset: Offset into configuration space
62028 - * @len: Length (in bytes) of the maintenance transaction
62029 - * @data: Value to be written
62030 - *
62031 - * Generates a MPC85xx local configuration space write. Returns %0 on
62032 - * success or %-EINVAL on failure.
62033 - */
62034 -static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data)
62035 -{
62036 -       pr_debug
62037 -           ("mpc85xx_local_config_write: index %d offset %8.8x data %8.8x\n",
62038 -            index, offset, data);
62039 -       out_be32((void *)(regs_win + offset), data);
62040 -
62041 -       return 0;
62042 -}
62043 -
62044 -/**
62045 - * mpc85xx_rio_config_read - Generate a MPC85xx read maintenance transaction
62046 - * @index: ID of RapdiIO interface
62047 - * @destid: Destination ID of transaction
62048 - * @hopcount: Number of hops to target device
62049 - * @offset: Offset into configuration space
62050 - * @len: Length (in bytes) of the maintenance transaction
62051 - * @val: Location to be read into
62052 - *
62053 - * Generates a MPC85xx read maintenance transaction. Returns %0 on
62054 - * success or %-EINVAL on failure.
62055 - */
62056 -static int
62057 -mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len,
62058 -                       u32 * val)
62059 -{
62060 -       u8 *data;
62061 -
62062 -       pr_debug
62063 -           ("mpc85xx_rio_config_read: index %d destid %d hopcount %d offset %8.8x len %d\n",
62064 -            index, destid, hopcount, offset, len);
62065 -       out_be32((void *)&maint_atmu_regs->rowtar,
62066 -                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
62067 -
62068 -       data = (u8 *) maint_win + offset;
62069 -       switch (len) {
62070 -       case 1:
62071 -               *val = in_8((u8 *) data);
62072 -               break;
62073 -       case 2:
62074 -               *val = in_be16((u16 *) data);
62075 -               break;
62076 -       default:
62077 -               *val = in_be32((u32 *) data);
62078 -               break;
62079 -       }
62080 -
62081 -       return 0;
62082 -}
62083 -
62084 -/**
62085 - * mpc85xx_rio_config_write - Generate a MPC85xx write maintenance transaction
62086 - * @index: ID of RapdiIO interface
62087 - * @destid: Destination ID of transaction
62088 - * @hopcount: Number of hops to target device
62089 - * @offset: Offset into configuration space
62090 - * @len: Length (in bytes) of the maintenance transaction
62091 - * @val: Value to be written
62092 - *
62093 - * Generates an MPC85xx write maintenance transaction. Returns %0 on
62094 - * success or %-EINVAL on failure.
62095 - */
62096 -static int
62097 -mpc85xx_rio_config_write(int index, u16 destid, u8 hopcount, u32 offset,
62098 -                        int len, u32 val)
62099 -{
62100 -       u8 *data;
62101 -       pr_debug
62102 -           ("mpc85xx_rio_config_write: index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n",
62103 -            index, destid, hopcount, offset, len, val);
62104 -       out_be32((void *)&maint_atmu_regs->rowtar,
62105 -                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
62106 -
62107 -       data = (u8 *) maint_win + offset;
62108 -       switch (len) {
62109 -       case 1:
62110 -               out_8((u8 *) data, val);
62111 -               break;
62112 -       case 2:
62113 -               out_be16((u16 *) data, val);
62114 -               break;
62115 -       default:
62116 -               out_be32((u32 *) data, val);
62117 -               break;
62118 -       }
62119 -
62120 -       return 0;
62121 -}
62122 -
62123 -/**
62124 - * rio_hw_add_outb_message - Add message to the MPC85xx outbound message queue
62125 - * @mport: Master port with outbound message queue
62126 - * @rdev: Target of outbound message
62127 - * @mbox: Outbound mailbox
62128 - * @buffer: Message to add to outbound queue
62129 - * @len: Length of message
62130 - *
62131 - * Adds the @buffer message to the MPC85xx outbound message queue. Returns
62132 - * %0 on success or %-EINVAL on failure.
62133 - */
62134 -int
62135 -rio_hw_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox,
62136 -                       void *buffer, size_t len)
62137 -{
62138 -       u32 omr;
62139 -       struct rio_tx_desc *desc =
62140 -           (struct rio_tx_desc *)msg_tx_ring.virt + msg_tx_ring.tx_slot;
62141 -       int ret = 0;
62142 -
62143 -       pr_debug
62144 -           ("RIO: rio_hw_add_outb_message(): destid %4.4x mbox %d buffer %8.8x len %8.8x\n",
62145 -            rdev->destid, mbox, (int)buffer, len);
62146 -
62147 -       if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
62148 -               ret = -EINVAL;
62149 -               goto out;
62150 -       }
62151 -
62152 -       /* Copy and clear rest of buffer */
62153 -       memcpy(msg_tx_ring.virt_buffer[msg_tx_ring.tx_slot], buffer, len);
62154 -       if (len < (RIO_MAX_MSG_SIZE - 4))
62155 -               memset((void *)((u32) msg_tx_ring.
62156 -                               virt_buffer[msg_tx_ring.tx_slot] + len), 0,
62157 -                      RIO_MAX_MSG_SIZE - len);
62158 -
62159 -       /* Set mbox field for message */
62160 -       desc->dport = mbox & 0x3;
62161 -
62162 -       /* Enable EOMI interrupt, set priority, and set destid */
62163 -       desc->dattr = 0x28000000 | (rdev->destid << 2);
62164 -
62165 -       /* Set transfer size aligned to next power of 2 (in double words) */
62166 -       desc->dwcnt = is_power_of_2(len) ? len : 1 << get_bitmask_order(len);
62167 -
62168 -       /* Set snooping and source buffer address */
62169 -       desc->saddr = 0x00000004 | msg_tx_ring.phys_buffer[msg_tx_ring.tx_slot];
62170 -
62171 -       /* Increment enqueue pointer */
62172 -       omr = in_be32((void *)&msg_regs->omr);
62173 -       out_be32((void *)&msg_regs->omr, omr | RIO_MSG_OMR_MUI);
62174 -
62175 -       /* Go to next descriptor */
62176 -       if (++msg_tx_ring.tx_slot == msg_tx_ring.size)
62177 -               msg_tx_ring.tx_slot = 0;
62178 -
62179 -      out:
62180 -       return ret;
62181 -}
62182 -
62183 -EXPORT_SYMBOL_GPL(rio_hw_add_outb_message);
62184 -
62185 -/**
62186 - * mpc85xx_rio_tx_handler - MPC85xx outbound message interrupt handler
62187 - * @irq: Linux interrupt number
62188 - * @dev_instance: Pointer to interrupt-specific data
62189 - *
62190 - * Handles outbound message interrupts. Executes a register outbound
62191 - * mailbox event handler and acks the interrupt occurrence.
62192 - */
62193 -static irqreturn_t
62194 -mpc85xx_rio_tx_handler(int irq, void *dev_instance)
62195 -{
62196 -       int osr;
62197 -       struct rio_mport *port = (struct rio_mport *)dev_instance;
62198 -
62199 -       osr = in_be32((void *)&msg_regs->osr);
62200 -
62201 -       if (osr & RIO_MSG_OSR_TE) {
62202 -               pr_info("RIO: outbound message transmission error\n");
62203 -               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_TE);
62204 -               goto out;
62205 -       }
62206 -
62207 -       if (osr & RIO_MSG_OSR_QOI) {
62208 -               pr_info("RIO: outbound message queue overflow\n");
62209 -               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_QOI);
62210 -               goto out;
62211 -       }
62212 -
62213 -       if (osr & RIO_MSG_OSR_EOMI) {
62214 -               u32 dqp = in_be32((void *)&msg_regs->odqdpar);
62215 -               int slot = (dqp - msg_tx_ring.phys) >> 5;
62216 -               port->outb_msg[0].mcback(port, msg_tx_ring.dev_id, -1, slot);
62217 -
62218 -               /* Ack the end-of-message interrupt */
62219 -               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_EOMI);
62220 -       }
62221 -
62222 -      out:
62223 -       return IRQ_HANDLED;
62224 -}
62225 -
62226 -/**
62227 - * rio_open_outb_mbox - Initialize MPC85xx outbound mailbox
62228 - * @mport: Master port implementing the outbound message unit
62229 - * @dev_id: Device specific pointer to pass on event
62230 - * @mbox: Mailbox to open
62231 - * @entries: Number of entries in the outbound mailbox ring
62232 - *
62233 - * Initializes buffer ring, request the outbound message interrupt,
62234 - * and enables the outbound message unit. Returns %0 on success and
62235 - * %-EINVAL or %-ENOMEM on failure.
62236 - */
62237 -int rio_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
62238 -{
62239 -       int i, j, rc = 0;
62240 -
62241 -       if ((entries < RIO_MIN_TX_RING_SIZE) ||
62242 -           (entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
62243 -               rc = -EINVAL;
62244 -               goto out;
62245 -       }
62246 -
62247 -       /* Initialize shadow copy ring */
62248 -       msg_tx_ring.dev_id = dev_id;
62249 -       msg_tx_ring.size = entries;
62250 -
62251 -       for (i = 0; i < msg_tx_ring.size; i++) {
62252 -               if (!
62253 -                   (msg_tx_ring.virt_buffer[i] =
62254 -                    dma_alloc_coherent(NULL, RIO_MSG_BUFFER_SIZE,
62255 -                                       &msg_tx_ring.phys_buffer[i],
62256 -                                       GFP_KERNEL))) {
62257 -                       rc = -ENOMEM;
62258 -                       for (j = 0; j < msg_tx_ring.size; j++)
62259 -                               if (msg_tx_ring.virt_buffer[j])
62260 -                                       dma_free_coherent(NULL,
62261 -                                                         RIO_MSG_BUFFER_SIZE,
62262 -                                                         msg_tx_ring.
62263 -                                                         virt_buffer[j],
62264 -                                                         msg_tx_ring.
62265 -                                                         phys_buffer[j]);
62266 -                       goto out;
62267 -               }
62268 -       }
62269 -
62270 -       /* Initialize outbound message descriptor ring */
62271 -       if (!(msg_tx_ring.virt = dma_alloc_coherent(NULL,
62272 -                                                   msg_tx_ring.size *
62273 -                                                   RIO_MSG_DESC_SIZE,
62274 -                                                   &msg_tx_ring.phys,
62275 -                                                   GFP_KERNEL))) {
62276 -               rc = -ENOMEM;
62277 -               goto out_dma;
62278 -       }
62279 -       memset(msg_tx_ring.virt, 0, msg_tx_ring.size * RIO_MSG_DESC_SIZE);
62280 -       msg_tx_ring.tx_slot = 0;
62281 -
62282 -       /* Point dequeue/enqueue pointers at first entry in ring */
62283 -       out_be32((void *)&msg_regs->odqdpar, msg_tx_ring.phys);
62284 -       out_be32((void *)&msg_regs->odqepar, msg_tx_ring.phys);
62285 -
62286 -       /* Configure for snooping */
62287 -       out_be32((void *)&msg_regs->osar, 0x00000004);
62288 -
62289 -       /* Clear interrupt status */
62290 -       out_be32((void *)&msg_regs->osr, 0x000000b3);
62291 -
62292 -       /* Hook up outbound message handler */
62293 -       if ((rc =
62294 -            request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0,
62295 -                        "msg_tx", (void *)mport)) < 0)
62296 -               goto out_irq;
62297 -
62298 -       /*
62299 -        * Configure outbound message unit
62300 -        *      Snooping
62301 -        *      Interrupts (all enabled, except QEIE)
62302 -        *      Chaining mode
62303 -        *      Disable
62304 -        */
62305 -       out_be32((void *)&msg_regs->omr, 0x00100220);
62306 -
62307 -       /* Set number of entries */
62308 -       out_be32((void *)&msg_regs->omr,
62309 -                in_be32((void *)&msg_regs->omr) |
62310 -                ((get_bitmask_order(entries) - 2) << 12));
62311 -
62312 -       /* Now enable the unit */
62313 -       out_be32((void *)&msg_regs->omr, in_be32((void *)&msg_regs->omr) | 0x1);
62314 -
62315 -      out:
62316 -       return rc;
62317 -
62318 -      out_irq:
62319 -       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
62320 -                         msg_tx_ring.virt, msg_tx_ring.phys);
62321 -
62322 -      out_dma:
62323 -       for (i = 0; i < msg_tx_ring.size; i++)
62324 -               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
62325 -                                 msg_tx_ring.virt_buffer[i],
62326 -                                 msg_tx_ring.phys_buffer[i]);
62327 -
62328 -       return rc;
62329 -}
62330 -
62331 -/**
62332 - * rio_close_outb_mbox - Shut down MPC85xx outbound mailbox
62333 - * @mport: Master port implementing the outbound message unit
62334 - * @mbox: Mailbox to close
62335 - *
62336 - * Disables the outbound message unit, free all buffers, and
62337 - * frees the outbound message interrupt.
62338 - */
62339 -void rio_close_outb_mbox(struct rio_mport *mport, int mbox)
62340 -{
62341 -       /* Disable inbound message unit */
62342 -       out_be32((void *)&msg_regs->omr, 0);
62343 -
62344 -       /* Free ring */
62345 -       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
62346 -                         msg_tx_ring.virt, msg_tx_ring.phys);
62347 -
62348 -       /* Free interrupt */
62349 -       free_irq(MPC85xx_IRQ_RIO_TX, (void *)mport);
62350 -}
62351 -
62352 -/**
62353 - * mpc85xx_rio_rx_handler - MPC85xx inbound message interrupt handler
62354 - * @irq: Linux interrupt number
62355 - * @dev_instance: Pointer to interrupt-specific data
62356 - *
62357 - * Handles inbound message interrupts. Executes a registered inbound
62358 - * mailbox event handler and acks the interrupt occurrence.
62359 - */
62360 -static irqreturn_t
62361 -mpc85xx_rio_rx_handler(int irq, void *dev_instance)
62362 -{
62363 -       int isr;
62364 -       struct rio_mport *port = (struct rio_mport *)dev_instance;
62365 -
62366 -       isr = in_be32((void *)&msg_regs->isr);
62367 -
62368 -       if (isr & RIO_MSG_ISR_TE) {
62369 -               pr_info("RIO: inbound message reception error\n");
62370 -               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_TE);
62371 -               goto out;
62372 -       }
62373 -
62374 -       /* XXX Need to check/dispatch until queue empty */
62375 -       if (isr & RIO_MSG_ISR_DIQI) {
62376 -               /*
62377 -                * We implement *only* mailbox 0, but can receive messages
62378 -                * for any mailbox/letter to that mailbox destination. So,
62379 -                * make the callback with an unknown/invalid mailbox number
62380 -                * argument.
62381 -                */
62382 -               port->inb_msg[0].mcback(port, msg_rx_ring.dev_id, -1, -1);
62383 -
62384 -               /* Ack the queueing interrupt */
62385 -               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_DIQI);
62386 -       }
62387 -
62388 -      out:
62389 -       return IRQ_HANDLED;
62390 -}
62391 -
62392 -/**
62393 - * rio_open_inb_mbox - Initialize MPC85xx inbound mailbox
62394 - * @mport: Master port implementing the inbound message unit
62395 - * @dev_id: Device specific pointer to pass on event
62396 - * @mbox: Mailbox to open
62397 - * @entries: Number of entries in the inbound mailbox ring
62398 - *
62399 - * Initializes buffer ring, request the inbound message interrupt,
62400 - * and enables the inbound message unit. Returns %0 on success
62401 - * and %-EINVAL or %-ENOMEM on failure.
62402 - */
62403 -int rio_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
62404 -{
62405 -       int i, rc = 0;
62406 -
62407 -       if ((entries < RIO_MIN_RX_RING_SIZE) ||
62408 -           (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {
62409 -               rc = -EINVAL;
62410 -               goto out;
62411 -       }
62412 -
62413 -       /* Initialize client buffer ring */
62414 -       msg_rx_ring.dev_id = dev_id;
62415 -       msg_rx_ring.size = entries;
62416 -       msg_rx_ring.rx_slot = 0;
62417 -       for (i = 0; i < msg_rx_ring.size; i++)
62418 -               msg_rx_ring.virt_buffer[i] = NULL;
62419 -
62420 -       /* Initialize inbound message ring */
62421 -       if (!(msg_rx_ring.virt = dma_alloc_coherent(NULL,
62422 -                                                   msg_rx_ring.size *
62423 -                                                   RIO_MAX_MSG_SIZE,
62424 -                                                   &msg_rx_ring.phys,
62425 -                                                   GFP_KERNEL))) {
62426 -               rc = -ENOMEM;
62427 -               goto out;
62428 -       }
62429 -
62430 -       /* Point dequeue/enqueue pointers at first entry in ring */
62431 -       out_be32((void *)&msg_regs->ifqdpar, (u32) msg_rx_ring.phys);
62432 -       out_be32((void *)&msg_regs->ifqepar, (u32) msg_rx_ring.phys);
62433 -
62434 -       /* Clear interrupt status */
62435 -       out_be32((void *)&msg_regs->isr, 0x00000091);
62436 -
62437 -       /* Hook up inbound message handler */
62438 -       if ((rc =
62439 -            request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0,
62440 -                        "msg_rx", (void *)mport)) < 0) {
62441 -               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
62442 -                                 msg_tx_ring.virt_buffer[i],
62443 -                                 msg_tx_ring.phys_buffer[i]);
62444 -               goto out;
62445 -       }
62446 -
62447 -       /*
62448 -        * Configure inbound message unit:
62449 -        *      Snooping
62450 -        *      4KB max message size
62451 -        *      Unmask all interrupt sources
62452 -        *      Disable
62453 -        */
62454 -       out_be32((void *)&msg_regs->imr, 0x001b0060);
62455 -
62456 -       /* Set number of queue entries */
62457 -       out_be32((void *)&msg_regs->imr,
62458 -                in_be32((void *)&msg_regs->imr) |
62459 -                ((get_bitmask_order(entries) - 2) << 12));
62460 -
62461 -       /* Now enable the unit */
62462 -       out_be32((void *)&msg_regs->imr, in_be32((void *)&msg_regs->imr) | 0x1);
62463 -
62464 -      out:
62465 -       return rc;
62466 -}
62467 -
62468 -/**
62469 - * rio_close_inb_mbox - Shut down MPC85xx inbound mailbox
62470 - * @mport: Master port implementing the inbound message unit
62471 - * @mbox: Mailbox to close
62472 - *
62473 - * Disables the inbound message unit, free all buffers, and
62474 - * frees the inbound message interrupt.
62475 - */
62476 -void rio_close_inb_mbox(struct rio_mport *mport, int mbox)
62477 -{
62478 -       /* Disable inbound message unit */
62479 -       out_be32((void *)&msg_regs->imr, 0);
62480 -
62481 -       /* Free ring */
62482 -       dma_free_coherent(NULL, msg_rx_ring.size * RIO_MAX_MSG_SIZE,
62483 -                         msg_rx_ring.virt, msg_rx_ring.phys);
62484 -
62485 -       /* Free interrupt */
62486 -       free_irq(MPC85xx_IRQ_RIO_RX, (void *)mport);
62487 -}
62488 -
62489 -/**
62490 - * rio_hw_add_inb_buffer - Add buffer to the MPC85xx inbound message queue
62491 - * @mport: Master port implementing the inbound message unit
62492 - * @mbox: Inbound mailbox number
62493 - * @buf: Buffer to add to inbound queue
62494 - *
62495 - * Adds the @buf buffer to the MPC85xx inbound message queue. Returns
62496 - * %0 on success or %-EINVAL on failure.
62497 - */
62498 -int rio_hw_add_inb_buffer(struct rio_mport *mport, int mbox, void *buf)
62499 -{
62500 -       int rc = 0;
62501 -
62502 -       pr_debug("RIO: rio_hw_add_inb_buffer(), msg_rx_ring.rx_slot %d\n",
62503 -                msg_rx_ring.rx_slot);
62504 -
62505 -       if (msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot]) {
62506 -               printk(KERN_ERR
62507 -                      "RIO: error adding inbound buffer %d, buffer exists\n",
62508 -                      msg_rx_ring.rx_slot);
62509 -               rc = -EINVAL;
62510 -               goto out;
62511 -       }
62512 -
62513 -       msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot] = buf;
62514 -       if (++msg_rx_ring.rx_slot == msg_rx_ring.size)
62515 -               msg_rx_ring.rx_slot = 0;
62516 -
62517 -      out:
62518 -       return rc;
62519 -}
62520 -
62521 -EXPORT_SYMBOL_GPL(rio_hw_add_inb_buffer);
62522 -
62523 -/**
62524 - * rio_hw_get_inb_message - Fetch inbound message from the MPC85xx message unit
62525 - * @mport: Master port implementing the inbound message unit
62526 - * @mbox: Inbound mailbox number
62527 - *
62528 - * Gets the next available inbound message from the inbound message queue.
62529 - * A pointer to the message is returned on success or NULL on failure.
62530 - */
62531 -void *rio_hw_get_inb_message(struct rio_mport *mport, int mbox)
62532 -{
62533 -       u32 imr;
62534 -       u32 phys_buf, virt_buf;
62535 -       void *buf = NULL;
62536 -       int buf_idx;
62537 -
62538 -       phys_buf = in_be32((void *)&msg_regs->ifqdpar);
62539 -
62540 -       /* If no more messages, then bail out */
62541 -       if (phys_buf == in_be32((void *)&msg_regs->ifqepar))
62542 -               goto out2;
62543 -
62544 -       virt_buf = (u32) msg_rx_ring.virt + (phys_buf - msg_rx_ring.phys);
62545 -       buf_idx = (phys_buf - msg_rx_ring.phys) / RIO_MAX_MSG_SIZE;
62546 -       buf = msg_rx_ring.virt_buffer[buf_idx];
62547 -
62548 -       if (!buf) {
62549 -               printk(KERN_ERR
62550 -                      "RIO: inbound message copy failed, no buffers\n");
62551 -               goto out1;
62552 -       }
62553 -
62554 -       /* Copy max message size, caller is expected to allocate that big */
62555 -       memcpy(buf, (void *)virt_buf, RIO_MAX_MSG_SIZE);
62556 -
62557 -       /* Clear the available buffer */
62558 -       msg_rx_ring.virt_buffer[buf_idx] = NULL;
62559 -
62560 -      out1:
62561 -       imr = in_be32((void *)&msg_regs->imr);
62562 -       out_be32((void *)&msg_regs->imr, imr | RIO_MSG_IMR_MI);
62563 -
62564 -      out2:
62565 -       return buf;
62566 -}
62567 -
62568 -EXPORT_SYMBOL_GPL(rio_hw_get_inb_message);
62569 -
62570 -/**
62571 - * mpc85xx_rio_dbell_handler - MPC85xx doorbell interrupt handler
62572 - * @irq: Linux interrupt number
62573 - * @dev_instance: Pointer to interrupt-specific data
62574 - *
62575 - * Handles doorbell interrupts. Parses a list of registered
62576 - * doorbell event handlers and executes a matching event handler.
62577 - */
62578 -static irqreturn_t
62579 -mpc85xx_rio_dbell_handler(int irq, void *dev_instance)
62580 -{
62581 -       int dsr;
62582 -       struct rio_mport *port = (struct rio_mport *)dev_instance;
62583 -
62584 -       dsr = in_be32((void *)&msg_regs->dsr);
62585 -
62586 -       if (dsr & DOORBELL_DSR_TE) {
62587 -               pr_info("RIO: doorbell reception error\n");
62588 -               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_TE);
62589 -               goto out;
62590 -       }
62591 -
62592 -       if (dsr & DOORBELL_DSR_QFI) {
62593 -               pr_info("RIO: doorbell queue full\n");
62594 -               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_QFI);
62595 -               goto out;
62596 -       }
62597 -
62598 -       /* XXX Need to check/dispatch until queue empty */
62599 -       if (dsr & DOORBELL_DSR_DIQI) {
62600 -               u32 dmsg =
62601 -                   (u32) dbell_ring.virt +
62602 -                   (in_be32((void *)&msg_regs->dqdpar) & 0xfff);
62603 -               u32 dmr;
62604 -               struct rio_dbell *dbell;
62605 -               int found = 0;
62606 -
62607 -               pr_debug
62608 -                   ("RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
62609 -                    DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
62610 -
62611 -               list_for_each_entry(dbell, &port->dbells, node) {
62612 -                       if ((dbell->res->start <= DBELL_INF(dmsg)) &&
62613 -                           (dbell->res->end >= DBELL_INF(dmsg))) {
62614 -                               found = 1;
62615 -                               break;
62616 -                       }
62617 -               }
62618 -               if (found) {
62619 -                       dbell->dinb(port, dbell->dev_id, DBELL_SID(dmsg), DBELL_TID(dmsg),
62620 -                                   DBELL_INF(dmsg));
62621 -               } else {
62622 -                       pr_debug
62623 -                           ("RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
62624 -                            DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
62625 -               }
62626 -               dmr = in_be32((void *)&msg_regs->dmr);
62627 -               out_be32((void *)&msg_regs->dmr, dmr | DOORBELL_DMR_DI);
62628 -               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_DIQI);
62629 -       }
62630 -
62631 -      out:
62632 -       return IRQ_HANDLED;
62633 -}
62634 -
62635 -/**
62636 - * mpc85xx_rio_doorbell_init - MPC85xx doorbell interface init
62637 - * @mport: Master port implementing the inbound doorbell unit
62638 - *
62639 - * Initializes doorbell unit hardware and inbound DMA buffer
62640 - * ring. Called from mpc85xx_rio_setup(). Returns %0 on success
62641 - * or %-ENOMEM on failure.
62642 - */
62643 -static int mpc85xx_rio_doorbell_init(struct rio_mport *mport)
62644 -{
62645 -       int rc = 0;
62646 -
62647 -       /* Map outbound doorbell window immediately after maintenance window */
62648 -       if (!(dbell_win =
62649 -             (u32) ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
62650 -                           RIO_DBELL_WIN_SIZE))) {
62651 -               printk(KERN_ERR
62652 -                      "RIO: unable to map outbound doorbell window\n");
62653 -               rc = -ENOMEM;
62654 -               goto out;
62655 -       }
62656 -
62657 -       /* Initialize inbound doorbells */
62658 -       if (!(dbell_ring.virt = dma_alloc_coherent(NULL,
62659 -                                                  512 * DOORBELL_MESSAGE_SIZE,
62660 -                                                  &dbell_ring.phys,
62661 -                                                  GFP_KERNEL))) {
62662 -               printk(KERN_ERR "RIO: unable allocate inbound doorbell ring\n");
62663 -               rc = -ENOMEM;
62664 -               iounmap((void *)dbell_win);
62665 -               goto out;
62666 -       }
62667 -
62668 -       /* Point dequeue/enqueue pointers at first entry in ring */
62669 -       out_be32((void *)&msg_regs->dqdpar, (u32) dbell_ring.phys);
62670 -       out_be32((void *)&msg_regs->dqepar, (u32) dbell_ring.phys);
62671 -
62672 -       /* Clear interrupt status */
62673 -       out_be32((void *)&msg_regs->dsr, 0x00000091);
62674 -
62675 -       /* Hook up doorbell handler */
62676 -       if ((rc =
62677 -            request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0,
62678 -                        "dbell_rx", (void *)mport) < 0)) {
62679 -               iounmap((void *)dbell_win);
62680 -               dma_free_coherent(NULL, 512 * DOORBELL_MESSAGE_SIZE,
62681 -                                 dbell_ring.virt, dbell_ring.phys);
62682 -               printk(KERN_ERR
62683 -                      "MPC85xx RIO: unable to request inbound doorbell irq");
62684 -               goto out;
62685 -       }
62686 -
62687 -       /* Configure doorbells for snooping, 512 entries, and enable */
62688 -       out_be32((void *)&msg_regs->dmr, 0x00108161);
62689 -
62690 -      out:
62691 -       return rc;
62692 -}
62693 -
62694 -static char *cmdline = NULL;
62695 -
62696 -static int mpc85xx_rio_get_hdid(int index)
62697 -{
62698 -       /* XXX Need to parse multiple entries in some format */
62699 -       if (!cmdline)
62700 -               return -1;
62701 -
62702 -       return simple_strtol(cmdline, NULL, 0);
62703 -}
62704 -
62705 -static int mpc85xx_rio_get_cmdline(char *s)
62706 -{
62707 -       if (!s)
62708 -               return 0;
62709 -
62710 -       cmdline = s;
62711 -       return 1;
62712 -}
62713 -
62714 -__setup("riohdid=", mpc85xx_rio_get_cmdline);
62715 -
62716 -/**
62717 - * mpc85xx_rio_setup - Setup MPC85xx RapidIO interface
62718 - * @law_start: Starting physical address of RapidIO LAW
62719 - * @law_size: Size of RapidIO LAW
62720 - *
62721 - * Initializes MPC85xx RapidIO hardware interface, configures
62722 - * master port with system-specific info, and registers the
62723 - * master port with the RapidIO subsystem.
62724 - */
62725 -void mpc85xx_rio_setup(int law_start, int law_size)
62726 -{
62727 -       struct rio_ops *ops;
62728 -       struct rio_mport *port;
62729 -
62730 -       ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL);
62731 -       ops->lcread = mpc85xx_local_config_read;
62732 -       ops->lcwrite = mpc85xx_local_config_write;
62733 -       ops->cread = mpc85xx_rio_config_read;
62734 -       ops->cwrite = mpc85xx_rio_config_write;
62735 -       ops->dsend = mpc85xx_rio_doorbell_send;
62736 -
62737 -       port = kmalloc(sizeof(struct rio_mport), GFP_KERNEL);
62738 -       port->id = 0;
62739 -       port->index = 0;
62740 -       INIT_LIST_HEAD(&port->dbells);
62741 -       port->iores.start = law_start;
62742 -       port->iores.end = law_start + law_size;
62743 -       port->iores.flags = IORESOURCE_MEM;
62744 -
62745 -       rio_init_dbell_res(&port->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff);
62746 -       rio_init_mbox_res(&port->riores[RIO_INB_MBOX_RESOURCE], 0, 0);
62747 -       rio_init_mbox_res(&port->riores[RIO_OUTB_MBOX_RESOURCE], 0, 0);
62748 -       strcpy(port->name, "RIO0 mport");
62749 -
62750 -       port->ops = ops;
62751 -       port->host_deviceid = mpc85xx_rio_get_hdid(port->id);
62752 -
62753 -       rio_register_mport(port);
62754 -
62755 -       regs_win = (u32) ioremap(RIO_REGS_BASE, 0x20000);
62756 -       atmu_regs = (struct rio_atmu_regs *)(regs_win + RIO_ATMU_REGS_OFFSET);
62757 -       maint_atmu_regs = atmu_regs + 1;
62758 -       dbell_atmu_regs = atmu_regs + 2;
62759 -       msg_regs = (struct rio_msg_regs *)(regs_win + RIO_MSG_REGS_OFFSET);
62760 -
62761 -       /* Configure maintenance transaction window */
62762 -       out_be32((void *)&maint_atmu_regs->rowbar, 0x000c0000);
62763 -       out_be32((void *)&maint_atmu_regs->rowar, 0x80077015);
62764 -
62765 -       maint_win = (u32) ioremap(law_start, RIO_MAINT_WIN_SIZE);
62766 -
62767 -       /* Configure outbound doorbell window */
62768 -       out_be32((void *)&dbell_atmu_regs->rowbar, 0x000c0400);
62769 -       out_be32((void *)&dbell_atmu_regs->rowar, 0x8004200b);
62770 -       mpc85xx_rio_doorbell_init(port);
62771 -}
62772 Index: linux-2.6.24.7/arch/ppc/syslib/ppc85xx_rio.h
62773 ===================================================================
62774 --- linux-2.6.24.7.orig/arch/ppc/syslib/ppc85xx_rio.h
62775 +++ /dev/null
62776 @@ -1,20 +0,0 @@
62777 -/*
62778 - * MPC85xx RapidIO definitions
62779 - *
62780 - * Copyright 2005 MontaVista Software, Inc.
62781 - * Matt Porter <mporter@kernel.crashing.org>
62782 - *
62783 - * This program is free software; you can redistribute  it and/or modify it
62784 - * under  the terms of  the GNU General  Public License as published by the
62785 - * Free Software Foundation;  either version 2 of the  License, or (at your
62786 - * option) any later version.
62787 - */
62788 -
62789 -#ifndef __PPC_SYSLIB_PPC85XX_RIO_H
62790 -#define __PPC_SYSLIB_PPC85XX_RIO_H
62791 -
62792 -#include <linux/init.h>
62793 -
62794 -extern void mpc85xx_rio_setup(int law_start, int law_size);
62795 -
62796 -#endif                         /* __PPC_SYSLIB_PPC85XX_RIO_H */
62797 Index: linux-2.6.24.7/arch/ppc/syslib/ppc8xx_pic.c
62798 ===================================================================
62799 --- linux-2.6.24.7.orig/arch/ppc/syslib/ppc8xx_pic.c
62800 +++ linux-2.6.24.7/arch/ppc/syslib/ppc8xx_pic.c
62801 @@ -16,7 +16,7 @@ extern int cpm_get_irq(void);
62802   * the only interrupt controller.  Some boards, like the MBX and
62803   * Sandpoint have the 8259 as a secondary controller.  Depending
62804   * upon the processor type, the internal controller can have as
62805 - * few as 16 interrups or as many as 64.  We could use  the
62806 + * few as 16 interrupts or as many as 64.  We could use  the
62807   * "clear_bit()" and "set_bit()" functions like other platforms,
62808   * but they are overkill for us.
62809   */
62810 Index: linux-2.6.24.7/arch/ppc/syslib/ppc_sys.c
62811 ===================================================================
62812 --- linux-2.6.24.7.orig/arch/ppc/syslib/ppc_sys.c
62813 +++ linux-2.6.24.7/arch/ppc/syslib/ppc_sys.c
62814 @@ -185,7 +185,7 @@ void platform_notify_map(const struct pl
62815   */
62816  
62817  /*
62818 -   Here we'll replace .name pointers with fixed-lenght strings
62819 +   Here we'll replace .name pointers with fixed-length strings
62820     Hereby, this should be called *before* any func stuff triggeded.
62821   */
62822  void ppc_sys_device_initfunc(void)
62823 Index: linux-2.6.24.7/arch/ppc/xmon/start.c
62824 ===================================================================
62825 --- linux-2.6.24.7.orig/arch/ppc/xmon/start.c
62826 +++ linux-2.6.24.7/arch/ppc/xmon/start.c
62827 @@ -10,7 +10,6 @@
62828  #include <linux/sysrq.h>
62829  #include <linux/bitops.h>
62830  #include <asm/xmon.h>
62831 -#include <asm/machdep.h>
62832  #include <asm/errno.h>
62833  #include <asm/processor.h>
62834  #include <asm/delay.h>
62835 Index: linux-2.6.24.7/drivers/ata/Kconfig
62836 ===================================================================
62837 --- linux-2.6.24.7.orig/drivers/ata/Kconfig
62838 +++ linux-2.6.24.7/drivers/ata/Kconfig
62839 @@ -607,13 +607,23 @@ config PATA_WINBOND_VLB
62840  
62841  config PATA_PLATFORM
62842         tristate "Generic platform device PATA support"
62843 -       depends on EMBEDDED || ARCH_RPC
62844 +       depends on EMBEDDED || ARCH_RPC || PPC
62845         help
62846           This option enables support for generic directly connected ATA
62847           devices commonly found on embedded systems.
62848  
62849           If unsure, say N.
62850  
62851 +config PATA_OF_PLATFORM
62852 +       tristate "OpenFirmware platform device PATA support"
62853 +       depends on PATA_PLATFORM && PPC_OF
62854 +       help
62855 +         This option enables support for generic directly connected ATA
62856 +         devices commonly found on embedded systems with OpenFirmware
62857 +         bindings.
62858 +
62859 +         If unsure, say N.
62860 +
62861  config PATA_ICSIDE
62862         tristate "Acorn ICS PATA support"
62863         depends on ARM && ARCH_ACORN
62864 Index: linux-2.6.24.7/drivers/ata/Makefile
62865 ===================================================================
62866 --- linux-2.6.24.7.orig/drivers/ata/Makefile
62867 +++ linux-2.6.24.7/drivers/ata/Makefile
62868 @@ -67,6 +67,7 @@ obj-$(CONFIG_PATA_IXP4XX_CF)  += pata_ixp
62869  obj-$(CONFIG_PATA_SCC)         += pata_scc.o
62870  obj-$(CONFIG_PATA_BF54X)       += pata_bf54x.o
62871  obj-$(CONFIG_PATA_PLATFORM)    += pata_platform.o
62872 +obj-$(CONFIG_PATA_OF_PLATFORM) += pata_of_platform.o
62873  obj-$(CONFIG_PATA_ICSIDE)      += pata_icside.o
62874  # Should be last but two libata driver
62875  obj-$(CONFIG_PATA_ACPI)                += pata_acpi.o
62876 Index: linux-2.6.24.7/drivers/ata/pata_of_platform.c
62877 ===================================================================
62878 --- /dev/null
62879 +++ linux-2.6.24.7/drivers/ata/pata_of_platform.c
62880 @@ -0,0 +1,114 @@
62881 +/*
62882 + * OF-platform PATA driver
62883 + *
62884 + * Copyright (c) 2007  MontaVista Software, Inc.
62885 + *                     Anton Vorontsov <avorontsov@ru.mvista.com>
62886 + *
62887 + * This program is free software; you can redistribute it and/or modify
62888 + * it under the terms of the GNU General Public License (Version 2) as
62889 + * published by the Free Software Foundation.
62890 + */
62891 +
62892 +#include <linux/kernel.h>
62893 +#include <linux/module.h>
62894 +#include <linux/of_platform.h>
62895 +#include <linux/pata_platform.h>
62896 +
62897 +static int __devinit pata_of_platform_probe(struct of_device *ofdev,
62898 +                                           const struct of_device_id *match)
62899 +{
62900 +       int ret;
62901 +       struct device_node *dn = ofdev->node;
62902 +       struct resource io_res;
62903 +       struct resource ctl_res;
62904 +       struct resource irq_res;
62905 +       unsigned int reg_shift = 0;
62906 +       int pio_mode = 0;
62907 +       int pio_mask;
62908 +       const u32 *prop;
62909 +
62910 +       ret = of_address_to_resource(dn, 0, &io_res);
62911 +       if (ret) {
62912 +               dev_err(&ofdev->dev, "can't get IO address from "
62913 +                       "device tree\n");
62914 +               return -EINVAL;
62915 +       }
62916 +
62917 +       if (of_device_is_compatible(dn, "electra-ide")) {
62918 +               /* Altstatus is really at offset 0x3f6 from the primary window
62919 +                * on electra-ide. Adjust ctl_res and io_res accordingly.
62920 +                */
62921 +               ctl_res = io_res;
62922 +               ctl_res.start = ctl_res.start+0x3f6;
62923 +               io_res.end = ctl_res.start-1;
62924 +       } else {
62925 +               ret = of_address_to_resource(dn, 1, &ctl_res);
62926 +               if (ret) {
62927 +                       dev_err(&ofdev->dev, "can't get CTL address from "
62928 +                               "device tree\n");
62929 +                       return -EINVAL;
62930 +               }
62931 +       }
62932 +
62933 +       ret = of_irq_to_resource(dn, 0, &irq_res);
62934 +       if (ret == NO_IRQ)
62935 +               irq_res.start = irq_res.end = -1;
62936 +       else
62937 +               irq_res.flags = 0;
62938 +
62939 +       prop = of_get_property(dn, "reg-shift", NULL);
62940 +       if (prop)
62941 +               reg_shift = *prop;
62942 +
62943 +       prop = of_get_property(dn, "pio-mode", NULL);
62944 +       if (prop) {
62945 +               pio_mode = *prop;
62946 +               if (pio_mode > 6) {
62947 +                       dev_err(&ofdev->dev, "invalid pio-mode\n");
62948 +                       return -EINVAL;
62949 +               }
62950 +       } else {
62951 +               dev_info(&ofdev->dev, "pio-mode unspecified, assuming PIO0\n");
62952 +       }
62953 +
62954 +       pio_mask = 1 << pio_mode;
62955 +       pio_mask |= (1 << pio_mode) - 1;
62956 +
62957 +       return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, &irq_res,
62958 +                                    reg_shift, pio_mask);
62959 +}
62960 +
62961 +static int __devexit pata_of_platform_remove(struct of_device *ofdev)
62962 +{
62963 +       return __pata_platform_remove(&ofdev->dev);
62964 +}
62965 +
62966 +static struct of_device_id pata_of_platform_match[] = {
62967 +       { .compatible = "ata-generic", },
62968 +       { .compatible = "electra-ide", },
62969 +       {},
62970 +};
62971 +MODULE_DEVICE_TABLE(of, pata_of_platform_match);
62972 +
62973 +static struct of_platform_driver pata_of_platform_driver = {
62974 +       .name           = "pata_of_platform",
62975 +       .match_table    = pata_of_platform_match,
62976 +       .probe          = pata_of_platform_probe,
62977 +       .remove         = __devexit_p(pata_of_platform_remove),
62978 +};
62979 +
62980 +static int __init pata_of_platform_init(void)
62981 +{
62982 +       return of_register_platform_driver(&pata_of_platform_driver);
62983 +}
62984 +module_init(pata_of_platform_init);
62985 +
62986 +static void __exit pata_of_platform_exit(void)
62987 +{
62988 +       of_unregister_platform_driver(&pata_of_platform_driver);
62989 +}
62990 +module_exit(pata_of_platform_exit);
62991 +
62992 +MODULE_DESCRIPTION("OF-platform PATA driver");
62993 +MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
62994 +MODULE_LICENSE("GPL");
62995 Index: linux-2.6.24.7/drivers/ata/pata_platform.c
62996 ===================================================================
62997 --- linux-2.6.24.7.orig/drivers/ata/pata_platform.c
62998 +++ linux-2.6.24.7/drivers/ata/pata_platform.c
62999 @@ -93,14 +93,9 @@ static struct ata_port_operations pata_p
63000  };
63001  
63002  static void pata_platform_setup_port(struct ata_ioports *ioaddr,
63003 -                                    struct pata_platform_info *info)
63004 +                                    unsigned int shift)
63005  {
63006 -       unsigned int shift = 0;
63007 -
63008         /* Fixup the port shift for platforms that need it */
63009 -       if (info && info->ioport_shift)
63010 -               shift = info->ioport_shift;
63011 -
63012         ioaddr->data_addr       = ioaddr->cmd_addr + (ATA_REG_DATA    << shift);
63013         ioaddr->error_addr      = ioaddr->cmd_addr + (ATA_REG_ERR     << shift);
63014         ioaddr->feature_addr    = ioaddr->cmd_addr + (ATA_REG_FEATURE << shift);
63015 @@ -114,8 +109,13 @@ static void pata_platform_setup_port(str
63016  }
63017  
63018  /**
63019 - *     pata_platform_probe             -       attach a platform interface
63020 - *     @pdev: platform device
63021 + *     __pata_platform_probe           -       attach a platform interface
63022 + *     @dev: device
63023 + *     @io_res: Resource representing I/O base
63024 + *     @ctl_res: Resource representing CTL base
63025 + *     @irq_res: Resource representing IRQ and its flags
63026 + *     @ioport_shift: I/O port shift
63027 + *     @__pio_mask: PIO mask
63028   *
63029   *     Register a platform bus IDE interface. Such interfaces are PIO and we
63030   *     assume do not support IRQ sharing.
63031 @@ -135,42 +135,18 @@ static void pata_platform_setup_port(str
63032   *
63033   *     If no IRQ resource is present, PIO polling mode is used instead.
63034   */
63035 -static int __devinit pata_platform_probe(struct platform_device *pdev)
63036 +int __devinit __pata_platform_probe(struct device *dev,
63037 +                                   struct resource *io_res,
63038 +                                   struct resource *ctl_res,
63039 +                                   struct resource *irq_res,
63040 +                                   unsigned int ioport_shift,
63041 +                                   int __pio_mask)
63042  {
63043 -       struct resource *io_res, *ctl_res;
63044         struct ata_host *host;
63045         struct ata_port *ap;
63046 -       struct pata_platform_info *pp_info;
63047         unsigned int mmio;
63048 -       int irq;
63049 -
63050 -       /*
63051 -        * Simple resource validation ..
63052 -        */
63053 -       if ((pdev->num_resources != 3) && (pdev->num_resources != 2)) {
63054 -               dev_err(&pdev->dev, "invalid number of resources\n");
63055 -               return -EINVAL;
63056 -       }
63057 -
63058 -       /*
63059 -        * Get the I/O base first
63060 -        */
63061 -       io_res = platform_get_resource(pdev, IORESOURCE_IO, 0);
63062 -       if (io_res == NULL) {
63063 -               io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
63064 -               if (unlikely(io_res == NULL))
63065 -                       return -EINVAL;
63066 -       }
63067 -
63068 -       /*
63069 -        * Then the CTL base
63070 -        */
63071 -       ctl_res = platform_get_resource(pdev, IORESOURCE_IO, 1);
63072 -       if (ctl_res == NULL) {
63073 -               ctl_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
63074 -               if (unlikely(ctl_res == NULL))
63075 -                       return -EINVAL;
63076 -       }
63077 +       int irq = 0;
63078 +       int irq_flags = 0;
63079  
63080         /*
63081          * Check for MMIO
63082 @@ -181,20 +157,21 @@ static int __devinit pata_platform_probe
63083         /*
63084          * And the IRQ
63085          */
63086 -       irq = platform_get_irq(pdev, 0);
63087 -       if (irq < 0)
63088 -               irq = 0;        /* no irq */
63089 +       if (irq_res && irq_res->start > 0) {
63090 +               irq = irq_res->start;
63091 +               irq_flags = irq_res->flags;
63092 +       }
63093  
63094         /*
63095          * Now that that's out of the way, wire up the port..
63096          */
63097 -       host = ata_host_alloc(&pdev->dev, 1);
63098 +       host = ata_host_alloc(dev, 1);
63099         if (!host)
63100                 return -ENOMEM;
63101         ap = host->ports[0];
63102  
63103         ap->ops = &pata_platform_port_ops;
63104 -       ap->pio_mask = pio_mask;
63105 +       ap->pio_mask = __pio_mask;
63106         ap->flags |= ATA_FLAG_SLAVE_POSS;
63107  
63108         /*
63109 @@ -209,25 +186,24 @@ static int __devinit pata_platform_probe
63110          * Handle the MMIO case
63111          */
63112         if (mmio) {
63113 -               ap->ioaddr.cmd_addr = devm_ioremap(&pdev->dev, io_res->start,
63114 +               ap->ioaddr.cmd_addr = devm_ioremap(dev, io_res->start,
63115                                 io_res->end - io_res->start + 1);
63116 -               ap->ioaddr.ctl_addr = devm_ioremap(&pdev->dev, ctl_res->start,
63117 +               ap->ioaddr.ctl_addr = devm_ioremap(dev, ctl_res->start,
63118                                 ctl_res->end - ctl_res->start + 1);
63119         } else {
63120 -               ap->ioaddr.cmd_addr = devm_ioport_map(&pdev->dev, io_res->start,
63121 +               ap->ioaddr.cmd_addr = devm_ioport_map(dev, io_res->start,
63122                                 io_res->end - io_res->start + 1);
63123 -               ap->ioaddr.ctl_addr = devm_ioport_map(&pdev->dev, ctl_res->start,
63124 +               ap->ioaddr.ctl_addr = devm_ioport_map(dev, ctl_res->start,
63125                                 ctl_res->end - ctl_res->start + 1);
63126         }
63127         if (!ap->ioaddr.cmd_addr || !ap->ioaddr.ctl_addr) {
63128 -               dev_err(&pdev->dev, "failed to map IO/CTL base\n");
63129 +               dev_err(dev, "failed to map IO/CTL base\n");
63130                 return -ENOMEM;
63131         }
63132  
63133         ap->ioaddr.altstatus_addr = ap->ioaddr.ctl_addr;
63134  
63135 -       pp_info = pdev->dev.platform_data;
63136 -       pata_platform_setup_port(&ap->ioaddr, pp_info);
63137 +       pata_platform_setup_port(&ap->ioaddr, ioport_shift);
63138  
63139         ata_port_desc(ap, "%s cmd 0x%llx ctl 0x%llx", mmio ? "mmio" : "ioport",
63140                       (unsigned long long)io_res->start,
63141 @@ -235,26 +211,78 @@ static int __devinit pata_platform_probe
63142  
63143         /* activate */
63144         return ata_host_activate(host, irq, irq ? ata_interrupt : NULL,
63145 -                                pp_info ? pp_info->irq_flags : 0,
63146 -                                &pata_platform_sht);
63147 +                                irq_flags, &pata_platform_sht);
63148  }
63149 +EXPORT_SYMBOL_GPL(__pata_platform_probe);
63150  
63151  /**
63152 - *     pata_platform_remove    -       unplug a platform interface
63153 - *     @pdev: platform device
63154 + *     __pata_platform_remove          -       unplug a platform interface
63155 + *     @dev: device
63156   *
63157   *     A platform bus ATA device has been unplugged. Perform the needed
63158   *     cleanup. Also called on module unload for any active devices.
63159   */
63160 -static int __devexit pata_platform_remove(struct platform_device *pdev)
63161 +int __devexit __pata_platform_remove(struct device *dev)
63162  {
63163 -       struct device *dev = &pdev->dev;
63164         struct ata_host *host = dev_get_drvdata(dev);
63165  
63166         ata_host_detach(host);
63167  
63168         return 0;
63169  }
63170 +EXPORT_SYMBOL_GPL(__pata_platform_remove);
63171 +
63172 +static int __devinit pata_platform_probe(struct platform_device *pdev)
63173 +{
63174 +       struct resource *io_res;
63175 +       struct resource *ctl_res;
63176 +       struct resource *irq_res;
63177 +       struct pata_platform_info *pp_info = pdev->dev.platform_data;
63178 +
63179 +       /*
63180 +        * Simple resource validation ..
63181 +        */
63182 +       if ((pdev->num_resources != 3) && (pdev->num_resources != 2)) {
63183 +               dev_err(&pdev->dev, "invalid number of resources\n");
63184 +               return -EINVAL;
63185 +       }
63186 +
63187 +       /*
63188 +        * Get the I/O base first
63189 +        */
63190 +       io_res = platform_get_resource(pdev, IORESOURCE_IO, 0);
63191 +       if (io_res == NULL) {
63192 +               io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
63193 +               if (unlikely(io_res == NULL))
63194 +                       return -EINVAL;
63195 +       }
63196 +
63197 +       /*
63198 +        * Then the CTL base
63199 +        */
63200 +       ctl_res = platform_get_resource(pdev, IORESOURCE_IO, 1);
63201 +       if (ctl_res == NULL) {
63202 +               ctl_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
63203 +               if (unlikely(ctl_res == NULL))
63204 +                       return -EINVAL;
63205 +       }
63206 +
63207 +       /*
63208 +        * And the IRQ
63209 +        */
63210 +       irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
63211 +       if (irq_res)
63212 +               irq_res->flags = pp_info ? pp_info->irq_flags : 0;
63213 +
63214 +       return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq_res,
63215 +                                    pp_info ? pp_info->ioport_shift : 0,
63216 +                                    pio_mask);
63217 +}
63218 +
63219 +static int __devexit pata_platform_remove(struct platform_device *pdev)
63220 +{
63221 +       return __pata_platform_remove(&pdev->dev);
63222 +}
63223  
63224  static struct platform_driver pata_platform_driver = {
63225         .probe          = pata_platform_probe,
63226 Index: linux-2.6.24.7/drivers/char/hw_random/Kconfig
63227 ===================================================================
63228 --- linux-2.6.24.7.orig/drivers/char/hw_random/Kconfig
63229 +++ linux-2.6.24.7/drivers/char/hw_random/Kconfig
63230 @@ -98,7 +98,7 @@ config HW_RANDOM_PASEMI
63231         default HW_RANDOM
63232         ---help---
63233           This driver provides kernel-side support for the Random Number
63234 -         Generator hardware found on PA6T-1682M processor.
63235 +         Generator hardware found on PA Semi PWRficient SoCs.
63236  
63237           To compile this driver as a module, choose M here: the
63238           module will be called pasemi-rng.
63239 Index: linux-2.6.24.7/drivers/char/hw_random/pasemi-rng.c
63240 ===================================================================
63241 --- linux-2.6.24.7.orig/drivers/char/hw_random/pasemi-rng.c
63242 +++ linux-2.6.24.7/drivers/char/hw_random/pasemi-rng.c
63243 @@ -126,10 +126,9 @@ static int __devexit rng_remove(struct o
63244  }
63245  
63246  static struct of_device_id rng_match[] = {
63247 -       {
63248 -               .compatible      = "1682m-rng",
63249 -       },
63250 -       {},
63251 +       { .compatible      = "1682m-rng", },
63252 +       { .compatible      = "pasemi,pwrficient-rng", },
63253 +       { },
63254  };
63255  
63256  static struct of_platform_driver rng_driver = {
63257 Index: linux-2.6.24.7/drivers/edac/pasemi_edac.c
63258 ===================================================================
63259 --- linux-2.6.24.7.orig/drivers/edac/pasemi_edac.c
63260 +++ linux-2.6.24.7/drivers/edac/pasemi_edac.c
63261 @@ -225,7 +225,7 @@ static int __devinit pasemi_edac_probe(s
63262                 EDAC_FLAG_NONE;
63263         mci->mod_name = MODULE_NAME;
63264         mci->dev_name = pci_name(pdev);
63265 -       mci->ctl_name = "pasemi,1682m-mc";
63266 +       mci->ctl_name = "pasemi,pwrficient-mc";
63267         mci->edac_check = pasemi_edac_check;
63268         mci->ctl_page_to_phys = NULL;
63269         pci_read_config_dword(pdev, MCCFG_SCRUB, &scrub);
63270 @@ -297,4 +297,4 @@ module_exit(pasemi_edac_exit);
63271  
63272  MODULE_LICENSE("GPL");
63273  MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>");
63274 -MODULE_DESCRIPTION("MC support for PA Semi PA6T-1682M memory controller");
63275 +MODULE_DESCRIPTION("MC support for PA Semi PWRficient memory controller");
63276 Index: linux-2.6.24.7/drivers/macintosh/adb.c
63277 ===================================================================
63278 --- linux-2.6.24.7.orig/drivers/macintosh/adb.c
63279 +++ linux-2.6.24.7/drivers/macintosh/adb.c
63280 @@ -35,6 +35,7 @@
63281  #include <linux/spinlock.h>
63282  #include <linux/completion.h>
63283  #include <linux/device.h>
63284 +#include <linux/kthread.h>
63285  
63286  #include <asm/uaccess.h>
63287  #include <asm/semaphore.h>
63288 @@ -82,21 +83,11 @@ struct adb_driver *adb_controller;
63289  BLOCKING_NOTIFIER_HEAD(adb_client_list);
63290  static int adb_got_sleep;
63291  static int adb_inited;
63292 -static pid_t adb_probe_task_pid;
63293  static DECLARE_MUTEX(adb_probe_mutex);
63294 -static struct completion adb_probe_task_comp;
63295  static int sleepy_trackpad;
63296  static int autopoll_devs;
63297  int __adb_probe_sync;
63298  
63299 -#ifdef CONFIG_PM_SLEEP
63300 -static void adb_notify_sleep(struct pmu_sleep_notifier *self, int when);
63301 -static struct pmu_sleep_notifier adb_sleep_notifier = {
63302 -       adb_notify_sleep,
63303 -       SLEEP_LEVEL_ADB,
63304 -};
63305 -#endif
63306 -
63307  static int adb_scan_bus(void);
63308  static int do_adb_reset_bus(void);
63309  static void adbdev_init(void);
63310 @@ -134,16 +125,6 @@ static void printADBreply(struct adb_req
63311  }
63312  #endif
63313  
63314 -
63315 -static __inline__ void adb_wait_ms(unsigned int ms)
63316 -{
63317 -       if (current->pid && adb_probe_task_pid &&
63318 -         adb_probe_task_pid == current->pid)
63319 -               msleep(ms);
63320 -       else
63321 -               mdelay(ms);
63322 -}
63323 -
63324  static int adb_scan_bus(void)
63325  {
63326         int i, highFree=0, noMovement;
63327 @@ -248,13 +229,10 @@ static int adb_scan_bus(void)
63328  static int
63329  adb_probe_task(void *x)
63330  {
63331 -       strcpy(current->comm, "kadbprobe");
63332 -
63333         printk(KERN_INFO "adb: starting probe task...\n");
63334         do_adb_reset_bus();
63335         printk(KERN_INFO "adb: finished probe task...\n");
63336  
63337 -       adb_probe_task_pid = 0;
63338         up(&adb_probe_mutex);
63339  
63340         return 0;
63341 @@ -263,7 +241,7 @@ adb_probe_task(void *x)
63342  static void
63343  __adb_probe_task(struct work_struct *bullshit)
63344  {
63345 -       adb_probe_task_pid = kernel_thread(adb_probe_task, NULL, SIGCHLD | CLONE_KERNEL);
63346 +       kthread_run(adb_probe_task, NULL, "kadbprobe");
63347  }
63348  
63349  static DECLARE_WORK(adb_reset_work, __adb_probe_task);
63350 @@ -281,6 +259,36 @@ adb_reset_bus(void)
63351         return 0;
63352  }
63353  
63354 +#ifdef CONFIG_PM
63355 +/*
63356 + * notify clients before sleep
63357 + */
63358 +static int adb_suspend(struct platform_device *dev, pm_message_t state)
63359 +{
63360 +       adb_got_sleep = 1;
63361 +       /* We need to get a lock on the probe thread */
63362 +       down(&adb_probe_mutex);
63363 +       /* Stop autopoll */
63364 +       if (adb_controller->autopoll)
63365 +               adb_controller->autopoll(0);
63366 +       blocking_notifier_call_chain(&adb_client_list, ADB_MSG_POWERDOWN, NULL);
63367 +
63368 +       return 0;
63369 +}
63370 +
63371 +/*
63372 + * reset bus after sleep
63373 + */
63374 +static int adb_resume(struct platform_device *dev)
63375 +{
63376 +       adb_got_sleep = 0;
63377 +       up(&adb_probe_mutex);
63378 +       adb_reset_bus();
63379 +
63380 +       return 0;
63381 +}
63382 +#endif /* CONFIG_PM */
63383 +
63384  int __init adb_init(void)
63385  {
63386         struct adb_driver *driver;
63387 @@ -313,15 +321,12 @@ int __init adb_init(void)
63388                 printk(KERN_WARNING "Warning: no ADB interface detected\n");
63389                 adb_controller = NULL;
63390         } else {
63391 -#ifdef CONFIG_PM_SLEEP
63392 -               pmu_register_sleep_notifier(&adb_sleep_notifier);
63393 -#endif /* CONFIG_PM */
63394  #ifdef CONFIG_PPC
63395                 if (machine_is_compatible("AAPL,PowerBook1998") ||
63396                         machine_is_compatible("PowerBook1,1"))
63397                         sleepy_trackpad = 1;
63398  #endif /* CONFIG_PPC */
63399 -               init_completion(&adb_probe_task_comp);
63400 +
63401                 adbdev_init();
63402                 adb_reset_bus();
63403         }
63404 @@ -330,33 +335,6 @@ int __init adb_init(void)
63405  
63406  __initcall(adb_init);
63407  
63408 -#ifdef CONFIG_PM
63409 -/*
63410 - * notify clients before sleep and reset bus afterwards
63411 - */
63412 -void
63413 -adb_notify_sleep(struct pmu_sleep_notifier *self, int when)
63414 -{
63415 -       switch (when) {
63416 -       case PBOOK_SLEEP_REQUEST:
63417 -               adb_got_sleep = 1;
63418 -               /* We need to get a lock on the probe thread */
63419 -               down(&adb_probe_mutex);
63420 -               /* Stop autopoll */
63421 -               if (adb_controller->autopoll)
63422 -                       adb_controller->autopoll(0);
63423 -               blocking_notifier_call_chain(&adb_client_list,
63424 -                       ADB_MSG_POWERDOWN, NULL);
63425 -               break;
63426 -       case PBOOK_WAKE:
63427 -               adb_got_sleep = 0;
63428 -               up(&adb_probe_mutex);
63429 -               adb_reset_bus();
63430 -               break;
63431 -       }
63432 -}
63433 -#endif /* CONFIG_PM */
63434 -
63435  static int
63436  do_adb_reset_bus(void)
63437  {
63438 @@ -373,7 +351,7 @@ do_adb_reset_bus(void)
63439  
63440         if (sleepy_trackpad) {
63441                 /* Let the trackpad settle down */
63442 -               adb_wait_ms(500);
63443 +               msleep(500);
63444         }
63445  
63446         down(&adb_handler_sem);
63447 @@ -389,7 +367,7 @@ do_adb_reset_bus(void)
63448  
63449         if (sleepy_trackpad) {
63450                 /* Let the trackpad settle down */
63451 -               adb_wait_ms(1500);
63452 +               msleep(1500);
63453         }
63454  
63455         if (!ret) {
63456 @@ -413,41 +391,27 @@ adb_poll(void)
63457         adb_controller->poll();
63458  }
63459  
63460 -static void
63461 -adb_probe_wakeup(struct adb_request *req)
63462 +static void adb_sync_req_done(struct adb_request *req)
63463  {
63464 -       complete(&adb_probe_task_comp);
63465 -}
63466 +       struct completion *comp = req->arg;
63467  
63468 -/* Static request used during probe */
63469 -static struct adb_request adb_sreq;
63470 -static unsigned long adb_sreq_lock; // Use semaphore ! */ 
63471 +       complete(comp);
63472 +}
63473  
63474  int
63475  adb_request(struct adb_request *req, void (*done)(struct adb_request *),
63476             int flags, int nbytes, ...)
63477  {
63478         va_list list;
63479 -       int i, use_sreq;
63480 +       int i;
63481         int rc;
63482 +       struct completion comp;
63483  
63484         if ((adb_controller == NULL) || (adb_controller->send_request == NULL))
63485                 return -ENXIO;
63486         if (nbytes < 1)
63487                 return -EINVAL;
63488 -       if (req == NULL && (flags & ADBREQ_NOSEND))
63489 -               return -EINVAL;
63490 -       
63491 -       if (req == NULL) {
63492 -               if (test_and_set_bit(0,&adb_sreq_lock)) {
63493 -                       printk("adb.c: Warning: contention on static request !\n");
63494 -                       return -EPERM;
63495 -               }
63496 -               req = &adb_sreq;
63497 -               flags |= ADBREQ_SYNC;
63498 -               use_sreq = 1;
63499 -       } else
63500 -               use_sreq = 0;
63501 +
63502         req->nbytes = nbytes+1;
63503         req->done = done;
63504         req->reply_expected = flags & ADBREQ_REPLY;
63505 @@ -460,25 +424,18 @@ adb_request(struct adb_request *req, voi
63506         if (flags & ADBREQ_NOSEND)
63507                 return 0;
63508  
63509 -       /* Synchronous requests send from the probe thread cause it to
63510 -        * block. Beware that the "done" callback will be overriden !
63511 -        */
63512 -       if ((flags & ADBREQ_SYNC) &&
63513 -           (current->pid && adb_probe_task_pid &&
63514 -           adb_probe_task_pid == current->pid)) {
63515 -               req->done = adb_probe_wakeup;
63516 -               rc = adb_controller->send_request(req, 0);
63517 -               if (rc || req->complete)
63518 -                       goto bail;
63519 -               wait_for_completion(&adb_probe_task_comp);
63520 -               rc = 0;
63521 -               goto bail;
63522 -       }
63523 -
63524 -       rc = adb_controller->send_request(req, flags & ADBREQ_SYNC);
63525 -bail:
63526 -       if (use_sreq)
63527 -               clear_bit(0, &adb_sreq_lock);
63528 +       /* Synchronous requests block using an on-stack completion */
63529 +       if (flags & ADBREQ_SYNC) {
63530 +               WARN_ON(done);
63531 +               req->done = adb_sync_req_done;
63532 +               req->arg = &comp;
63533 +               init_completion(&comp);
63534 +       }
63535 +
63536 +       rc = adb_controller->send_request(req, 0);
63537 +
63538 +       if ((flags & ADBREQ_SYNC) && !rc && !req->complete)
63539 +               wait_for_completion(&comp);
63540  
63541         return rc;
63542  }
63543 @@ -864,7 +821,29 @@ static const struct file_operations adb_
63544         .release        = adb_release,
63545  };
63546  
63547 -static void
63548 +static struct platform_driver adb_pfdrv = {
63549 +       .driver = {
63550 +               .name = "adb",
63551 +       },
63552 +#ifdef CONFIG_PM
63553 +       .suspend = adb_suspend,
63554 +       .resume = adb_resume,
63555 +#endif
63556 +};
63557 +
63558 +static struct platform_device adb_pfdev = {
63559 +       .name = "adb",
63560 +};
63561 +
63562 +static int __init
63563 +adb_dummy_probe(struct platform_device *dev)
63564 +{
63565 +       if (dev == &adb_pfdev)
63566 +               return 0;
63567 +       return -ENODEV;
63568 +}
63569 +
63570 +static void __init
63571  adbdev_init(void)
63572  {
63573         if (register_chrdev(ADB_MAJOR, "adb", &adb_fops)) {
63574 @@ -876,4 +855,7 @@ adbdev_init(void)
63575         if (IS_ERR(adb_dev_class))
63576                 return;
63577         class_device_create(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb");
63578 +
63579 +       platform_device_register(&adb_pfdev);
63580 +       platform_driver_probe(&adb_pfdrv, adb_dummy_probe);
63581  }
63582 Index: linux-2.6.24.7/drivers/macintosh/mediabay.c
63583 ===================================================================
63584 --- linux-2.6.24.7.orig/drivers/macintosh/mediabay.c
63585 +++ linux-2.6.24.7/drivers/macintosh/mediabay.c
63586 @@ -20,6 +20,7 @@
63587  #include <linux/stddef.h>
63588  #include <linux/init.h>
63589  #include <linux/ide.h>
63590 +#include <linux/kthread.h>
63591  #include <asm/prom.h>
63592  #include <asm/pgtable.h>
63593  #include <asm/io.h>
63594 @@ -35,7 +36,6 @@
63595  
63596  
63597  #define MB_DEBUG
63598 -#define MB_IGNORE_SIGNALS
63599  
63600  #ifdef MB_DEBUG
63601  #define MBDBG(fmt, arg...)     printk(KERN_INFO fmt , ## arg)
63602 @@ -622,12 +622,7 @@ static int media_bay_task(void *x)
63603  {
63604         int     i;
63605  
63606 -       strcpy(current->comm, "media-bay");
63607 -#ifdef MB_IGNORE_SIGNALS
63608 -       sigfillset(&current->blocked);
63609 -#endif
63610 -
63611 -       for (;;) {
63612 +       while (!kthread_should_stop()) {
63613                 for (i = 0; i < media_bay_count; ++i) {
63614                         down(&media_bays[i].lock);
63615                         if (!media_bays[i].sleeping)
63616 @@ -636,9 +631,8 @@ static int media_bay_task(void *x)
63617                 }
63618  
63619                 msleep_interruptible(MB_POLL_DELAY);
63620 -               if (signal_pending(current))
63621 -                       return 0;
63622         }
63623 +       return 0;
63624  }
63625  
63626  static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_device_id *match)
63627 @@ -699,7 +693,7 @@ static int __devinit media_bay_attach(st
63628  
63629         /* Startup kernel thread */
63630         if (i == 0)
63631 -               kernel_thread(media_bay_task, NULL, CLONE_KERNEL);
63632 +               kthread_run(media_bay_task, NULL, "media-bay");
63633  
63634         return 0;
63635  
63636 Index: linux-2.6.24.7/drivers/macintosh/therm_adt746x.c
63637 ===================================================================
63638 --- linux-2.6.24.7.orig/drivers/macintosh/therm_adt746x.c
63639 +++ linux-2.6.24.7/drivers/macintosh/therm_adt746x.c
63640 @@ -553,6 +553,7 @@ thermostat_init(void)
63641         struct device_node* np;
63642         const u32 *prop;
63643         int i = 0, offset = 0;
63644 +       int err;
63645         
63646         np = of_find_node_by_name(NULL, "fan");
63647         if (!np)
63648 @@ -612,17 +613,20 @@ thermostat_init(void)
63649                 return -ENODEV;
63650         }
63651         
63652 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
63653 -       device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
63654 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
63655 -       device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
63656 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
63657 -       device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
63658 -       device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
63659 -       device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
63660 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
63661 +       err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
63662 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
63663 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
63664 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
63665 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
63666 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
63667 +       err |= device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
63668 +       err |= device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
63669 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
63670         if(therm_type == ADT7460)
63671 -               device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
63672 +               err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
63673 +       if (err)
63674 +               printk(KERN_WARNING
63675 +                       "Failed to create tempertaure attribute file(s).\n");
63676  
63677  #ifndef CONFIG_I2C_POWERMAC
63678         request_module("i2c-powermac");
63679 Index: linux-2.6.24.7/drivers/macintosh/therm_pm72.c
63680 ===================================================================
63681 --- linux-2.6.24.7.orig/drivers/macintosh/therm_pm72.c
63682 +++ linux-2.6.24.7/drivers/macintosh/therm_pm72.c
63683 @@ -121,6 +121,7 @@
63684  #include <linux/reboot.h>
63685  #include <linux/kmod.h>
63686  #include <linux/i2c.h>
63687 +#include <linux/kthread.h>
63688  #include <asm/prom.h>
63689  #include <asm/machdep.h>
63690  #include <asm/io.h>
63691 @@ -161,7 +162,7 @@ static struct slots_pid_state               slots_sta
63692  static int                             state;
63693  static int                             cpu_count;
63694  static int                             cpu_pid_type;
63695 -static pid_t                           ctrl_task;
63696 +static struct task_struct              *ctrl_task;
63697  static struct completion               ctrl_complete;
63698  static int                             critical_state;
63699  static int                             rackmac;
63700 @@ -1156,6 +1157,8 @@ static void do_monitor_cpu_rack(struct c
63701   */
63702  static int init_cpu_state(struct cpu_pid_state *state, int index)
63703  {
63704 +       int err;
63705 +
63706         state->index = index;
63707         state->first = 1;
63708         state->rpm = (cpu_pid_type == CPU_PID_TYPE_RACKMAC) ? 4000 : 1000;
63709 @@ -1181,18 +1184,21 @@ static int init_cpu_state(struct cpu_pid
63710         DBG("CPU %d Using %d power history entries\n", index, state->count_power);
63711  
63712         if (index == 0) {
63713 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
63714 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
63715 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
63716 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
63717 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
63718 +               err = device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
63719 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
63720 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
63721 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
63722 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
63723         } else {
63724 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
63725 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
63726 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
63727 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
63728 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
63729 -       }
63730 +               err = device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
63731 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
63732 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
63733 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
63734 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
63735 +       }
63736 +       if (err)
63737 +               printk(KERN_WARNING "Failed to create some of the atribute"
63738 +                       "files for CPU %d\n", index);
63739  
63740         return 0;
63741   fail:
63742 @@ -1328,6 +1334,7 @@ static int init_backside_state(struct ba
63743  {
63744         struct device_node *u3;
63745         int u3h = 1; /* conservative by default */
63746 +       int err;
63747  
63748         /*
63749          * There are different PID params for machines with U3 and machines
63750 @@ -1379,8 +1386,11 @@ static int init_backside_state(struct ba
63751         if (state->monitor == NULL)
63752                 return -ENODEV;
63753  
63754 -       device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
63755 -       device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
63756 +       err = device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
63757 +       err |= device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
63758 +       if (err)
63759 +               printk(KERN_WARNING "Failed to create attribute file(s)"
63760 +                       " for backside fan\n");
63761  
63762         return 0;
63763  }
63764 @@ -1491,6 +1501,8 @@ static void do_monitor_drives(struct dri
63765   */
63766  static int init_drives_state(struct drives_pid_state *state)
63767  {
63768 +       int err;
63769 +
63770         state->ticks = 1;
63771         state->first = 1;
63772         state->rpm = 1000;
63773 @@ -1499,8 +1511,11 @@ static int init_drives_state(struct driv
63774         if (state->monitor == NULL)
63775                 return -ENODEV;
63776  
63777 -       device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
63778 -       device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
63779 +       err = device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
63780 +       err |= device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
63781 +       if (err)
63782 +               printk(KERN_WARNING "Failed to create attribute file(s)"
63783 +                       " for drives bay fan\n");
63784  
63785         return 0;
63786  }
63787 @@ -1621,7 +1636,9 @@ static int init_dimms_state(struct dimm_
63788         if (state->monitor == NULL)
63789                 return -ENODEV;
63790  
63791 -               device_create_file(&of_dev->dev, &dev_attr_dimms_temperature);
63792 +       if (device_create_file(&of_dev->dev, &dev_attr_dimms_temperature))
63793 +               printk(KERN_WARNING "Failed to create attribute file"
63794 +                       " for DIMM temperature\n");
63795  
63796         return 0;
63797  }
63798 @@ -1731,6 +1748,8 @@ static void do_monitor_slots(struct slot
63799   */
63800  static int init_slots_state(struct slots_pid_state *state)
63801  {
63802 +       int err;
63803 +
63804         state->ticks = 1;
63805         state->first = 1;
63806         state->pwm = 50;
63807 @@ -1739,8 +1758,11 @@ static int init_slots_state(struct slots
63808         if (state->monitor == NULL)
63809                 return -ENODEV;
63810  
63811 -       device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
63812 -       device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
63813 +       err = device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
63814 +       err |= device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
63815 +       if (err)
63816 +               printk(KERN_WARNING "Failed to create attribute file(s)"
63817 +                       " for slots bay fan\n");
63818  
63819         return 0;
63820  }
63821 @@ -1779,8 +1801,6 @@ static int call_critical_overtemp(void)
63822   */
63823  static int main_control_loop(void *x)
63824  {
63825 -       daemonize("kfand");
63826 -
63827         DBG("main_control_loop started\n");
63828  
63829         down(&driver_lock);
63830 @@ -1956,7 +1976,7 @@ static void start_control_loops(void)
63831  {
63832         init_completion(&ctrl_complete);
63833  
63834 -       ctrl_task = kernel_thread(main_control_loop, NULL, SIGCHLD | CLONE_KERNEL);
63835 +       ctrl_task = kthread_run(main_control_loop, NULL, "kfand");
63836  }
63837  
63838  /*
63839 @@ -1964,7 +1984,7 @@ static void start_control_loops(void)
63840   */
63841  static void stop_control_loops(void)
63842  {
63843 -       if (ctrl_task != 0)
63844 +       if (ctrl_task)
63845                 wait_for_completion(&ctrl_complete);
63846  }
63847  
63848 Index: linux-2.6.24.7/drivers/macintosh/therm_windtunnel.c
63849 ===================================================================
63850 --- linux-2.6.24.7.orig/drivers/macintosh/therm_windtunnel.c
63851 +++ linux-2.6.24.7/drivers/macintosh/therm_windtunnel.c
63852 @@ -36,6 +36,7 @@
63853  #include <linux/i2c.h>
63854  #include <linux/slab.h>
63855  #include <linux/init.h>
63856 +#include <linux/kthread.h>
63857  
63858  #include <asm/prom.h>
63859  #include <asm/machdep.h>
63860 @@ -61,8 +62,7 @@ I2C_CLIENT_INSMOD;
63861  
63862  static struct {
63863         volatile int            running;
63864 -       struct completion       completion;
63865 -       pid_t                   poll_task;
63866 +       struct task_struct      *poll_task;
63867         
63868         struct semaphore        lock;
63869         struct of_device        *of_dev;
63870 @@ -223,6 +223,7 @@ static void
63871  setup_hardware( void )
63872  {
63873         int val;
63874 +       int err;
63875  
63876         /* save registers (if we unload the module) */
63877         x.r0 = read_reg( x.fan, 0x00, 1 );
63878 @@ -265,8 +266,11 @@ setup_hardware( void )
63879         x.upind = -1;
63880         /* tune_fan( fan_up_table[x.upind].fan_setting ); */
63881  
63882 -       device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
63883 -       device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
63884 +       err = device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
63885 +       err |= device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
63886 +       if (err)
63887 +               printk(KERN_WARNING
63888 +                       "Failed to create temperature attribute file(s).\n");
63889  }
63890  
63891  static void
63892 @@ -282,27 +286,27 @@ restore_regs( void )
63893         write_reg( x.fan, 0x00, x.r0, 1 );
63894  }
63895  
63896 -static int
63897 -control_loop( void *dummy )
63898 +static int control_loop(void *dummy)
63899  {
63900 -       daemonize("g4fand");
63901 -
63902 -       down( &x.lock );
63903 +       down(&x.lock);
63904         setup_hardware();
63905 +       up(&x.lock);
63906  
63907 -       while( x.running ) {
63908 -               up( &x.lock );
63909 -
63910 +       for (;;) {
63911                 msleep_interruptible(8000);
63912 -               
63913 -               down( &x.lock );
63914 +               if (kthread_should_stop())
63915 +                       break;
63916 +
63917 +               down(&x.lock);
63918                 poll_temp();
63919 +               up(&x.lock);
63920         }
63921  
63922 +       down(&x.lock);
63923         restore_regs();
63924 -       up( &x.lock );
63925 +       up(&x.lock);
63926  
63927 -       complete_and_exit( &x.completion, 0 );
63928 +       return 0;
63929  }
63930  
63931  
63932 @@ -322,8 +326,7 @@ do_attach( struct i2c_adapter *adapter )
63933                 ret = i2c_probe( adapter, &addr_data, &do_probe );
63934                 if( x.thermostat && x.fan ) {
63935                         x.running = 1;
63936 -                       init_completion( &x.completion );
63937 -                       x.poll_task = kernel_thread( control_loop, NULL, SIGCHLD | CLONE_KERNEL );
63938 +                       x.poll_task = kthread_run(control_loop, NULL, "g4fand");
63939                 }
63940         }
63941         return ret;
63942 @@ -339,7 +342,8 @@ do_detach( struct i2c_client *client )
63943         else {
63944                 if( x.running ) {
63945                         x.running = 0;
63946 -                       wait_for_completion( &x.completion );
63947 +                       kthread_stop(x.poll_task);
63948 +                       x.poll_task = NULL;
63949                 }
63950                 if( client == x.thermostat )
63951                         x.thermostat = NULL;
63952 Index: linux-2.6.24.7/drivers/macintosh/via-pmu-backlight.c
63953 ===================================================================
63954 --- linux-2.6.24.7.orig/drivers/macintosh/via-pmu-backlight.c
63955 +++ linux-2.6.24.7/drivers/macintosh/via-pmu-backlight.c
63956 @@ -22,7 +22,7 @@ static u8 bl_curve[FB_BACKLIGHT_LEVELS];
63957  
63958  static void pmu_backlight_init_curve(u8 off, u8 min, u8 max)
63959  {
63960 -       unsigned int i, flat, count, range = (max - min);
63961 +       int i, flat, count, range = (max - min);
63962  
63963         bl_curve[0] = off;
63964  
63965 @@ -68,17 +68,11 @@ static int pmu_backlight_get_level_brigh
63966         return pmulevel;
63967  }
63968  
63969 -static int pmu_backlight_update_status(struct backlight_device *bd)
63970 +static int __pmu_backlight_update_status(struct backlight_device *bd)
63971  {
63972         struct adb_request req;
63973 -       unsigned long flags;
63974         int level = bd->props.brightness;
63975  
63976 -       spin_lock_irqsave(&pmu_backlight_lock, flags);
63977 -
63978 -       /* Don't update brightness when sleeping */
63979 -       if (sleeping)
63980 -               goto out;
63981  
63982         if (bd->props.power != FB_BLANK_UNBLANK ||
63983             bd->props.fb_blank != FB_BLANK_UNBLANK)
63984 @@ -99,12 +93,23 @@ static int pmu_backlight_update_status(s
63985                 pmu_wait_complete(&req);
63986         }
63987  
63988 -out:
63989 -       spin_unlock_irqrestore(&pmu_backlight_lock, flags);
63990 -
63991         return 0;
63992  }
63993  
63994 +static int pmu_backlight_update_status(struct backlight_device *bd)
63995 +{
63996 +       unsigned long flags;
63997 +       int rc = 0;
63998 +
63999 +       spin_lock_irqsave(&pmu_backlight_lock, flags);
64000 +       /* Don't update brightness when sleeping */
64001 +       if (!sleeping)
64002 +               rc = __pmu_backlight_update_status(bd);
64003 +       spin_unlock_irqrestore(&pmu_backlight_lock, flags);
64004 +       return rc;
64005 +}
64006 +
64007 +
64008  static int pmu_backlight_get_brightness(struct backlight_device *bd)
64009  {
64010         return bd->props.brightness;
64011 @@ -123,6 +128,16 @@ void pmu_backlight_set_sleep(int sleep)
64012  
64013         spin_lock_irqsave(&pmu_backlight_lock, flags);
64014         sleeping = sleep;
64015 +       if (pmac_backlight) {
64016 +               if (sleep) {
64017 +                       struct adb_request req;
64018 +
64019 +                       pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
64020 +                                   PMU_POW_BACKLIGHT | PMU_POW_OFF);
64021 +                       pmu_wait_complete(&req);
64022 +               } else
64023 +                       __pmu_backlight_update_status(pmac_backlight);
64024 +       }
64025         spin_unlock_irqrestore(&pmu_backlight_lock, flags);
64026  }
64027  #endif /* CONFIG_PM */
64028 @@ -148,8 +163,8 @@ void __init pmu_backlight_init()
64029  
64030         bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data);
64031         if (IS_ERR(bd)) {
64032 -               printk("pmubl: Backlight registration failed\n");
64033 -               goto error;
64034 +               printk(KERN_ERR "PMU Backlight registration failed\n");
64035 +               return;
64036         }
64037         bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
64038         pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
64039 @@ -171,10 +186,5 @@ void __init pmu_backlight_init()
64040         bd->props.power = FB_BLANK_UNBLANK;
64041         backlight_update_status(bd);
64042  
64043 -       printk("pmubl: Backlight initialized (%s)\n", name);
64044 -
64045 -       return;
64046 -
64047 -error:
64048 -       return;
64049 +       printk(KERN_INFO "PMU Backlight initialized (%s)\n", name);
64050  }
64051 Index: linux-2.6.24.7/drivers/macintosh/via-pmu.c
64052 ===================================================================
64053 --- linux-2.6.24.7.orig/drivers/macintosh/via-pmu.c
64054 +++ linux-2.6.24.7/drivers/macintosh/via-pmu.c
64055 @@ -10,13 +10,11 @@
64056   *
64057   * Copyright (C) 1998 Paul Mackerras and Fabio Riccardi.
64058   * Copyright (C) 2001-2002 Benjamin Herrenschmidt
64059 + * Copyright (C) 2006-2007 Johannes Berg
64060   *
64061   * THIS DRIVER IS BECOMING A TOTAL MESS !
64062   *  - Cleanup atomically disabling reply to PMU events after
64063   *    a sleep or a freq. switch
64064 - *  - Move sleep code out of here to pmac_pm, merge into new
64065 - *    common PM infrastructure
64066 - *  - Save/Restore PCI space properly
64067   *
64068   */
64069  #include <stdarg.h>
64070 @@ -33,7 +31,6 @@
64071  #include <linux/adb.h>
64072  #include <linux/pmu.h>
64073  #include <linux/cuda.h>
64074 -#include <linux/smp_lock.h>
64075  #include <linux/module.h>
64076  #include <linux/spinlock.h>
64077  #include <linux/pm.h>
64078 @@ -65,9 +62,7 @@
64079  #include "via-pmu-event.h"
64080  
64081  /* Some compile options */
64082 -#undef SUSPEND_USES_PMU
64083 -#define DEBUG_SLEEP
64084 -#undef HACKED_PCI_SAVE
64085 +#undef DEBUG_SLEEP
64086  
64087  /* Misc minor number allocated for /dev/pmu */
64088  #define PMU_MINOR              154
64089 @@ -152,12 +147,9 @@ static spinlock_t pmu_lock;
64090  static u8 pmu_intr_mask;
64091  static int pmu_version;
64092  static int drop_interrupts;
64093 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64094 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64095  static int option_lid_wakeup = 1;
64096 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64097 -#if (defined(CONFIG_PM_SLEEP)&&defined(CONFIG_PPC32))||defined(CONFIG_PMAC_BACKLIGHT_LEGACY)
64098 -static int sleep_in_progress;
64099 -#endif
64100 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64101  static unsigned long async_req_locks;
64102  static unsigned int pmu_irq_stats[11];
64103  
64104 @@ -177,7 +169,6 @@ static struct proc_dir_entry *proc_pmu_b
64105  
64106  int __fake_sleep;
64107  int asleep;
64108 -BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
64109  
64110  #ifdef CONFIG_ADB
64111  static int adb_dev_map;
64112 @@ -224,7 +215,7 @@ extern void enable_kernel_fp(void);
64113  
64114  #ifdef DEBUG_SLEEP
64115  int pmu_polled_request(struct adb_request *req);
64116 -int pmu_wink(struct adb_request *req);
64117 +void pmu_blink(int n);
64118  #endif
64119  
64120  /*
64121 @@ -875,7 +866,7 @@ proc_read_options(char *page, char **sta
64122  {
64123         char *p = page;
64124  
64125 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64126 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64127         if (pmu_kind == PMU_KEYLARGO_BASED &&
64128             pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
64129                 p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup);
64130 @@ -916,7 +907,7 @@ proc_write_options(struct file *file, co
64131         *(val++) = 0;
64132         while(*val == ' ')
64133                 val++;
64134 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64135 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64136         if (pmu_kind == PMU_KEYLARGO_BASED &&
64137             pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
64138                 if (!strcmp(label, "lid_wakeup"))
64139 @@ -1256,9 +1247,7 @@ void
64140  pmu_suspend(void)
64141  {
64142         unsigned long flags;
64143 -#ifdef SUSPEND_USES_PMU
64144 -       struct adb_request *req;
64145 -#endif
64146 +
64147         if (!via)
64148                 return;
64149         
64150 @@ -1276,17 +1265,10 @@ pmu_suspend(void)
64151                 via_pmu_interrupt(0, NULL);
64152                 spin_lock_irqsave(&pmu_lock, flags);
64153                 if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) {
64154 -#ifdef SUSPEND_USES_PMU
64155 -                       pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
64156 -                       spin_unlock_irqrestore(&pmu_lock, flags);
64157 -                       while(!req.complete)
64158 -                               pmu_poll();
64159 -#else /* SUSPEND_USES_PMU */
64160                         if (gpio_irq >= 0)
64161                                 disable_irq_nosync(gpio_irq);
64162                         out_8(&via[IER], CB1_INT | IER_CLR);
64163                         spin_unlock_irqrestore(&pmu_lock, flags);
64164 -#endif /* SUSPEND_USES_PMU */
64165                         break;
64166                 }
64167         } while (1);
64168 @@ -1307,18 +1289,11 @@ pmu_resume(void)
64169                 return;
64170         }
64171         adb_int_pending = 1;
64172 -#ifdef SUSPEND_USES_PMU
64173 -       pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
64174 -       spin_unlock_irqrestore(&pmu_lock, flags);
64175 -       while(!req.complete)
64176 -               pmu_poll();
64177 -#else /* SUSPEND_USES_PMU */
64178         if (gpio_irq >= 0)
64179                 enable_irq(gpio_irq);
64180         out_8(&via[IER], CB1_INT | IER_SET);
64181         spin_unlock_irqrestore(&pmu_lock, flags);
64182         pmu_poll();
64183 -#endif /* SUSPEND_USES_PMU */
64184  }
64185  
64186  /* Interrupt data could be the result data from an ADB cmd */
64187 @@ -1738,228 +1713,7 @@ pmu_present(void)
64188         return via != 0;
64189  }
64190  
64191 -#ifdef CONFIG_PM_SLEEP
64192 -
64193 -static LIST_HEAD(sleep_notifiers);
64194 -
64195 -int
64196 -pmu_register_sleep_notifier(struct pmu_sleep_notifier *n)
64197 -{
64198 -       struct list_head *list;
64199 -       struct pmu_sleep_notifier *notifier;
64200 -
64201 -       for (list = sleep_notifiers.next; list != &sleep_notifiers;
64202 -            list = list->next) {
64203 -               notifier = list_entry(list, struct pmu_sleep_notifier, list);
64204 -               if (n->priority > notifier->priority)
64205 -                       break;
64206 -       }
64207 -       __list_add(&n->list, list->prev, list);
64208 -       return 0;
64209 -}
64210 -EXPORT_SYMBOL(pmu_register_sleep_notifier);
64211 -
64212 -int
64213 -pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* n)
64214 -{
64215 -       if (n->list.next == 0)
64216 -               return -ENOENT;
64217 -       list_del(&n->list);
64218 -       n->list.next = NULL;
64219 -       return 0;
64220 -}
64221 -EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
64222 -#endif /* CONFIG_PM_SLEEP */
64223 -
64224 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64225 -
64226 -/* Sleep is broadcast last-to-first */
64227 -static void broadcast_sleep(int when)
64228 -{
64229 -       struct list_head *list;
64230 -       struct pmu_sleep_notifier *notifier;
64231 -
64232 -       for (list = sleep_notifiers.prev; list != &sleep_notifiers;
64233 -            list = list->prev) {
64234 -               notifier = list_entry(list, struct pmu_sleep_notifier, list);
64235 -               notifier->notifier_call(notifier, when);
64236 -       }
64237 -}
64238 -
64239 -/* Wake is broadcast first-to-last */
64240 -static void broadcast_wake(void)
64241 -{
64242 -       struct list_head *list;
64243 -       struct pmu_sleep_notifier *notifier;
64244 -
64245 -       for (list = sleep_notifiers.next; list != &sleep_notifiers;
64246 -            list = list->next) {
64247 -               notifier = list_entry(list, struct pmu_sleep_notifier, list);
64248 -               notifier->notifier_call(notifier, PBOOK_WAKE);
64249 -       }
64250 -}
64251 -
64252 -/*
64253 - * This struct is used to store config register values for
64254 - * PCI devices which may get powered off when we sleep.
64255 - */
64256 -static struct pci_save {
64257 -#ifndef HACKED_PCI_SAVE
64258 -       u16     command;
64259 -       u16     cache_lat;
64260 -       u16     intr;
64261 -       u32     rom_address;
64262 -#else
64263 -       u32     config[16];
64264 -#endif 
64265 -} *pbook_pci_saves;
64266 -static int pbook_npci_saves;
64267 -
64268 -static void
64269 -pbook_alloc_pci_save(void)
64270 -{
64271 -       int npci;
64272 -       struct pci_dev *pd = NULL;
64273 -
64274 -       npci = 0;
64275 -       while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
64276 -               ++npci;
64277 -       }
64278 -       if (npci == 0)
64279 -               return;
64280 -       pbook_pci_saves = (struct pci_save *)
64281 -               kmalloc(npci * sizeof(struct pci_save), GFP_KERNEL);
64282 -       pbook_npci_saves = npci;
64283 -}
64284 -
64285 -static void
64286 -pbook_free_pci_save(void)
64287 -{
64288 -       if (pbook_pci_saves == NULL)
64289 -               return;
64290 -       kfree(pbook_pci_saves);
64291 -       pbook_pci_saves = NULL;
64292 -       pbook_npci_saves = 0;
64293 -}
64294 -
64295 -static void
64296 -pbook_pci_save(void)
64297 -{
64298 -       struct pci_save *ps = pbook_pci_saves;
64299 -       struct pci_dev *pd = NULL;
64300 -       int npci = pbook_npci_saves;
64301 -       
64302 -       if (ps == NULL)
64303 -               return;
64304 -
64305 -       while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
64306 -               if (npci-- == 0) {
64307 -                       pci_dev_put(pd);
64308 -                       return;
64309 -               }
64310 -#ifndef HACKED_PCI_SAVE
64311 -               pci_read_config_word(pd, PCI_COMMAND, &ps->command);
64312 -               pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
64313 -               pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr);
64314 -               pci_read_config_dword(pd, PCI_ROM_ADDRESS, &ps->rom_address);
64315 -#else
64316 -               int i;
64317 -               for (i=1;i<16;i++)
64318 -                       pci_read_config_dword(pd, i<<4, &ps->config[i]);
64319 -#endif
64320 -               ++ps;
64321 -       }
64322 -}
64323 -
64324 -/* For this to work, we must take care of a few things: If gmac was enabled
64325 - * during boot, it will be in the pci dev list. If it's disabled at this point
64326 - * (and it will probably be), then you can't access it's config space.
64327 - */
64328 -static void
64329 -pbook_pci_restore(void)
64330 -{
64331 -       u16 cmd;
64332 -       struct pci_save *ps = pbook_pci_saves - 1;
64333 -       struct pci_dev *pd = NULL;
64334 -       int npci = pbook_npci_saves;
64335 -       int j;
64336 -
64337 -       while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
64338 -#ifdef HACKED_PCI_SAVE
64339 -               int i;
64340 -               if (npci-- == 0) {
64341 -                       pci_dev_put(pd);
64342 -                       return;
64343 -               }
64344 -               ps++;
64345 -               for (i=2;i<16;i++)
64346 -                       pci_write_config_dword(pd, i<<4, ps->config[i]);
64347 -               pci_write_config_dword(pd, 4, ps->config[1]);
64348 -#else
64349 -               if (npci-- == 0)
64350 -                       return;
64351 -               ps++;
64352 -               if (ps->command == 0)
64353 -                       continue;
64354 -               pci_read_config_word(pd, PCI_COMMAND, &cmd);
64355 -               if ((ps->command & ~cmd) == 0)
64356 -                       continue;
64357 -               switch (pd->hdr_type) {
64358 -               case PCI_HEADER_TYPE_NORMAL:
64359 -                       for (j = 0; j < 6; ++j)
64360 -                               pci_write_config_dword(pd,
64361 -                                       PCI_BASE_ADDRESS_0 + j*4,
64362 -                                       pd->resource[j].start);
64363 -                       pci_write_config_dword(pd, PCI_ROM_ADDRESS,
64364 -                               ps->rom_address);
64365 -                       pci_write_config_word(pd, PCI_CACHE_LINE_SIZE,
64366 -                               ps->cache_lat);
64367 -                       pci_write_config_word(pd, PCI_INTERRUPT_LINE,
64368 -                               ps->intr);
64369 -                       pci_write_config_word(pd, PCI_COMMAND, ps->command);
64370 -                       break;
64371 -               }
64372 -#endif 
64373 -       }
64374 -}
64375 -
64376 -#ifdef DEBUG_SLEEP
64377 -/* N.B. This doesn't work on the 3400 */
64378 -void 
64379 -pmu_blink(int n)
64380 -{
64381 -       struct adb_request req;
64382 -
64383 -       memset(&req, 0, sizeof(req));
64384 -
64385 -       for (; n > 0; --n) {
64386 -               req.nbytes = 4;
64387 -               req.done = NULL;
64388 -               req.data[0] = 0xee;
64389 -               req.data[1] = 4;
64390 -               req.data[2] = 0;
64391 -               req.data[3] = 1;
64392 -               req.reply[0] = ADB_RET_OK;
64393 -               req.reply_len = 1;
64394 -               req.reply_expected = 0;
64395 -               pmu_polled_request(&req);
64396 -               mdelay(50);
64397 -               req.nbytes = 4;
64398 -               req.done = NULL;
64399 -               req.data[0] = 0xee;
64400 -               req.data[1] = 4;
64401 -               req.data[2] = 0;
64402 -               req.data[3] = 0;
64403 -               req.reply[0] = ADB_RET_OK;
64404 -               req.reply_len = 1;
64405 -               req.reply_expected = 0;
64406 -               pmu_polled_request(&req);
64407 -               mdelay(50);
64408 -       }
64409 -       mdelay(50);
64410 -}
64411 -#endif
64412 -
64413 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64414  /*
64415   * Put the powerbook to sleep.
64416   */
64417 @@ -1994,134 +1748,6 @@ restore_via_state(void)
64418         out_8(&via[IER], IER_SET | SR_INT | CB1_INT);
64419  }
64420  
64421 -extern void pmu_backlight_set_sleep(int sleep);
64422 -
64423 -static int
64424 -pmac_suspend_devices(void)
64425 -{
64426 -       int ret;
64427 -
64428 -       pm_prepare_console();
64429 -       
64430 -       /* Notify old-style device drivers */
64431 -       broadcast_sleep(PBOOK_SLEEP_REQUEST);
64432 -
64433 -       /* Sync the disks. */
64434 -       /* XXX It would be nice to have some way to ensure that
64435 -        * nobody is dirtying any new buffers while we wait. That
64436 -        * could be achieved using the refrigerator for processes
64437 -        * that swsusp uses
64438 -        */
64439 -       sys_sync();
64440 -
64441 -       broadcast_sleep(PBOOK_SLEEP_NOW);
64442 -
64443 -       /* Send suspend call to devices, hold the device core's dpm_sem */
64444 -       ret = device_suspend(PMSG_SUSPEND);
64445 -       if (ret) {
64446 -               broadcast_wake();
64447 -               printk(KERN_ERR "Driver sleep failed\n");
64448 -               return -EBUSY;
64449 -       }
64450 -
64451 -#ifdef CONFIG_PMAC_BACKLIGHT
64452 -       /* Tell backlight code not to muck around with the chip anymore */
64453 -       pmu_backlight_set_sleep(1);
64454 -#endif
64455 -
64456 -       /* Call platform functions marked "on sleep" */
64457 -       pmac_pfunc_i2c_suspend();
64458 -       pmac_pfunc_base_suspend();
64459 -
64460 -       /* Stop preemption */
64461 -       preempt_disable();
64462 -
64463 -       /* Make sure the decrementer won't interrupt us */
64464 -       asm volatile("mtdec %0" : : "r" (0x7fffffff));
64465 -       /* Make sure any pending DEC interrupt occurring while we did
64466 -        * the above didn't re-enable the DEC */
64467 -       mb();
64468 -       asm volatile("mtdec %0" : : "r" (0x7fffffff));
64469 -
64470 -       /* We can now disable MSR_EE. This code of course works properly only
64471 -        * on UP machines... For SMP, if we ever implement sleep, we'll have to
64472 -        * stop the "other" CPUs way before we do all that stuff.
64473 -        */
64474 -       local_irq_disable();
64475 -
64476 -       /* Broadcast power down irq
64477 -        * This isn't that useful in most cases (only directly wired devices can
64478 -        * use this but still... This will take care of sysdev's as well, so
64479 -        * we exit from here with local irqs disabled and PIC off.
64480 -        */
64481 -       ret = device_power_down(PMSG_SUSPEND);
64482 -       if (ret) {
64483 -               wakeup_decrementer();
64484 -               local_irq_enable();
64485 -               preempt_enable();
64486 -               device_resume();
64487 -               broadcast_wake();
64488 -               printk(KERN_ERR "Driver powerdown failed\n");
64489 -               return -EBUSY;
64490 -       }
64491 -
64492 -       /* Wait for completion of async requests */
64493 -       while (!batt_req.complete)
64494 -               pmu_poll();
64495 -
64496 -       /* Giveup the lazy FPU & vec so we don't have to back them
64497 -        * up from the low level code
64498 -        */
64499 -       enable_kernel_fp();
64500 -
64501 -#ifdef CONFIG_ALTIVEC
64502 -       if (cpu_has_feature(CPU_FTR_ALTIVEC))
64503 -               enable_kernel_altivec();
64504 -#endif /* CONFIG_ALTIVEC */
64505 -
64506 -       return 0;
64507 -}
64508 -
64509 -static int
64510 -pmac_wakeup_devices(void)
64511 -{
64512 -       mdelay(100);
64513 -
64514 -#ifdef CONFIG_PMAC_BACKLIGHT
64515 -       /* Tell backlight code it can use the chip again */
64516 -       pmu_backlight_set_sleep(0);
64517 -#endif
64518 -
64519 -       /* Power back up system devices (including the PIC) */
64520 -       device_power_up();
64521 -
64522 -       /* Force a poll of ADB interrupts */
64523 -       adb_int_pending = 1;
64524 -       via_pmu_interrupt(0, NULL);
64525 -
64526 -       /* Restart jiffies & scheduling */
64527 -       wakeup_decrementer();
64528 -
64529 -       /* Re-enable local CPU interrupts */
64530 -       local_irq_enable();
64531 -       mdelay(10);
64532 -       preempt_enable();
64533 -
64534 -       /* Call platform functions marked "on wake" */
64535 -       pmac_pfunc_base_resume();
64536 -       pmac_pfunc_i2c_resume();
64537 -
64538 -       /* Resume devices */
64539 -       device_resume();
64540 -
64541 -       /* Notify old style drivers */
64542 -       broadcast_wake();
64543 -
64544 -       pm_restore_console();
64545 -
64546 -       return 0;
64547 -}
64548 -
64549  #define        GRACKLE_PM      (1<<7)
64550  #define GRACKLE_DOZE   (1<<5)
64551  #define        GRACKLE_NAP     (1<<4)
64552 @@ -2132,19 +1758,12 @@ static int powerbook_sleep_grackle(void)
64553         unsigned long save_l2cr;
64554         unsigned short pmcr1;
64555         struct adb_request req;
64556 -       int ret;
64557         struct pci_dev *grackle;
64558  
64559         grackle = pci_get_bus_and_slot(0, 0);
64560         if (!grackle)
64561                 return -ENODEV;
64562  
64563 -       ret = pmac_suspend_devices();
64564 -       if (ret) {
64565 -               printk(KERN_ERR "Sleep rejected by devices\n");
64566 -               return ret;
64567 -       }
64568 -       
64569         /* Turn off various things. Darwin does some retry tests here... */
64570         pmu_request(&req, NULL, 2, PMU_POWER_CTRL0, PMU_POW0_OFF|PMU_POW0_HARD_DRIVE);
64571         pmu_wait_complete(&req);
64572 @@ -2207,8 +1826,6 @@ static int powerbook_sleep_grackle(void)
64573                         PMU_POW_ON|PMU_POW_BACKLIGHT|PMU_POW_CHARGER|PMU_POW_IRLED|PMU_POW_MEDIABAY);
64574         pmu_wait_complete(&req);
64575  
64576 -       pmac_wakeup_devices();
64577 -
64578         return 0;
64579  }
64580  
64581 @@ -2218,7 +1835,6 @@ powerbook_sleep_Core99(void)
64582         unsigned long save_l2cr;
64583         unsigned long save_l3cr;
64584         struct adb_request req;
64585 -       int ret;
64586         
64587         if (pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) < 0) {
64588                 printk(KERN_ERR "Sleep mode not supported on this machine\n");
64589 @@ -2228,12 +1844,6 @@ powerbook_sleep_Core99(void)
64590         if (num_online_cpus() > 1 || cpu_is_offline(0))
64591                 return -EAGAIN;
64592  
64593 -       ret = pmac_suspend_devices();
64594 -       if (ret) {
64595 -               printk(KERN_ERR "Sleep rejected by devices\n");
64596 -               return ret;
64597 -       }
64598 -
64599         /* Stop environment and ADB interrupts */
64600         pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
64601         pmu_wait_complete(&req);
64602 @@ -2304,45 +1914,33 @@ powerbook_sleep_Core99(void)
64603         /* Restore LPJ, cpufreq will adjust the cpu frequency */
64604         loops_per_jiffy /= 2;
64605  
64606 -       pmac_wakeup_devices();
64607 -
64608         return 0;
64609  }
64610  
64611  #define PB3400_MEM_CTRL                0xf8000000
64612  #define PB3400_MEM_CTRL_SLEEP  0x70
64613  
64614 -static int
64615 -powerbook_sleep_3400(void)
64616 +static void __iomem *pb3400_mem_ctrl;
64617 +
64618 +static void powerbook_sleep_init_3400(void)
64619  {
64620 -       int ret, i, x;
64621 +       /* map in the memory controller registers */
64622 +       pb3400_mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100);
64623 +       if (pb3400_mem_ctrl == NULL)
64624 +               printk(KERN_WARNING "ioremap failed: sleep won't be possible");
64625 +}
64626 +
64627 +static int powerbook_sleep_3400(void)
64628 +{
64629 +       int i, x;
64630         unsigned int hid0;
64631 -       unsigned long p;
64632 +       unsigned long msr;
64633         struct adb_request sleep_req;
64634 -       void __iomem *mem_ctrl;
64635         unsigned int __iomem *mem_ctrl_sleep;
64636  
64637 -       /* first map in the memory controller registers */
64638 -       mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100);
64639 -       if (mem_ctrl == NULL) {
64640 -               printk("powerbook_sleep_3400: ioremap failed\n");
64641 +       if (pb3400_mem_ctrl == NULL)
64642                 return -ENOMEM;
64643 -       }
64644 -       mem_ctrl_sleep = mem_ctrl + PB3400_MEM_CTRL_SLEEP;
64645 -
64646 -       /* Allocate room for PCI save */
64647 -       pbook_alloc_pci_save();
64648 -
64649 -       ret = pmac_suspend_devices();
64650 -       if (ret) {
64651 -               pbook_free_pci_save();
64652 -               iounmap(mem_ctrl);
64653 -               printk(KERN_ERR "Sleep rejected by devices\n");
64654 -               return ret;
64655 -       }
64656 -
64657 -       /* Save the state of PCI config space for some slots */
64658 -       pbook_pci_save();
64659 +       mem_ctrl_sleep = pb3400_mem_ctrl + PB3400_MEM_CTRL_SLEEP;
64660  
64661         /* Set the memory controller to keep the memory refreshed
64662            while we're asleep */
64663 @@ -2357,41 +1955,34 @@ powerbook_sleep_3400(void)
64664  
64665         /* Ask the PMU to put us to sleep */
64666         pmu_request(&sleep_req, NULL, 5, PMU_SLEEP, 'M', 'A', 'T', 'T');
64667 -       while (!sleep_req.complete)
64668 -               mb();
64669 +       pmu_wait_complete(&sleep_req);
64670 +       pmu_unlock();
64671  
64672 -       pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,1);
64673 +       pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, 1);
64674  
64675 -       /* displacement-flush the L2 cache - necessary? */
64676 -       for (p = KERNELBASE; p < KERNELBASE + 0x100000; p += 0x1000)
64677 -               i = *(volatile int *)p;
64678         asleep = 1;
64679  
64680         /* Put the CPU into sleep mode */
64681         hid0 = mfspr(SPRN_HID0);
64682         hid0 = (hid0 & ~(HID0_NAP | HID0_DOZE)) | HID0_SLEEP;
64683         mtspr(SPRN_HID0, hid0);
64684 -       mtmsr(mfmsr() | MSR_POW | MSR_EE);
64685 -       udelay(10);
64686 +       local_irq_enable();
64687 +       msr = mfmsr() | MSR_POW;
64688 +       while (asleep) {
64689 +               mb();
64690 +               mtmsr(msr);
64691 +               isync();
64692 +       }
64693 +       local_irq_disable();
64694  
64695         /* OK, we're awake again, start restoring things */
64696         out_be32(mem_ctrl_sleep, 0x3f);
64697 -       pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,0);
64698 -       pbook_pci_restore();
64699 -       pmu_unlock();
64700 -
64701 -       /* wait for the PMU interrupt sequence to complete */
64702 -       while (asleep)
64703 -               mb();
64704 -
64705 -       pmac_wakeup_devices();
64706 -       pbook_free_pci_save();
64707 -       iounmap(mem_ctrl);
64708 +       pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, 0);
64709  
64710         return 0;
64711  }
64712  
64713 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64714 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64715  
64716  /*
64717   * Support for /dev/pmu device
64718 @@ -2548,7 +2139,6 @@ pmu_release(struct inode *inode, struct 
64719         struct pmu_private *pp = file->private_data;
64720         unsigned long flags;
64721  
64722 -       lock_kernel();
64723         if (pp != 0) {
64724                 file->private_data = NULL;
64725                 spin_lock_irqsave(&all_pvt_lock, flags);
64726 @@ -2562,10 +2152,96 @@ pmu_release(struct inode *inode, struct 
64727  
64728                 kfree(pp);
64729         }
64730 -       unlock_kernel();
64731         return 0;
64732  }
64733  
64734 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64735 +static void pmac_suspend_disable_irqs(void)
64736 +{
64737 +       /* Call platform functions marked "on sleep" */
64738 +       pmac_pfunc_i2c_suspend();
64739 +       pmac_pfunc_base_suspend();
64740 +}
64741 +
64742 +static int powerbook_sleep(suspend_state_t state)
64743 +{
64744 +       int error = 0;
64745 +
64746 +       /* Wait for completion of async requests */
64747 +       while (!batt_req.complete)
64748 +               pmu_poll();
64749 +
64750 +       /* Giveup the lazy FPU & vec so we don't have to back them
64751 +        * up from the low level code
64752 +        */
64753 +       enable_kernel_fp();
64754 +
64755 +#ifdef CONFIG_ALTIVEC
64756 +       if (cpu_has_feature(CPU_FTR_ALTIVEC))
64757 +               enable_kernel_altivec();
64758 +#endif /* CONFIG_ALTIVEC */
64759 +
64760 +       switch (pmu_kind) {
64761 +       case PMU_OHARE_BASED:
64762 +               error = powerbook_sleep_3400();
64763 +               break;
64764 +       case PMU_HEATHROW_BASED:
64765 +       case PMU_PADDINGTON_BASED:
64766 +               error = powerbook_sleep_grackle();
64767 +               break;
64768 +       case PMU_KEYLARGO_BASED:
64769 +               error = powerbook_sleep_Core99();
64770 +               break;
64771 +       default:
64772 +               return -ENOSYS;
64773 +       }
64774 +
64775 +       if (error)
64776 +               return error;
64777 +
64778 +       mdelay(100);
64779 +
64780 +       return 0;
64781 +}
64782 +
64783 +static void pmac_suspend_enable_irqs(void)
64784 +{
64785 +       /* Force a poll of ADB interrupts */
64786 +       adb_int_pending = 1;
64787 +       via_pmu_interrupt(0, NULL);
64788 +
64789 +       mdelay(10);
64790 +
64791 +       /* Call platform functions marked "on wake" */
64792 +       pmac_pfunc_base_resume();
64793 +       pmac_pfunc_i2c_resume();
64794 +}
64795 +
64796 +static int pmu_sleep_valid(suspend_state_t state)
64797 +{
64798 +       return state == PM_SUSPEND_MEM
64799 +               && (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) >= 0);
64800 +}
64801 +
64802 +static struct platform_suspend_ops pmu_pm_ops = {
64803 +       .enter = powerbook_sleep,
64804 +       .valid = pmu_sleep_valid,
64805 +};
64806 +
64807 +static int register_pmu_pm_ops(void)
64808 +{
64809 +       if (pmu_kind == PMU_OHARE_BASED)
64810 +               powerbook_sleep_init_3400();
64811 +       ppc_md.suspend_disable_irqs = pmac_suspend_disable_irqs;
64812 +       ppc_md.suspend_enable_irqs = pmac_suspend_enable_irqs;
64813 +       suspend_set_ops(&pmu_pm_ops);
64814 +
64815 +       return 0;
64816 +}
64817 +
64818 +device_initcall(register_pmu_pm_ops);
64819 +#endif
64820 +
64821  static int
64822  pmu_ioctl(struct inode * inode, struct file *filp,
64823                      u_int cmd, u_long arg)
64824 @@ -2574,35 +2250,15 @@ pmu_ioctl(struct inode * inode, struct f
64825         int error = -EINVAL;
64826  
64827         switch (cmd) {
64828 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64829         case PMU_IOC_SLEEP:
64830                 if (!capable(CAP_SYS_ADMIN))
64831                         return -EACCES;
64832 -               if (sleep_in_progress)
64833 -                       return -EBUSY;
64834 -               sleep_in_progress = 1;
64835 -               switch (pmu_kind) {
64836 -               case PMU_OHARE_BASED:
64837 -                       error = powerbook_sleep_3400();
64838 -                       break;
64839 -               case PMU_HEATHROW_BASED:
64840 -               case PMU_PADDINGTON_BASED:
64841 -                       error = powerbook_sleep_grackle();
64842 -                       break;
64843 -               case PMU_KEYLARGO_BASED:
64844 -                       error = powerbook_sleep_Core99();
64845 -                       break;
64846 -               default:
64847 -                       error = -ENOSYS;
64848 -               }
64849 -               sleep_in_progress = 0;
64850 -               break;
64851 +               return pm_suspend(PM_SUSPEND_MEM);
64852         case PMU_IOC_CAN_SLEEP:
64853 -               if (pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) < 0)
64854 +               if (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) < 0)
64855                         return put_user(0, argp);
64856                 else
64857                         return put_user(1, argp);
64858 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64859  
64860  #ifdef CONFIG_PMAC_BACKLIGHT_LEGACY
64861         /* Compatibility ioctl's for backlight */
64862 @@ -2610,9 +2266,6 @@ pmu_ioctl(struct inode * inode, struct f
64863         {
64864                 int brightness;
64865  
64866 -               if (sleep_in_progress)
64867 -                       return -EBUSY;
64868 -
64869                 brightness = pmac_backlight_get_legacy_brightness();
64870                 if (brightness < 0)
64871                         return brightness;
64872 @@ -2624,9 +2277,6 @@ pmu_ioctl(struct inode * inode, struct f
64873         {
64874                 int brightness;
64875  
64876 -               if (sleep_in_progress)
64877 -                       return -EBUSY;
64878 -
64879                 error = get_user(brightness, argp);
64880                 if (error)
64881                         return error;
64882 @@ -2751,15 +2401,43 @@ pmu_polled_request(struct adb_request *r
64883         local_irq_restore(flags);
64884         return 0;
64885  }
64886 -#endif /* DEBUG_SLEEP */
64887  
64888 +/* N.B. This doesn't work on the 3400 */
64889 +void pmu_blink(int n)
64890 +{
64891 +       struct adb_request req;
64892  
64893 -/* FIXME: This is a temporary set of callbacks to enable us
64894 - * to do suspend-to-disk.
64895 - */
64896 +       memset(&req, 0, sizeof(req));
64897  
64898 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64899 +       for (; n > 0; --n) {
64900 +               req.nbytes = 4;
64901 +               req.done = NULL;
64902 +               req.data[0] = 0xee;
64903 +               req.data[1] = 4;
64904 +               req.data[2] = 0;
64905 +               req.data[3] = 1;
64906 +               req.reply[0] = ADB_RET_OK;
64907 +               req.reply_len = 1;
64908 +               req.reply_expected = 0;
64909 +               pmu_polled_request(&req);
64910 +               mdelay(50);
64911 +               req.nbytes = 4;
64912 +               req.done = NULL;
64913 +               req.data[0] = 0xee;
64914 +               req.data[1] = 4;
64915 +               req.data[2] = 0;
64916 +               req.data[3] = 0;
64917 +               req.reply[0] = ADB_RET_OK;
64918 +               req.reply_len = 1;
64919 +               req.reply_expected = 0;
64920 +               pmu_polled_request(&req);
64921 +               mdelay(50);
64922 +       }
64923 +       mdelay(50);
64924 +}
64925 +#endif /* DEBUG_SLEEP */
64926  
64927 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64928  int pmu_sys_suspended;
64929  
64930  static int pmu_sys_suspend(struct sys_device *sysdev, pm_message_t state)
64931 @@ -2767,10 +2445,15 @@ static int pmu_sys_suspend(struct sys_de
64932         if (state.event != PM_EVENT_SUSPEND || pmu_sys_suspended)
64933                 return 0;
64934  
64935 -       /* Suspend PMU event interrupts */
64936 +       /* Suspend PMU event interrupts */\
64937         pmu_suspend();
64938 -
64939         pmu_sys_suspended = 1;
64940 +
64941 +#ifdef CONFIG_PMAC_BACKLIGHT
64942 +       /* Tell backlight code not to muck around with the chip anymore */
64943 +       pmu_backlight_set_sleep(1);
64944 +#endif
64945 +
64946         return 0;
64947  }
64948  
64949 @@ -2785,15 +2468,18 @@ static int pmu_sys_resume(struct sys_dev
64950         pmu_request(&req, NULL, 2, PMU_SYSTEM_READY, 2);
64951         pmu_wait_complete(&req);
64952  
64953 +#ifdef CONFIG_PMAC_BACKLIGHT
64954 +       /* Tell backlight code it can use the chip again */
64955 +       pmu_backlight_set_sleep(0);
64956 +#endif
64957         /* Resume PMU event interrupts */
64958         pmu_resume();
64959 -
64960         pmu_sys_suspended = 0;
64961  
64962         return 0;
64963  }
64964  
64965 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64966 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64967  
64968  static struct sysdev_class pmu_sysclass = {
64969         set_kset_name("pmu"),
64970 @@ -2804,10 +2490,10 @@ static struct sys_device device_pmu = {
64971  };
64972  
64973  static struct sysdev_driver driver_pmu = {
64974 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64975 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64976         .suspend        = &pmu_sys_suspend,
64977         .resume         = &pmu_sys_resume,
64978 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64979 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64980  };
64981  
64982  static int __init init_pmu_sysfs(void)
64983 @@ -2842,10 +2528,10 @@ EXPORT_SYMBOL(pmu_wait_complete);
64984  EXPORT_SYMBOL(pmu_suspend);
64985  EXPORT_SYMBOL(pmu_resume);
64986  EXPORT_SYMBOL(pmu_unlock);
64987 -#if defined(CONFIG_PPC32)
64988 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64989  EXPORT_SYMBOL(pmu_enable_irled);
64990  EXPORT_SYMBOL(pmu_battery_count);
64991  EXPORT_SYMBOL(pmu_batteries);
64992  EXPORT_SYMBOL(pmu_power_flags);
64993 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64994 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64995  
64996 Index: linux-2.6.24.7/drivers/net/fs_enet/fs_enet-main.c
64997 ===================================================================
64998 --- linux-2.6.24.7.orig/drivers/net/fs_enet/fs_enet-main.c
64999 +++ linux-2.6.24.7/drivers/net/fs_enet/fs_enet-main.c
65000 @@ -1178,8 +1178,15 @@ static int __devinit find_phy(struct dev
65001         struct device_node *phynode, *mdionode;
65002         struct resource res;
65003         int ret = 0, len;
65004 +       const u32 *data;
65005 +
65006 +       data  = of_get_property(np, "fixed-link", NULL);
65007 +       if (data) {
65008 +               snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data);
65009 +               return 0;
65010 +       }
65011  
65012 -       const u32 *data = of_get_property(np, "phy-handle", &len);
65013 +       data = of_get_property(np, "phy-handle", &len);
65014         if (!data || len != 4)
65015                 return -EINVAL;
65016  
65017 Index: linux-2.6.24.7/drivers/net/fs_enet/mac-fcc.c
65018 ===================================================================
65019 --- linux-2.6.24.7.orig/drivers/net/fs_enet/mac-fcc.c
65020 +++ linux-2.6.24.7/drivers/net/fs_enet/mac-fcc.c
65021 @@ -81,16 +81,8 @@
65022  static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op)
65023  {
65024         const struct fs_platform_info *fpi = fep->fpi;
65025 -       int i;
65026  
65027 -       W32(cpmp, cp_cpcr, fpi->cp_command | op | CPM_CR_FLG);
65028 -       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
65029 -               if ((R32(cpmp, cp_cpcr) & CPM_CR_FLG) == 0)
65030 -                       return 0;
65031 -
65032 -       printk(KERN_ERR "%s(): Not able to issue CPM command\n",
65033 -              __FUNCTION__);
65034 -       return 1;
65035 +       return cpm_command(fpi->cp_command, op);
65036  }
65037  
65038  static int do_pd_setup(struct fs_enet_private *fep)
65039 Index: linux-2.6.24.7/drivers/net/fs_enet/mac-scc.c
65040 ===================================================================
65041 --- linux-2.6.24.7.orig/drivers/net/fs_enet/mac-scc.c
65042 +++ linux-2.6.24.7/drivers/net/fs_enet/mac-scc.c
65043 @@ -89,21 +89,12 @@
65044   * Delay to wait for SCC reset command to complete (in us)
65045   */
65046  #define SCC_RESET_DELAY                50
65047 -#define MAX_CR_CMD_LOOPS       10000
65048  
65049  static inline int scc_cr_cmd(struct fs_enet_private *fep, u32 op)
65050  {
65051         const struct fs_platform_info *fpi = fep->fpi;
65052 -       int i;
65053  
65054 -       W16(cpmp, cp_cpcr, fpi->cp_command | CPM_CR_FLG | (op << 8));
65055 -       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
65056 -               if ((R16(cpmp, cp_cpcr) & CPM_CR_FLG) == 0)
65057 -                       return 0;
65058 -
65059 -       printk(KERN_ERR "%s(): Not able to issue CPM command\n",
65060 -               __FUNCTION__);
65061 -       return 1;
65062 +       return cpm_command(fpi->cp_command, op);
65063  }
65064  
65065  static int do_pd_setup(struct fs_enet_private *fep)
65066 Index: linux-2.6.24.7/drivers/net/ibm_newemac/core.c
65067 ===================================================================
65068 --- linux-2.6.24.7.orig/drivers/net/ibm_newemac/core.c
65069 +++ linux-2.6.24.7/drivers/net/ibm_newemac/core.c
65070 @@ -37,6 +37,7 @@
65071  #include <linux/mii.h>
65072  #include <linux/bitops.h>
65073  #include <linux/workqueue.h>
65074 +#include <linux/of.h>
65075  
65076  #include <asm/processor.h>
65077  #include <asm/io.h>
65078 Index: linux-2.6.24.7/drivers/net/phy/Kconfig
65079 ===================================================================
65080 --- linux-2.6.24.7.orig/drivers/net/phy/Kconfig
65081 +++ linux-2.6.24.7/drivers/net/phy/Kconfig
65082 @@ -61,34 +61,12 @@ config ICPLUS_PHY
65083           Currently supports the IP175C PHY.
65084  
65085  config FIXED_PHY
65086 -       tristate "Drivers for PHY emulation on fixed speed/link"
65087 +       bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs"
65088         ---help---
65089 -         Adds the driver to PHY layer to cover the boards that do not have any PHY bound,
65090 -         but with the ability to manipulate the speed/link in software. The relevant MII
65091 -         speed/duplex parameters could be effectively handled in a user-specified function.
65092 -         Currently tested with mpc866ads.
65093 +         Adds the platform "fixed" MDIO Bus to cover the boards that use
65094 +         PHYs that are not connected to the real MDIO bus.
65095  
65096 -config FIXED_MII_10_FDX
65097 -       bool "Emulation for 10M Fdx fixed PHY behavior"
65098 -       depends on FIXED_PHY
65099 -
65100 -config FIXED_MII_100_FDX
65101 -       bool "Emulation for 100M Fdx fixed PHY behavior"
65102 -       depends on FIXED_PHY
65103 -
65104 -config FIXED_MII_1000_FDX
65105 -       bool "Emulation for 1000M Fdx fixed PHY behavior"
65106 -       depends on FIXED_PHY
65107 -
65108 -config FIXED_MII_AMNT
65109 -        int "Number of emulated PHYs to allocate "
65110 -        depends on FIXED_PHY
65111 -        default "1"
65112 -        ---help---
65113 -        Sometimes it is required to have several independent emulated
65114 -        PHYs on the bus (in case of multi-eth but phy-less HW for instance).
65115 -        This control will have specified number allocated for each fixed
65116 -        PHY type enabled.
65117 +         Currently tested with mpc866ads and mpc8349e-mitx.
65118  
65119  config MDIO_BITBANG
65120         tristate "Support for bitbanged MDIO buses"
65121 Index: linux-2.6.24.7/drivers/net/phy/fixed.c
65122 ===================================================================
65123 --- linux-2.6.24.7.orig/drivers/net/phy/fixed.c
65124 +++ linux-2.6.24.7/drivers/net/phy/fixed.c
65125 @@ -1,362 +1,253 @@
65126  /*
65127 - * drivers/net/phy/fixed.c
65128 + * Fixed MDIO bus (MDIO bus emulation with fixed PHYs)
65129   *
65130 - * Driver for fixed PHYs, when transceiver is able to operate in one fixed mode.
65131 + * Author: Vitaly Bordug <vbordug@ru.mvista.com>
65132 + *         Anton Vorontsov <avorontsov@ru.mvista.com>
65133   *
65134 - * Author: Vitaly Bordug
65135 - *
65136 - * Copyright (c) 2006 MontaVista Software, Inc.
65137 + * Copyright (c) 2006-2007 MontaVista Software, Inc.
65138   *
65139   * This program is free software; you can redistribute  it and/or modify it
65140   * under  the terms of  the GNU General  Public License as published by the
65141   * Free Software Foundation;  either version 2 of the  License, or (at your
65142   * option) any later version.
65143 - *
65144   */
65145 +
65146  #include <linux/kernel.h>
65147 -#include <linux/string.h>
65148 -#include <linux/errno.h>
65149 -#include <linux/unistd.h>
65150 -#include <linux/slab.h>
65151 -#include <linux/interrupt.h>
65152 -#include <linux/init.h>
65153 -#include <linux/delay.h>
65154 -#include <linux/netdevice.h>
65155 -#include <linux/etherdevice.h>
65156 -#include <linux/skbuff.h>
65157 -#include <linux/spinlock.h>
65158 -#include <linux/mm.h>
65159  #include <linux/module.h>
65160 +#include <linux/platform_device.h>
65161 +#include <linux/list.h>
65162  #include <linux/mii.h>
65163 -#include <linux/ethtool.h>
65164  #include <linux/phy.h>
65165  #include <linux/phy_fixed.h>
65166  
65167 -#include <asm/io.h>
65168 -#include <asm/irq.h>
65169 -#include <asm/uaccess.h>
65170 -
65171 -/* we need to track the allocated pointers in order to free them on exit */
65172 -static struct fixed_info *fixed_phy_ptrs[CONFIG_FIXED_MII_AMNT*MAX_PHY_AMNT];
65173 -
65174 -/*-----------------------------------------------------------------------------
65175 - *  If something weird is required to be done with link/speed,
65176 - * network driver is able to assign a function to implement this.
65177 - * May be useful for PHY's that need to be software-driven.
65178 - *-----------------------------------------------------------------------------*/
65179 -int fixed_mdio_set_link_update(struct phy_device *phydev,
65180 -                              int (*link_update) (struct net_device *,
65181 -                                                  struct fixed_phy_status *))
65182 -{
65183 -       struct fixed_info *fixed;
65184 -
65185 -       if (link_update == NULL)
65186 -               return -EINVAL;
65187 +#define MII_REGS_NUM 29
65188  
65189 -       if (phydev) {
65190 -               if (phydev->bus) {
65191 -                       fixed = phydev->bus->priv;
65192 -                       fixed->link_update = link_update;
65193 -                       return 0;
65194 -               }
65195 -       }
65196 -       return -EINVAL;
65197 -}
65198 -
65199 -EXPORT_SYMBOL(fixed_mdio_set_link_update);
65200 +struct fixed_mdio_bus {
65201 +       int irqs[PHY_MAX_ADDR];
65202 +       struct mii_bus mii_bus;
65203 +       struct list_head phys;
65204 +};
65205  
65206 -struct fixed_info *fixed_mdio_get_phydev (int phydev_ind)
65207 -{
65208 -       if (phydev_ind >= MAX_PHY_AMNT)
65209 -               return NULL;
65210 -       return fixed_phy_ptrs[phydev_ind];
65211 -}
65212 +struct fixed_phy {
65213 +       int id;
65214 +       u16 regs[MII_REGS_NUM];
65215 +       struct phy_device *phydev;
65216 +       struct fixed_phy_status status;
65217 +       int (*link_update)(struct net_device *, struct fixed_phy_status *);
65218 +       struct list_head node;
65219 +};
65220  
65221 -EXPORT_SYMBOL(fixed_mdio_get_phydev);
65222 +static struct platform_device *pdev;
65223 +static struct fixed_mdio_bus platform_fmb = {
65224 +       .phys = LIST_HEAD_INIT(platform_fmb.phys),
65225 +};
65226  
65227 -/*-----------------------------------------------------------------------------
65228 - *  This is used for updating internal mii regs from the status
65229 - *-----------------------------------------------------------------------------*/
65230 -#if defined(CONFIG_FIXED_MII_100_FDX) || defined(CONFIG_FIXED_MII_10_FDX) || defined(CONFIG_FIXED_MII_1000_FDX)
65231 -static int fixed_mdio_update_regs(struct fixed_info *fixed)
65232 +static int fixed_phy_update_regs(struct fixed_phy *fp)
65233  {
65234 -       u16 *regs = fixed->regs;
65235 -       u16 bmsr = 0;
65236 +       u16 bmsr = BMSR_ANEGCAPABLE;
65237         u16 bmcr = 0;
65238 +       u16 lpagb = 0;
65239 +       u16 lpa = 0;
65240  
65241 -       if (!regs) {
65242 -               printk(KERN_ERR "%s: regs not set up", __FUNCTION__);
65243 -               return -EINVAL;
65244 -       }
65245 -
65246 -       if (fixed->phy_status.link)
65247 -               bmsr |= BMSR_LSTATUS;
65248 -
65249 -       if (fixed->phy_status.duplex) {
65250 +       if (fp->status.duplex) {
65251                 bmcr |= BMCR_FULLDPLX;
65252  
65253 -               switch (fixed->phy_status.speed) {
65254 +               switch (fp->status.speed) {
65255 +               case 1000:
65256 +                       bmsr |= BMSR_ESTATEN;
65257 +                       bmcr |= BMCR_SPEED1000;
65258 +                       lpagb |= LPA_1000FULL;
65259 +                       break;
65260                 case 100:
65261                         bmsr |= BMSR_100FULL;
65262                         bmcr |= BMCR_SPEED100;
65263 +                       lpa |= LPA_100FULL;
65264                         break;
65265 -
65266                 case 10:
65267                         bmsr |= BMSR_10FULL;
65268 +                       lpa |= LPA_10FULL;
65269                         break;
65270 +               default:
65271 +                       printk(KERN_WARNING "fixed phy: unknown speed\n");
65272 +                       return -EINVAL;
65273                 }
65274         } else {
65275 -               switch (fixed->phy_status.speed) {
65276 +               switch (fp->status.speed) {
65277 +               case 1000:
65278 +                       bmsr |= BMSR_ESTATEN;
65279 +                       bmcr |= BMCR_SPEED1000;
65280 +                       lpagb |= LPA_1000HALF;
65281 +                       break;
65282                 case 100:
65283                         bmsr |= BMSR_100HALF;
65284                         bmcr |= BMCR_SPEED100;
65285 +                       lpa |= LPA_100HALF;
65286                         break;
65287 -
65288                 case 10:
65289 -                       bmsr |= BMSR_100HALF;
65290 +                       bmsr |= BMSR_10HALF;
65291 +                       lpa |= LPA_10HALF;
65292                         break;
65293 +               default:
65294 +                       printk(KERN_WARNING "fixed phy: unknown speed\n");
65295 +                       return -EINVAL;
65296                 }
65297         }
65298  
65299 -       regs[MII_BMCR] = bmcr;
65300 -       regs[MII_BMSR] = bmsr | 0x800;  /*we are always capable of 10 hdx */
65301 +       if (fp->status.link)
65302 +               bmsr |= BMSR_LSTATUS | BMSR_ANEGCOMPLETE;
65303 +
65304 +       if (fp->status.pause)
65305 +               lpa |= LPA_PAUSE_CAP;
65306 +
65307 +       if (fp->status.asym_pause)
65308 +               lpa |= LPA_PAUSE_ASYM;
65309 +
65310 +       fp->regs[MII_PHYSID1] = fp->id >> 16;
65311 +       fp->regs[MII_PHYSID2] = fp->id;
65312 +
65313 +       fp->regs[MII_BMSR] = bmsr;
65314 +       fp->regs[MII_BMCR] = bmcr;
65315 +       fp->regs[MII_LPA] = lpa;
65316 +       fp->regs[MII_STAT1000] = lpagb;
65317  
65318         return 0;
65319  }
65320  
65321 -static int fixed_mii_read(struct mii_bus *bus, int phy_id, int location)
65322 +static int fixed_mdio_read(struct mii_bus *bus, int phy_id, int reg_num)
65323  {
65324 -       struct fixed_info *fixed = bus->priv;
65325 +       struct fixed_mdio_bus *fmb = container_of(bus, struct fixed_mdio_bus,
65326 +                                                 mii_bus);
65327 +       struct fixed_phy *fp;
65328  
65329 -       /* if user has registered link update callback, use it */
65330 -       if (fixed->phydev)
65331 -               if (fixed->phydev->attached_dev) {
65332 -                       if (fixed->link_update) {
65333 -                               fixed->link_update(fixed->phydev->attached_dev,
65334 -                                                  &fixed->phy_status);
65335 -                               fixed_mdio_update_regs(fixed);
65336 +       if (reg_num >= MII_REGS_NUM)
65337 +               return -1;
65338 +
65339 +       list_for_each_entry(fp, &fmb->phys, node) {
65340 +               if (fp->id == phy_id) {
65341 +                       /* Issue callback if user registered it. */
65342 +                       if (fp->link_update) {
65343 +                               fp->link_update(fp->phydev->attached_dev,
65344 +                                               &fp->status);
65345 +                               fixed_phy_update_regs(fp);
65346                         }
65347 +                       return fp->regs[reg_num];
65348                 }
65349 +       }
65350  
65351 -       if ((unsigned int)location >= fixed->regs_num)
65352 -               return -1;
65353 -       return fixed->regs[location];
65354 +       return 0xFFFF;
65355  }
65356  
65357 -static int fixed_mii_write(struct mii_bus *bus, int phy_id, int location,
65358 -                          u16 val)
65359 +static int fixed_mdio_write(struct mii_bus *bus, int phy_id, int reg_num,
65360 +                           u16 val)
65361  {
65362 -       /* do nothing for now */
65363         return 0;
65364  }
65365  
65366 -static int fixed_mii_reset(struct mii_bus *bus)
65367 +/*
65368 + * If something weird is required to be done with link/speed,
65369 + * network driver is able to assign a function to implement this.
65370 + * May be useful for PHY's that need to be software-driven.
65371 + */
65372 +int fixed_phy_set_link_update(struct phy_device *phydev,
65373 +                             int (*link_update)(struct net_device *,
65374 +                                                struct fixed_phy_status *))
65375  {
65376 -       /*nothing here - no way/need to reset it */
65377 -       return 0;
65378 -}
65379 -#endif
65380 +       struct fixed_mdio_bus *fmb = &platform_fmb;
65381 +       struct fixed_phy *fp;
65382  
65383 -static int fixed_config_aneg(struct phy_device *phydev)
65384 -{
65385 -       /* :TODO:03/13/2006 09:45:37 PM::
65386 -          The full autoneg funcionality can be emulated,
65387 -          but no need to have anything here for now
65388 -        */
65389 -       return 0;
65390 -}
65391 +       if (!link_update || !phydev || !phydev->bus)
65392 +               return -EINVAL;
65393  
65394 -/*-----------------------------------------------------------------------------
65395 - * the manual bind will do the magic - with phy_id_mask == 0
65396 - * match will never return true...
65397 - *-----------------------------------------------------------------------------*/
65398 -static struct phy_driver fixed_mdio_driver = {
65399 -       .name = "Fixed PHY",
65400 -#ifdef CONFIG_FIXED_MII_1000_FDX
65401 -       .features = PHY_GBIT_FEATURES,
65402 -#else
65403 -       .features = PHY_BASIC_FEATURES,
65404 -#endif
65405 -       .config_aneg = fixed_config_aneg,
65406 -       .read_status = genphy_read_status,
65407 -       .driver = { .owner = THIS_MODULE, },
65408 -};
65409 +       list_for_each_entry(fp, &fmb->phys, node) {
65410 +               if (fp->id == phydev->phy_id) {
65411 +                       fp->link_update = link_update;
65412 +                       fp->phydev = phydev;
65413 +                       return 0;
65414 +               }
65415 +       }
65416  
65417 -static void fixed_mdio_release(struct device *dev)
65418 -{
65419 -       struct phy_device *phydev = container_of(dev, struct phy_device, dev);
65420 -       struct mii_bus *bus = phydev->bus;
65421 -       struct fixed_info *fixed = bus->priv;
65422 -
65423 -       kfree(phydev);
65424 -       kfree(bus->dev);
65425 -       kfree(bus);
65426 -       kfree(fixed->regs);
65427 -       kfree(fixed);
65428 +       return -ENOENT;
65429  }
65430 +EXPORT_SYMBOL_GPL(fixed_phy_set_link_update);
65431  
65432 -/*-----------------------------------------------------------------------------
65433 - *  This func is used to create all the necessary stuff, bind
65434 - * the fixed phy driver and register all it on the mdio_bus_type.
65435 - * speed is either 10 or 100 or 1000, duplex is boolean.
65436 - * number is used to create multiple fixed PHYs, so that several devices can
65437 - * utilize them simultaneously.
65438 - *
65439 - * The device on mdio bus will look like [bus_id]:[phy_id],
65440 - * bus_id = number
65441 - * phy_id = speed+duplex.
65442 - *-----------------------------------------------------------------------------*/
65443 -#if defined(CONFIG_FIXED_MII_100_FDX) || defined(CONFIG_FIXED_MII_10_FDX) || defined(CONFIG_FIXED_MII_1000_FDX)
65444 -struct fixed_info *fixed_mdio_register_device(
65445 -       int bus_id, int speed, int duplex, u8 phy_id)
65446 +int fixed_phy_add(unsigned int irq, int phy_id,
65447 +                 struct fixed_phy_status *status)
65448  {
65449 -       struct mii_bus *new_bus;
65450 -       struct fixed_info *fixed;
65451 -       struct phy_device *phydev;
65452 -       int err;
65453 +       int ret;
65454 +       struct fixed_mdio_bus *fmb = &platform_fmb;
65455 +       struct fixed_phy *fp;
65456  
65457 -       struct device *dev = kzalloc(sizeof(struct device), GFP_KERNEL);
65458 +       fp = kzalloc(sizeof(*fp), GFP_KERNEL);
65459 +       if (!fp)
65460 +               return -ENOMEM;
65461  
65462 -       if (dev == NULL)
65463 -               goto err_dev_alloc;
65464 +       memset(fp->regs, 0xFF,  sizeof(fp->regs[0]) * MII_REGS_NUM);
65465  
65466 -       new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
65467 +       fmb->irqs[phy_id] = irq;
65468  
65469 -       if (new_bus == NULL)
65470 -               goto err_bus_alloc;
65471 -
65472 -       fixed = kzalloc(sizeof(struct fixed_info), GFP_KERNEL);
65473 -
65474 -       if (fixed == NULL)
65475 -               goto err_fixed_alloc;
65476 -
65477 -       fixed->regs = kzalloc(MII_REGS_NUM * sizeof(int), GFP_KERNEL);
65478 -       if (NULL == fixed->regs)
65479 -               goto err_fixed_regs_alloc;
65480 -
65481 -       fixed->regs_num = MII_REGS_NUM;
65482 -       fixed->phy_status.speed = speed;
65483 -       fixed->phy_status.duplex = duplex;
65484 -       fixed->phy_status.link = 1;
65485 -
65486 -       new_bus->name = "Fixed MII Bus";
65487 -       new_bus->read = &fixed_mii_read;
65488 -       new_bus->write = &fixed_mii_write;
65489 -       new_bus->reset = &fixed_mii_reset;
65490 -       /*set up workspace */
65491 -       fixed_mdio_update_regs(fixed);
65492 -       new_bus->priv = fixed;
65493 -
65494 -       new_bus->dev = dev;
65495 -       dev_set_drvdata(dev, new_bus);
65496 -
65497 -       /* create phy_device and register it on the mdio bus */
65498 -       phydev = phy_device_create(new_bus, 0, 0);
65499 -       if (phydev == NULL)
65500 -               goto err_phy_dev_create;
65501 -
65502 -       /*
65503 -        * Put the phydev pointer into the fixed pack so that bus read/write
65504 -        * code could be able to access for instance attached netdev. Well it
65505 -        * doesn't have to do so, only in case of utilizing user-specified
65506 -        * link-update...
65507 -        */
65508 -
65509 -       fixed->phydev = phydev;
65510 -       phydev->speed = speed;
65511 -       phydev->duplex = duplex;
65512 -
65513 -       phydev->irq = PHY_IGNORE_INTERRUPT;
65514 -       phydev->dev.bus = &mdio_bus_type;
65515 -
65516 -       snprintf(phydev->dev.bus_id, BUS_ID_SIZE,
65517 -                PHY_ID_FMT, bus_id, phy_id);
65518 -
65519 -       phydev->bus = new_bus;
65520 -
65521 -       phydev->dev.driver = &fixed_mdio_driver.driver;
65522 -       phydev->dev.release = fixed_mdio_release;
65523 -       err = phydev->dev.driver->probe(&phydev->dev);
65524 -       if (err < 0) {
65525 -               printk(KERN_ERR "Phy %s: problems with fixed driver\n",
65526 -                      phydev->dev.bus_id);
65527 -               goto err_out;
65528 -       }
65529 -       err = device_register(&phydev->dev);
65530 -       if (err) {
65531 -               printk(KERN_ERR "Phy %s failed to register\n",
65532 -                      phydev->dev.bus_id);
65533 -               goto err_out;
65534 -       }
65535 -       //phydev->state = PHY_RUNNING; /* make phy go up quick, but in 10Mbit/HDX
65536 -       return fixed;
65537 +       fp->id = phy_id;
65538 +       fp->status = *status;
65539  
65540 -err_out:
65541 -       kfree(phydev);
65542 -err_phy_dev_create:
65543 -       kfree(fixed->regs);
65544 -err_fixed_regs_alloc:
65545 -       kfree(fixed);
65546 -err_fixed_alloc:
65547 -       kfree(new_bus);
65548 -err_bus_alloc:
65549 -       kfree(dev);
65550 -err_dev_alloc:
65551 +       ret = fixed_phy_update_regs(fp);
65552 +       if (ret)
65553 +               goto err_regs;
65554  
65555 -       return NULL;
65556 +       list_add_tail(&fp->node, &fmb->phys);
65557  
65558 -}
65559 -#endif
65560 +       return 0;
65561  
65562 -MODULE_DESCRIPTION("Fixed PHY device & driver for PAL");
65563 -MODULE_AUTHOR("Vitaly Bordug");
65564 -MODULE_LICENSE("GPL");
65565 +err_regs:
65566 +       kfree(fp);
65567 +       return ret;
65568 +}
65569 +EXPORT_SYMBOL_GPL(fixed_phy_add);
65570  
65571 -static int __init fixed_init(void)
65572 +static int __init fixed_mdio_bus_init(void)
65573  {
65574 -       int cnt = 0;
65575 -       int i;
65576 -/* register on the bus... Not expected to be matched
65577 - * with anything there...
65578 - *
65579 - */
65580 -       phy_driver_register(&fixed_mdio_driver);
65581 +       struct fixed_mdio_bus *fmb = &platform_fmb;
65582 +       int ret;
65583  
65584 -/* We will create several mdio devices here, and will bound the upper
65585 - * driver to them.
65586 - *
65587 - * Then the external software can lookup the phy bus by searching
65588 - * for 0:101, to be connected to the virtual 100M Fdx phy.
65589 - *
65590 - * In case several virtual PHYs required, the bus_id will be in form
65591 - * [num]:[duplex]+[speed], which make it able even to define
65592 - * driver-specific link control callback, if for instance PHY is
65593 - * completely SW-driven.
65594 - */
65595 -       for (i=1; i <= CONFIG_FIXED_MII_AMNT; i++) {
65596 -#ifdef CONFIG_FIXED_MII_1000_FDX
65597 -               fixed_phy_ptrs[cnt++] = fixed_mdio_register_device(0, 1000, 1, i);
65598 -#endif
65599 -#ifdef CONFIG_FIXED_MII_100_FDX
65600 -               fixed_phy_ptrs[cnt++] = fixed_mdio_register_device(1, 100, 1, i);
65601 -#endif
65602 -#ifdef CONFIG_FIXED_MII_10_FDX
65603 -               fixed_phy_ptrs[cnt++] = fixed_mdio_register_device(2, 10, 1, i);
65604 -#endif
65605 +       pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0);
65606 +       if (!pdev) {
65607 +               ret = -ENOMEM;
65608 +               goto err_pdev;
65609         }
65610  
65611 +       fmb->mii_bus.id = 0;
65612 +       fmb->mii_bus.name = "Fixed MDIO Bus";
65613 +       fmb->mii_bus.dev = &pdev->dev;
65614 +       fmb->mii_bus.read = &fixed_mdio_read;
65615 +       fmb->mii_bus.write = &fixed_mdio_write;
65616 +       fmb->mii_bus.irq = fmb->irqs;
65617 +
65618 +       ret = mdiobus_register(&fmb->mii_bus);
65619 +       if (ret)
65620 +               goto err_mdiobus_reg;
65621 +
65622         return 0;
65623 +
65624 +err_mdiobus_reg:
65625 +       platform_device_unregister(pdev);
65626 +err_pdev:
65627 +       return ret;
65628  }
65629 +module_init(fixed_mdio_bus_init);
65630  
65631 -static void __exit fixed_exit(void)
65632 +static void __exit fixed_mdio_bus_exit(void)
65633  {
65634 -       int i;
65635 +       struct fixed_mdio_bus *fmb = &platform_fmb;
65636 +       struct fixed_phy *fp;
65637  
65638 -       phy_driver_unregister(&fixed_mdio_driver);
65639 -       for (i=0; i < MAX_PHY_AMNT; i++)
65640 -               if ( fixed_phy_ptrs[i] )
65641 -                       device_unregister(&fixed_phy_ptrs[i]->phydev->dev);
65642 +       mdiobus_unregister(&fmb->mii_bus);
65643 +       platform_device_unregister(pdev);
65644 +
65645 +       list_for_each_entry(fp, &fmb->phys, node) {
65646 +               list_del(&fp->node);
65647 +               kfree(fp);
65648 +       }
65649  }
65650 +module_exit(fixed_mdio_bus_exit);
65651  
65652 -module_init(fixed_init);
65653 -module_exit(fixed_exit);
65654 +MODULE_DESCRIPTION("Fixed MDIO bus (MDIO bus emulation with fixed PHYs)");
65655 +MODULE_AUTHOR("Vitaly Bordug");
65656 +MODULE_LICENSE("GPL");
65657 Index: linux-2.6.24.7/drivers/net/ps3_gelic_net.c
65658 ===================================================================
65659 --- linux-2.6.24.7.orig/drivers/net/ps3_gelic_net.c
65660 +++ linux-2.6.24.7/drivers/net/ps3_gelic_net.c
65661 @@ -58,11 +58,11 @@ static inline struct device *ctodev(stru
65662  {
65663         return &card->dev->core;
65664  }
65665 -static inline unsigned int bus_id(struct gelic_net_card *card)
65666 +static inline u64 bus_id(struct gelic_net_card *card)
65667  {
65668         return card->dev->bus_id;
65669  }
65670 -static inline unsigned int dev_id(struct gelic_net_card *card)
65671 +static inline u64 dev_id(struct gelic_net_card *card)
65672  {
65673         return card->dev->dev_id;
65674  }
65675 Index: linux-2.6.24.7/drivers/net/ucc_geth.c
65676 ===================================================================
65677 --- linux-2.6.24.7.orig/drivers/net/ucc_geth.c
65678 +++ linux-2.6.24.7/drivers/net/ucc_geth.c
65679 @@ -3822,6 +3822,7 @@ static int ucc_geth_probe(struct of_devi
65680         int err, ucc_num, max_speed = 0;
65681         const phandle *ph;
65682         const unsigned int *prop;
65683 +       const char *sprop;
65684         const void *mac_addr;
65685         phy_interface_t phy_interface;
65686         static const int enet_to_speed[] = {
65687 @@ -3854,10 +3855,56 @@ static int ucc_geth_probe(struct of_devi
65688  
65689         ug_info->uf_info.ucc_num = ucc_num;
65690  
65691 -       prop = of_get_property(np, "rx-clock", NULL);
65692 -       ug_info->uf_info.rx_clock = *prop;
65693 -       prop = of_get_property(np, "tx-clock", NULL);
65694 -       ug_info->uf_info.tx_clock = *prop;
65695 +       sprop = of_get_property(np, "rx-clock-name", NULL);
65696 +       if (sprop) {
65697 +               ug_info->uf_info.rx_clock = qe_clock_source(sprop);
65698 +               if ((ug_info->uf_info.rx_clock < QE_CLK_NONE) ||
65699 +                   (ug_info->uf_info.rx_clock > QE_CLK24)) {
65700 +                       printk(KERN_ERR
65701 +                               "ucc_geth: invalid rx-clock-name property\n");
65702 +                       return -EINVAL;
65703 +               }
65704 +       } else {
65705 +               prop = of_get_property(np, "rx-clock", NULL);
65706 +               if (!prop) {
65707 +                       /* If both rx-clock-name and rx-clock are missing,
65708 +                          we want to tell people to use rx-clock-name. */
65709 +                       printk(KERN_ERR
65710 +                               "ucc_geth: missing rx-clock-name property\n");
65711 +                       return -EINVAL;
65712 +               }
65713 +               if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
65714 +                       printk(KERN_ERR
65715 +                               "ucc_geth: invalid rx-clock propperty\n");
65716 +                       return -EINVAL;
65717 +               }
65718 +               ug_info->uf_info.rx_clock = *prop;
65719 +       }
65720 +
65721 +       sprop = of_get_property(np, "tx-clock-name", NULL);
65722 +       if (sprop) {
65723 +               ug_info->uf_info.tx_clock = qe_clock_source(sprop);
65724 +               if ((ug_info->uf_info.tx_clock < QE_CLK_NONE) ||
65725 +                   (ug_info->uf_info.tx_clock > QE_CLK24)) {
65726 +                       printk(KERN_ERR
65727 +                               "ucc_geth: invalid tx-clock-name property\n");
65728 +                       return -EINVAL;
65729 +               }
65730 +       } else {
65731 +               prop = of_get_property(np, "rx-clock", NULL);
65732 +               if (!prop) {
65733 +                       printk(KERN_ERR
65734 +                               "ucc_geth: mising tx-clock-name property\n");
65735 +                       return -EINVAL;
65736 +               }
65737 +               if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
65738 +                       printk(KERN_ERR
65739 +                               "ucc_geth: invalid tx-clock property\n");
65740 +                       return -EINVAL;
65741 +               }
65742 +               ug_info->uf_info.tx_clock = *prop;
65743 +       }
65744 +
65745         err = of_address_to_resource(np, 0, &res);
65746         if (err)
65747                 return -EINVAL;
65748 Index: linux-2.6.24.7/drivers/of/base.c
65749 ===================================================================
65750 --- linux-2.6.24.7.orig/drivers/of/base.c
65751 +++ linux-2.6.24.7/drivers/of/base.c
65752 @@ -273,3 +273,61 @@ struct device_node *of_find_compatible_n
65753         return np;
65754  }
65755  EXPORT_SYMBOL(of_find_compatible_node);
65756 +
65757 +/**
65758 + * of_match_node - Tell if an device_node has a matching of_match structure
65759 + *     @matches:       array of of device match structures to search in
65760 + *     @node:          the of device structure to match against
65761 + *
65762 + *     Low level utility function used by device matching.
65763 + */
65764 +const struct of_device_id *of_match_node(const struct of_device_id *matches,
65765 +                                        const struct device_node *node)
65766 +{
65767 +       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
65768 +               int match = 1;
65769 +               if (matches->name[0])
65770 +                       match &= node->name
65771 +                               && !strcmp(matches->name, node->name);
65772 +               if (matches->type[0])
65773 +                       match &= node->type
65774 +                               && !strcmp(matches->type, node->type);
65775 +               if (matches->compatible[0])
65776 +                       match &= of_device_is_compatible(node,
65777 +                                               matches->compatible);
65778 +               if (match)
65779 +                       return matches;
65780 +               matches++;
65781 +       }
65782 +       return NULL;
65783 +}
65784 +EXPORT_SYMBOL(of_match_node);
65785 +
65786 +/**
65787 + *     of_find_matching_node - Find a node based on an of_device_id match
65788 + *                             table.
65789 + *     @from:          The node to start searching from or NULL, the node
65790 + *                     you pass will not be searched, only the next one
65791 + *                     will; typically, you pass what the previous call
65792 + *                     returned. of_node_put() will be called on it
65793 + *     @matches:       array of of device match structures to search in
65794 + *
65795 + *     Returns a node pointer with refcount incremented, use
65796 + *     of_node_put() on it when done.
65797 + */
65798 +struct device_node *of_find_matching_node(struct device_node *from,
65799 +                                         const struct of_device_id *matches)
65800 +{
65801 +       struct device_node *np;
65802 +
65803 +       read_lock(&devtree_lock);
65804 +       np = from ? from->allnext : allnodes;
65805 +       for (; np; np = np->allnext) {
65806 +               if (of_match_node(matches, np) && of_node_get(np))
65807 +                       break;
65808 +       }
65809 +       of_node_put(from);
65810 +       read_unlock(&devtree_lock);
65811 +       return np;
65812 +}
65813 +EXPORT_SYMBOL(of_find_matching_node);
65814 Index: linux-2.6.24.7/drivers/of/device.c
65815 ===================================================================
65816 --- linux-2.6.24.7.orig/drivers/of/device.c
65817 +++ linux-2.6.24.7/drivers/of/device.c
65818 @@ -10,35 +10,6 @@
65819  #include <asm/errno.h>
65820  
65821  /**
65822 - * of_match_node - Tell if an device_node has a matching of_match structure
65823 - * @ids: array of of device match structures to search in
65824 - * @node: the of device structure to match against
65825 - *
65826 - * Low level utility function used by device matching.
65827 - */
65828 -const struct of_device_id *of_match_node(const struct of_device_id *matches,
65829 -                                        const struct device_node *node)
65830 -{
65831 -       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
65832 -               int match = 1;
65833 -               if (matches->name[0])
65834 -                       match &= node->name
65835 -                               && !strcmp(matches->name, node->name);
65836 -               if (matches->type[0])
65837 -                       match &= node->type
65838 -                               && !strcmp(matches->type, node->type);
65839 -               if (matches->compatible[0])
65840 -                       match &= of_device_is_compatible(node,
65841 -                                               matches->compatible);
65842 -               if (match)
65843 -                       return matches;
65844 -               matches++;
65845 -       }
65846 -       return NULL;
65847 -}
65848 -EXPORT_SYMBOL(of_match_node);
65849 -
65850 -/**
65851   * of_match_device - Tell if an of_device structure has a matching
65852   * of_match structure
65853   * @ids: array of of device match structures to search in
65854 Index: linux-2.6.24.7/drivers/ps3/Makefile
65855 ===================================================================
65856 --- linux-2.6.24.7.orig/drivers/ps3/Makefile
65857 +++ linux-2.6.24.7/drivers/ps3/Makefile
65858 @@ -4,3 +4,4 @@ ps3av_mod-objs          += ps3av.o ps3av_cmd.o
65859  obj-$(CONFIG_PPC_PS3) += sys-manager-core.o
65860  obj-$(CONFIG_PS3_SYS_MANAGER) += ps3-sys-manager.o
65861  obj-$(CONFIG_PS3_STORAGE) += ps3stor_lib.o
65862 +obj-$(CONFIG_PS3_LPM) += ps3-lpm.o
65863 Index: linux-2.6.24.7/drivers/ps3/ps3-lpm.c
65864 ===================================================================
65865 --- /dev/null
65866 +++ linux-2.6.24.7/drivers/ps3/ps3-lpm.c
65867 @@ -0,0 +1,1248 @@
65868 +/*
65869 + * PS3 Logical Performance Monitor.
65870 + *
65871 + *  Copyright (C) 2007 Sony Computer Entertainment Inc.
65872 + *  Copyright 2007 Sony Corp.
65873 + *
65874 + *  This program is free software; you can redistribute it and/or modify
65875 + *  it under the terms of the GNU General Public License as published by
65876 + *  the Free Software Foundation; version 2 of the License.
65877 + *
65878 + *  This program is distributed in the hope that it will be useful,
65879 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
65880 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
65881 + *  GNU General Public License for more details.
65882 + *
65883 + *  You should have received a copy of the GNU General Public License
65884 + *  along with this program; if not, write to the Free Software
65885 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
65886 + */
65887 +
65888 +#include <linux/kernel.h>
65889 +#include <linux/module.h>
65890 +#include <linux/interrupt.h>
65891 +#include <linux/uaccess.h>
65892 +#include <asm/ps3.h>
65893 +#include <asm/lv1call.h>
65894 +#include <asm/cell-pmu.h>
65895 +
65896 +
65897 +/* BOOKMARK tag macros */
65898 +#define PS3_PM_BOOKMARK_START                    0x8000000000000000ULL
65899 +#define PS3_PM_BOOKMARK_STOP                     0x4000000000000000ULL
65900 +#define PS3_PM_BOOKMARK_TAG_KERNEL               0x1000000000000000ULL
65901 +#define PS3_PM_BOOKMARK_TAG_USER                 0x3000000000000000ULL
65902 +#define PS3_PM_BOOKMARK_TAG_MASK_HI              0xF000000000000000ULL
65903 +#define PS3_PM_BOOKMARK_TAG_MASK_LO              0x0F00000000000000ULL
65904 +
65905 +/* CBE PM CONTROL register macros */
65906 +#define PS3_PM_CONTROL_PPU_TH0_BOOKMARK          0x00001000
65907 +#define PS3_PM_CONTROL_PPU_TH1_BOOKMARK          0x00000800
65908 +#define PS3_PM_CONTROL_PPU_COUNT_MODE_MASK       0x000C0000
65909 +#define PS3_PM_CONTROL_PPU_COUNT_MODE_PROBLEM    0x00080000
65910 +#define PS3_WRITE_PM_MASK                        0xFFFFFFFFFFFFFFFFULL
65911 +
65912 +/* CBE PM START STOP register macros */
65913 +#define PS3_PM_START_STOP_PPU_TH0_BOOKMARK_START 0x02000000
65914 +#define PS3_PM_START_STOP_PPU_TH1_BOOKMARK_START 0x01000000
65915 +#define PS3_PM_START_STOP_PPU_TH0_BOOKMARK_STOP  0x00020000
65916 +#define PS3_PM_START_STOP_PPU_TH1_BOOKMARK_STOP  0x00010000
65917 +#define PS3_PM_START_STOP_START_MASK             0xFF000000
65918 +#define PS3_PM_START_STOP_STOP_MASK              0x00FF0000
65919 +
65920 +/* CBE PM COUNTER register macres */
65921 +#define PS3_PM_COUNTER_MASK_HI                   0xFFFFFFFF00000000ULL
65922 +#define PS3_PM_COUNTER_MASK_LO                   0x00000000FFFFFFFFULL
65923 +
65924 +/* BASE SIGNAL GROUP NUMBER macros */
65925 +#define PM_ISLAND2_BASE_SIGNAL_GROUP_NUMBER  0
65926 +#define PM_ISLAND2_SIGNAL_GROUP_NUMBER1      6
65927 +#define PM_ISLAND2_SIGNAL_GROUP_NUMBER2      7
65928 +#define PM_ISLAND3_BASE_SIGNAL_GROUP_NUMBER  7
65929 +#define PM_ISLAND4_BASE_SIGNAL_GROUP_NUMBER  15
65930 +#define PM_SPU_TRIGGER_SIGNAL_GROUP_NUMBER   17
65931 +#define PM_SPU_EVENT_SIGNAL_GROUP_NUMBER     18
65932 +#define PM_ISLAND5_BASE_SIGNAL_GROUP_NUMBER  18
65933 +#define PM_ISLAND6_BASE_SIGNAL_GROUP_NUMBER  24
65934 +#define PM_ISLAND7_BASE_SIGNAL_GROUP_NUMBER  49
65935 +#define PM_ISLAND8_BASE_SIGNAL_GROUP_NUMBER  52
65936 +#define PM_SIG_GROUP_SPU                     41
65937 +#define PM_SIG_GROUP_SPU_TRIGGER             42
65938 +#define PM_SIG_GROUP_SPU_EVENT               43
65939 +#define PM_SIG_GROUP_MFC_MAX                 60
65940 +
65941 +/**
65942 + * struct ps3_lpm_shadow_regs - Performance monitor shadow registers.
65943 + *
65944 + * @pm_control: Shadow of the processor's pm_control register.
65945 + * @pm_start_stop: Shadow of the processor's pm_start_stop register.
65946 + * @pm_interval: Shadow of the processor's pm_interval register.
65947 + * @group_control: Shadow of the processor's group_control register.
65948 + * @debug_bus_control: Shadow of the processor's debug_bus_control register.
65949 + *
65950 + * The logical performance monitor provides a write-only interface to
65951 + * these processor registers.  These shadow variables cache the processor
65952 + * register values for reading.
65953 + *
65954 + * The initial value of the shadow registers at lpm creation is
65955 + * PS3_LPM_SHADOW_REG_INIT.
65956 + */
65957 +
65958 +struct ps3_lpm_shadow_regs {
65959 +       u64 pm_control;
65960 +       u64 pm_start_stop;
65961 +       u64 pm_interval;
65962 +       u64 group_control;
65963 +       u64 debug_bus_control;
65964 +};
65965 +
65966 +#define PS3_LPM_SHADOW_REG_INIT 0xFFFFFFFF00000000ULL
65967 +
65968 +/**
65969 + * struct ps3_lpm_priv - Private lpm device data.
65970 + *
65971 + * @open: An atomic variable indicating the lpm driver has been opened.
65972 + * @rights: The lpm rigths granted by the system policy module.  A logical
65973 + *  OR of enum ps3_lpm_rights.
65974 + * @node_id: The node id of a BE prosessor whose performance monitor this
65975 + *  lpar has the right to use.
65976 + * @pu_id: The lv1 id of the logical PU.
65977 + * @lpm_id: The lv1 id of this lpm instance.
65978 + * @outlet_id: The outlet created by lv1 for this lpm instance.
65979 + * @tb_count: The number of bytes of data held in the lv1 trace buffer.
65980 + * @tb_cache: Kernel buffer to receive the data from the lv1 trace buffer.
65981 + *  Must be 128 byte aligned.
65982 + * @tb_cache_size: Size of the kernel @tb_cache buffer.  Must be 128 byte
65983 + *  aligned.
65984 + * @tb_cache_internal: An unaligned buffer allocated by this driver to be
65985 + *  used for the trace buffer cache when ps3_lpm_open() is called with a
65986 + *  NULL tb_cache argument.  Otherwise unused.
65987 + * @shadow: Processor register shadow of type struct ps3_lpm_shadow_regs.
65988 + * @sbd: The struct ps3_system_bus_device attached to this driver.
65989 + *
65990 + * The trace buffer is a buffer allocated and used internally to the lv1
65991 + * hypervisor to collect trace data.  The trace buffer cache is a guest
65992 + * buffer that accepts the trace data from the trace buffer.
65993 + */
65994 +
65995 +struct ps3_lpm_priv {
65996 +       atomic_t open;
65997 +       u64 rights;
65998 +       u64 node_id;
65999 +       u64 pu_id;
66000 +       u64 lpm_id;
66001 +       u64 outlet_id;
66002 +       u64 tb_count;
66003 +       void *tb_cache;
66004 +       u64 tb_cache_size;
66005 +       void *tb_cache_internal;
66006 +       struct ps3_lpm_shadow_regs shadow;
66007 +       struct ps3_system_bus_device *sbd;
66008 +};
66009 +
66010 +enum {
66011 +       PS3_LPM_DEFAULT_TB_CACHE_SIZE = 0x4000,
66012 +};
66013 +
66014 +/**
66015 + * lpm_priv - Static instance of the lpm data.
66016 + *
66017 + * Since the exported routines don't support the notion of a device
66018 + * instance we need to hold the instance in this static variable
66019 + * and then only allow at most one instance at a time to be created.
66020 + */
66021 +
66022 +static struct ps3_lpm_priv *lpm_priv;
66023 +
66024 +static struct device *sbd_core(void)
66025 +{
66026 +       BUG_ON(!lpm_priv || !lpm_priv->sbd);
66027 +       return &lpm_priv->sbd->core;
66028 +}
66029 +
66030 +/**
66031 + * use_start_stop_bookmark - Enable the PPU bookmark trace.
66032 + *
66033 + * And it enables PPU bookmark triggers ONLY if the other triggers are not set.
66034 + * The start/stop bookmarks are inserted at ps3_enable_pm() and ps3_disable_pm()
66035 + * to start/stop LPM.
66036 + *
66037 + * Used to get good quality of the performance counter.
66038 + */
66039 +
66040 +enum {use_start_stop_bookmark = 1,};
66041 +
66042 +void ps3_set_bookmark(u64 bookmark)
66043 +{
66044 +       /*
66045 +        * As per the PPE book IV, to avoid bookmark loss there must
66046 +        * not be a traced branch within 10 cycles of setting the
66047 +        * SPRN_BKMK register.  The actual text is unclear if 'within'
66048 +        * includes cycles before the call.
66049 +        */
66050 +
66051 +       asm volatile("or 29, 29, 29;"); /* db10cyc */
66052 +       mtspr(SPRN_BKMK, bookmark);
66053 +       asm volatile("or 29, 29, 29;"); /* db10cyc */
66054 +}
66055 +EXPORT_SYMBOL_GPL(ps3_set_bookmark);
66056 +
66057 +void ps3_set_pm_bookmark(u64 tag, u64 incident, u64 th_id)
66058 +{
66059 +       u64 bookmark;
66060 +
66061 +       bookmark = (get_tb() & 0x00000000FFFFFFFFULL) |
66062 +               PS3_PM_BOOKMARK_TAG_KERNEL;
66063 +       bookmark = ((tag << 56) & PS3_PM_BOOKMARK_TAG_MASK_LO) |
66064 +               (incident << 48) | (th_id << 32) | bookmark;
66065 +       ps3_set_bookmark(bookmark);
66066 +}
66067 +EXPORT_SYMBOL_GPL(ps3_set_pm_bookmark);
66068 +
66069 +/**
66070 + * ps3_read_phys_ctr - Read physical counter registers.
66071 + *
66072 + * Each physical counter can act as one 32 bit counter or as two 16 bit
66073 + * counters.
66074 + */
66075 +
66076 +u32 ps3_read_phys_ctr(u32 cpu, u32 phys_ctr)
66077 +{
66078 +       int result;
66079 +       u64 counter0415;
66080 +       u64 counter2637;
66081 +
66082 +       if (phys_ctr >= NR_PHYS_CTRS) {
66083 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
66084 +                       __LINE__, phys_ctr);
66085 +               return 0;
66086 +       }
66087 +
66088 +       result = lv1_set_lpm_counter(lpm_priv->lpm_id, 0, 0, 0, 0, &counter0415,
66089 +                                    &counter2637);
66090 +       if (result) {
66091 +               dev_err(sbd_core(), "%s:%u: lv1_set_lpm_counter failed: "
66092 +                       "phys_ctr %u, %s\n", __func__, __LINE__, phys_ctr,
66093 +                       ps3_result(result));
66094 +               return 0;
66095 +       }
66096 +
66097 +       switch (phys_ctr) {
66098 +       case 0:
66099 +               return counter0415 >> 32;
66100 +       case 1:
66101 +               return counter0415 & PS3_PM_COUNTER_MASK_LO;
66102 +       case 2:
66103 +               return counter2637 >> 32;
66104 +       case 3:
66105 +               return counter2637 & PS3_PM_COUNTER_MASK_LO;
66106 +       default:
66107 +               BUG();
66108 +       }
66109 +       return 0;
66110 +}
66111 +EXPORT_SYMBOL_GPL(ps3_read_phys_ctr);
66112 +
66113 +/**
66114 + * ps3_write_phys_ctr - Write physical counter registers.
66115 + *
66116 + * Each physical counter can act as one 32 bit counter or as two 16 bit
66117 + * counters.
66118 + */
66119 +
66120 +void ps3_write_phys_ctr(u32 cpu, u32 phys_ctr, u32 val)
66121 +{
66122 +       u64 counter0415;
66123 +       u64 counter0415_mask;
66124 +       u64 counter2637;
66125 +       u64 counter2637_mask;
66126 +       int result;
66127 +
66128 +       if (phys_ctr >= NR_PHYS_CTRS) {
66129 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
66130 +                       __LINE__, phys_ctr);
66131 +               return;
66132 +       }
66133 +
66134 +       switch (phys_ctr) {
66135 +       case 0:
66136 +               counter0415 = (u64)val << 32;
66137 +               counter0415_mask = PS3_PM_COUNTER_MASK_HI;
66138 +               counter2637 = 0x0;
66139 +               counter2637_mask = 0x0;
66140 +               break;
66141 +       case 1:
66142 +               counter0415 = (u64)val;
66143 +               counter0415_mask = PS3_PM_COUNTER_MASK_LO;
66144 +               counter2637 = 0x0;
66145 +               counter2637_mask = 0x0;
66146 +               break;
66147 +       case 2:
66148 +               counter0415 = 0x0;
66149 +               counter0415_mask = 0x0;
66150 +               counter2637 = (u64)val << 32;
66151 +               counter2637_mask = PS3_PM_COUNTER_MASK_HI;
66152 +               break;
66153 +       case 3:
66154 +               counter0415 = 0x0;
66155 +               counter0415_mask = 0x0;
66156 +               counter2637 = (u64)val;
66157 +               counter2637_mask = PS3_PM_COUNTER_MASK_LO;
66158 +               break;
66159 +       default:
66160 +               BUG();
66161 +       }
66162 +
66163 +       result = lv1_set_lpm_counter(lpm_priv->lpm_id,
66164 +                                    counter0415, counter0415_mask,
66165 +                                    counter2637, counter2637_mask,
66166 +                                    &counter0415, &counter2637);
66167 +       if (result)
66168 +               dev_err(sbd_core(), "%s:%u: lv1_set_lpm_counter failed: "
66169 +                       "phys_ctr %u, val %u, %s\n", __func__, __LINE__,
66170 +                       phys_ctr, val, ps3_result(result));
66171 +}
66172 +EXPORT_SYMBOL_GPL(ps3_write_phys_ctr);
66173 +
66174 +/**
66175 + * ps3_read_ctr - Read counter.
66176 + *
66177 + * Read 16 or 32 bits depending on the current size of the counter.
66178 + * Counters 4, 5, 6 & 7 are always 16 bit.
66179 + */
66180 +
66181 +u32 ps3_read_ctr(u32 cpu, u32 ctr)
66182 +{
66183 +       u32 val;
66184 +       u32 phys_ctr = ctr & (NR_PHYS_CTRS - 1);
66185 +
66186 +       val = ps3_read_phys_ctr(cpu, phys_ctr);
66187 +
66188 +       if (ps3_get_ctr_size(cpu, phys_ctr) == 16)
66189 +               val = (ctr < NR_PHYS_CTRS) ? (val >> 16) : (val & 0xffff);
66190 +
66191 +       return val;
66192 +}
66193 +EXPORT_SYMBOL_GPL(ps3_read_ctr);
66194 +
66195 +/**
66196 + * ps3_write_ctr - Write counter.
66197 + *
66198 + * Write 16 or 32 bits depending on the current size of the counter.
66199 + * Counters 4, 5, 6 & 7 are always 16 bit.
66200 + */
66201 +
66202 +void ps3_write_ctr(u32 cpu, u32 ctr, u32 val)
66203 +{
66204 +       u32 phys_ctr;
66205 +       u32 phys_val;
66206 +
66207 +       phys_ctr = ctr & (NR_PHYS_CTRS - 1);
66208 +
66209 +       if (ps3_get_ctr_size(cpu, phys_ctr) == 16) {
66210 +               phys_val = ps3_read_phys_ctr(cpu, phys_ctr);
66211 +
66212 +               if (ctr < NR_PHYS_CTRS)
66213 +                       val = (val << 16) | (phys_val & 0xffff);
66214 +               else
66215 +                       val = (val & 0xffff) | (phys_val & 0xffff0000);
66216 +       }
66217 +
66218 +       ps3_write_phys_ctr(cpu, phys_ctr, val);
66219 +}
66220 +EXPORT_SYMBOL_GPL(ps3_write_ctr);
66221 +
66222 +/**
66223 + * ps3_read_pm07_control - Read counter control registers.
66224 + *
66225 + * Each logical counter has a corresponding control register.
66226 + */
66227 +
66228 +u32 ps3_read_pm07_control(u32 cpu, u32 ctr)
66229 +{
66230 +       return 0;
66231 +}
66232 +EXPORT_SYMBOL_GPL(ps3_read_pm07_control);
66233 +
66234 +/**
66235 + * ps3_write_pm07_control - Write counter control registers.
66236 + *
66237 + * Each logical counter has a corresponding control register.
66238 + */
66239 +
66240 +void ps3_write_pm07_control(u32 cpu, u32 ctr, u32 val)
66241 +{
66242 +       int result;
66243 +       static const u64 mask = 0xFFFFFFFFFFFFFFFFULL;
66244 +       u64 old_value;
66245 +
66246 +       if (ctr >= NR_CTRS) {
66247 +               dev_dbg(sbd_core(), "%s:%u: ctr too big: %u\n", __func__,
66248 +                       __LINE__, ctr);
66249 +               return;
66250 +       }
66251 +
66252 +       result = lv1_set_lpm_counter_control(lpm_priv->lpm_id, ctr, val, mask,
66253 +                                            &old_value);
66254 +       if (result)
66255 +               dev_err(sbd_core(), "%s:%u: lv1_set_lpm_counter_control "
66256 +                       "failed: ctr %u, %s\n", __func__, __LINE__, ctr,
66257 +                       ps3_result(result));
66258 +}
66259 +EXPORT_SYMBOL_GPL(ps3_write_pm07_control);
66260 +
66261 +/**
66262 + * ps3_read_pm - Read Other LPM control registers.
66263 + */
66264 +
66265 +u32 ps3_read_pm(u32 cpu, enum pm_reg_name reg)
66266 +{
66267 +       int result = 0;
66268 +       u64 val = 0;
66269 +
66270 +       switch (reg) {
66271 +       case pm_control:
66272 +               return lpm_priv->shadow.pm_control;
66273 +       case trace_address:
66274 +               return CBE_PM_TRACE_BUF_EMPTY;
66275 +       case pm_start_stop:
66276 +               return lpm_priv->shadow.pm_start_stop;
66277 +       case pm_interval:
66278 +               return lpm_priv->shadow.pm_interval;
66279 +       case group_control:
66280 +               return lpm_priv->shadow.group_control;
66281 +       case debug_bus_control:
66282 +               return lpm_priv->shadow.debug_bus_control;
66283 +       case pm_status:
66284 +               result = lv1_get_lpm_interrupt_status(lpm_priv->lpm_id,
66285 +                                                     &val);
66286 +               if (result) {
66287 +                       val = 0;
66288 +                       dev_dbg(sbd_core(), "%s:%u: lv1 get_lpm_status failed: "
66289 +                               "reg %u, %s\n", __func__, __LINE__, reg,
66290 +                               ps3_result(result));
66291 +               }
66292 +               return (u32)val;
66293 +       case ext_tr_timer:
66294 +               return 0;
66295 +       default:
66296 +               dev_dbg(sbd_core(), "%s:%u: unknown reg: %d\n", __func__,
66297 +                       __LINE__, reg);
66298 +               BUG();
66299 +               break;
66300 +       }
66301 +
66302 +       return 0;
66303 +}
66304 +EXPORT_SYMBOL_GPL(ps3_read_pm);
66305 +
66306 +/**
66307 + * ps3_write_pm - Write Other LPM control registers.
66308 + */
66309 +
66310 +void ps3_write_pm(u32 cpu, enum pm_reg_name reg, u32 val)
66311 +{
66312 +       int result = 0;
66313 +       u64 dummy;
66314 +
66315 +       switch (reg) {
66316 +       case group_control:
66317 +               if (val != lpm_priv->shadow.group_control)
66318 +                       result = lv1_set_lpm_group_control(lpm_priv->lpm_id,
66319 +                                                          val,
66320 +                                                          PS3_WRITE_PM_MASK,
66321 +                                                          &dummy);
66322 +               lpm_priv->shadow.group_control = val;
66323 +               break;
66324 +       case debug_bus_control:
66325 +               if (val != lpm_priv->shadow.debug_bus_control)
66326 +                       result = lv1_set_lpm_debug_bus_control(lpm_priv->lpm_id,
66327 +                                                             val,
66328 +                                                             PS3_WRITE_PM_MASK,
66329 +                                                             &dummy);
66330 +               lpm_priv->shadow.debug_bus_control = val;
66331 +               break;
66332 +       case pm_control:
66333 +               if (use_start_stop_bookmark)
66334 +                       val |= (PS3_PM_CONTROL_PPU_TH0_BOOKMARK |
66335 +                               PS3_PM_CONTROL_PPU_TH1_BOOKMARK);
66336 +               if (val != lpm_priv->shadow.pm_control)
66337 +                       result = lv1_set_lpm_general_control(lpm_priv->lpm_id,
66338 +                                                            val,
66339 +                                                            PS3_WRITE_PM_MASK,
66340 +                                                            0, 0, &dummy,
66341 +                                                            &dummy);
66342 +               lpm_priv->shadow.pm_control = val;
66343 +               break;
66344 +       case pm_interval:
66345 +               if (val != lpm_priv->shadow.pm_interval)
66346 +                       result = lv1_set_lpm_interval(lpm_priv->lpm_id, val,
66347 +                                                  PS3_WRITE_PM_MASK, &dummy);
66348 +               lpm_priv->shadow.pm_interval = val;
66349 +               break;
66350 +       case pm_start_stop:
66351 +               if (val != lpm_priv->shadow.pm_start_stop)
66352 +                       result = lv1_set_lpm_trigger_control(lpm_priv->lpm_id,
66353 +                                                            val,
66354 +                                                            PS3_WRITE_PM_MASK,
66355 +                                                            &dummy);
66356 +               lpm_priv->shadow.pm_start_stop = val;
66357 +               break;
66358 +       case trace_address:
66359 +       case ext_tr_timer:
66360 +       case pm_status:
66361 +               break;
66362 +       default:
66363 +               dev_dbg(sbd_core(), "%s:%u: unknown reg: %d\n", __func__,
66364 +                       __LINE__, reg);
66365 +               BUG();
66366 +               break;
66367 +       }
66368 +
66369 +       if (result)
66370 +               dev_err(sbd_core(), "%s:%u: lv1 set_control failed: "
66371 +                       "reg %u, %s\n", __func__, __LINE__, reg,
66372 +                       ps3_result(result));
66373 +}
66374 +EXPORT_SYMBOL_GPL(ps3_write_pm);
66375 +
66376 +/**
66377 + * ps3_get_ctr_size - Get the size of a physical counter.
66378 + *
66379 + * Returns either 16 or 32.
66380 + */
66381 +
66382 +u32 ps3_get_ctr_size(u32 cpu, u32 phys_ctr)
66383 +{
66384 +       u32 pm_ctrl;
66385 +
66386 +       if (phys_ctr >= NR_PHYS_CTRS) {
66387 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
66388 +                       __LINE__, phys_ctr);
66389 +               return 0;
66390 +       }
66391 +
66392 +       pm_ctrl = ps3_read_pm(cpu, pm_control);
66393 +       return (pm_ctrl & CBE_PM_16BIT_CTR(phys_ctr)) ? 16 : 32;
66394 +}
66395 +EXPORT_SYMBOL_GPL(ps3_get_ctr_size);
66396 +
66397 +/**
66398 + * ps3_set_ctr_size - Set the size of a physical counter to 16 or 32 bits.
66399 + */
66400 +
66401 +void ps3_set_ctr_size(u32 cpu, u32 phys_ctr, u32 ctr_size)
66402 +{
66403 +       u32 pm_ctrl;
66404 +
66405 +       if (phys_ctr >= NR_PHYS_CTRS) {
66406 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
66407 +                       __LINE__, phys_ctr);
66408 +               return;
66409 +       }
66410 +
66411 +       pm_ctrl = ps3_read_pm(cpu, pm_control);
66412 +
66413 +       switch (ctr_size) {
66414 +       case 16:
66415 +               pm_ctrl |= CBE_PM_16BIT_CTR(phys_ctr);
66416 +               ps3_write_pm(cpu, pm_control, pm_ctrl);
66417 +               break;
66418 +
66419 +       case 32:
66420 +               pm_ctrl &= ~CBE_PM_16BIT_CTR(phys_ctr);
66421 +               ps3_write_pm(cpu, pm_control, pm_ctrl);
66422 +               break;
66423 +       default:
66424 +               BUG();
66425 +       }
66426 +}
66427 +EXPORT_SYMBOL_GPL(ps3_set_ctr_size);
66428 +
66429 +static u64 pm_translate_signal_group_number_on_island2(u64 subgroup)
66430 +{
66431 +
66432 +       if (subgroup == 2)
66433 +               subgroup = 3;
66434 +
66435 +       if (subgroup <= 6)
66436 +               return PM_ISLAND2_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66437 +       else if (subgroup == 7)
66438 +               return PM_ISLAND2_SIGNAL_GROUP_NUMBER1;
66439 +       else
66440 +               return PM_ISLAND2_SIGNAL_GROUP_NUMBER2;
66441 +}
66442 +
66443 +static u64 pm_translate_signal_group_number_on_island3(u64 subgroup)
66444 +{
66445 +
66446 +       switch (subgroup) {
66447 +       case 2:
66448 +       case 3:
66449 +       case 4:
66450 +               subgroup += 2;
66451 +               break;
66452 +       case 5:
66453 +               subgroup = 8;
66454 +               break;
66455 +       default:
66456 +               break;
66457 +       }
66458 +       return PM_ISLAND3_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66459 +}
66460 +
66461 +static u64 pm_translate_signal_group_number_on_island4(u64 subgroup)
66462 +{
66463 +       return PM_ISLAND4_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66464 +}
66465 +
66466 +static u64 pm_translate_signal_group_number_on_island5(u64 subgroup)
66467 +{
66468 +
66469 +       switch (subgroup) {
66470 +       case 3:
66471 +               subgroup = 4;
66472 +               break;
66473 +       case 4:
66474 +               subgroup = 6;
66475 +               break;
66476 +       default:
66477 +               break;
66478 +       }
66479 +       return PM_ISLAND5_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66480 +}
66481 +
66482 +static u64 pm_translate_signal_group_number_on_island6(u64 subgroup,
66483 +                                                      u64 subsubgroup)
66484 +{
66485 +       switch (subgroup) {
66486 +       case 3:
66487 +       case 4:
66488 +       case 5:
66489 +               subgroup += 1;
66490 +               break;
66491 +       default:
66492 +               break;
66493 +       }
66494 +
66495 +       switch (subsubgroup) {
66496 +       case 4:
66497 +       case 5:
66498 +       case 6:
66499 +               subsubgroup += 2;
66500 +               break;
66501 +       case 7:
66502 +       case 8:
66503 +       case 9:
66504 +       case 10:
66505 +               subsubgroup += 4;
66506 +               break;
66507 +       case 11:
66508 +       case 12:
66509 +       case 13:
66510 +               subsubgroup += 5;
66511 +               break;
66512 +       default:
66513 +               break;
66514 +       }
66515 +
66516 +       if (subgroup <= 5)
66517 +               return (PM_ISLAND6_BASE_SIGNAL_GROUP_NUMBER + subgroup);
66518 +       else
66519 +               return (PM_ISLAND6_BASE_SIGNAL_GROUP_NUMBER + subgroup
66520 +                       + subsubgroup - 1);
66521 +}
66522 +
66523 +static u64 pm_translate_signal_group_number_on_island7(u64 subgroup)
66524 +{
66525 +       return PM_ISLAND7_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66526 +}
66527 +
66528 +static u64 pm_translate_signal_group_number_on_island8(u64 subgroup)
66529 +{
66530 +       return PM_ISLAND8_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66531 +}
66532 +
66533 +static u64 pm_signal_group_to_ps3_lv1_signal_group(u64 group)
66534 +{
66535 +       u64 island;
66536 +       u64 subgroup;
66537 +       u64 subsubgroup;
66538 +
66539 +       subgroup = 0;
66540 +       subsubgroup = 0;
66541 +       island = 0;
66542 +       if (group < 1000) {
66543 +               if (group < 100) {
66544 +                       if (20 <= group && group < 30) {
66545 +                               island = 2;
66546 +                               subgroup = group - 20;
66547 +                       } else if (30 <= group && group < 40) {
66548 +                               island = 3;
66549 +                               subgroup = group - 30;
66550 +                       } else if (40 <= group && group < 50) {
66551 +                               island = 4;
66552 +                               subgroup = group - 40;
66553 +                       } else if (50 <= group && group < 60) {
66554 +                               island = 5;
66555 +                               subgroup = group - 50;
66556 +                       } else if (60 <= group && group < 70) {
66557 +                               island = 6;
66558 +                               subgroup = group - 60;
66559 +                       } else if (70 <= group && group < 80) {
66560 +                               island = 7;
66561 +                               subgroup = group - 70;
66562 +                       } else if (80 <= group && group < 90) {
66563 +                               island = 8;
66564 +                               subgroup = group - 80;
66565 +                       }
66566 +               } else if (200 <= group && group < 300) {
66567 +                       island = 2;
66568 +                       subgroup = group - 200;
66569 +               } else if (600 <= group && group < 700) {
66570 +                       island = 6;
66571 +                       subgroup = 5;
66572 +                       subsubgroup = group - 650;
66573 +               }
66574 +       } else if (6000 <= group && group < 7000) {
66575 +               island = 6;
66576 +               subgroup = 5;
66577 +               subsubgroup = group - 6500;
66578 +       }
66579 +
66580 +       switch (island) {
66581 +       case 2:
66582 +               return pm_translate_signal_group_number_on_island2(subgroup);
66583 +       case 3:
66584 +               return pm_translate_signal_group_number_on_island3(subgroup);
66585 +       case 4:
66586 +               return pm_translate_signal_group_number_on_island4(subgroup);
66587 +       case 5:
66588 +               return pm_translate_signal_group_number_on_island5(subgroup);
66589 +       case 6:
66590 +               return pm_translate_signal_group_number_on_island6(subgroup,
66591 +                                                                  subsubgroup);
66592 +       case 7:
66593 +               return pm_translate_signal_group_number_on_island7(subgroup);
66594 +       case 8:
66595 +               return pm_translate_signal_group_number_on_island8(subgroup);
66596 +       default:
66597 +               dev_dbg(sbd_core(), "%s:%u: island not found: %lu\n", __func__,
66598 +                       __LINE__, group);
66599 +               BUG();
66600 +               break;
66601 +       }
66602 +       return 0;
66603 +}
66604 +
66605 +static u64 pm_bus_word_to_ps3_lv1_bus_word(u8 word)
66606 +{
66607 +
66608 +       switch (word) {
66609 +       case 1:
66610 +               return 0xF000;
66611 +       case 2:
66612 +               return 0x0F00;
66613 +       case 4:
66614 +               return 0x00F0;
66615 +       case 8:
66616 +       default:
66617 +               return 0x000F;
66618 +       }
66619 +}
66620 +
66621 +static int __ps3_set_signal(u64 lv1_signal_group, u64 bus_select,
66622 +                           u64 signal_select, u64 attr1, u64 attr2, u64 attr3)
66623 +{
66624 +       int ret;
66625 +
66626 +       ret = lv1_set_lpm_signal(lpm_priv->lpm_id, lv1_signal_group, bus_select,
66627 +                                signal_select, attr1, attr2, attr3);
66628 +       if (ret)
66629 +               dev_err(sbd_core(),
66630 +                       "%s:%u: error:%d 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n",
66631 +                       __func__, __LINE__, ret, lv1_signal_group, bus_select,
66632 +                       signal_select, attr1, attr2, attr3);
66633 +
66634 +       return ret;
66635 +}
66636 +
66637 +int ps3_set_signal(u64 signal_group, u8 signal_bit, u16 sub_unit,
66638 +                  u8 bus_word)
66639 +{
66640 +       int ret;
66641 +       u64 lv1_signal_group;
66642 +       u64 bus_select;
66643 +       u64 signal_select;
66644 +       u64 attr1, attr2, attr3;
66645 +
66646 +       if (signal_group == 0)
66647 +               return __ps3_set_signal(0, 0, 0, 0, 0, 0);
66648 +
66649 +       lv1_signal_group =
66650 +               pm_signal_group_to_ps3_lv1_signal_group(signal_group);
66651 +       bus_select = pm_bus_word_to_ps3_lv1_bus_word(bus_word);
66652 +
66653 +       switch (signal_group) {
66654 +       case PM_SIG_GROUP_SPU_TRIGGER:
66655 +               signal_select = 1;
66656 +               signal_select = signal_select << (63 - signal_bit);
66657 +               break;
66658 +       case PM_SIG_GROUP_SPU_EVENT:
66659 +               signal_select = 1;
66660 +               signal_select = (signal_select << (63 - signal_bit)) | 0x3;
66661 +               break;
66662 +       default:
66663 +               signal_select = 0;
66664 +               break;
66665 +       }
66666 +
66667 +       /*
66668 +        * 0: physical object.
66669 +        * 1: logical object.
66670 +        * This parameter is only used for the PPE and SPE signals.
66671 +        */
66672 +       attr1 = 1;
66673 +
66674 +       /*
66675 +        * This parameter is used to specify the target physical/logical
66676 +        * PPE/SPE object.
66677 +        */
66678 +       if (PM_SIG_GROUP_SPU <= signal_group &&
66679 +               signal_group < PM_SIG_GROUP_MFC_MAX)
66680 +               attr2 = sub_unit;
66681 +       else
66682 +               attr2 = lpm_priv->pu_id;
66683 +
66684 +       /*
66685 +        * This parameter is only used for setting the SPE signal.
66686 +        */
66687 +       attr3 = 0;
66688 +
66689 +       ret = __ps3_set_signal(lv1_signal_group, bus_select, signal_select,
66690 +                              attr1, attr2, attr3);
66691 +       if (ret)
66692 +               dev_err(sbd_core(), "%s:%u: __ps3_set_signal failed: %d\n",
66693 +                       __func__, __LINE__, ret);
66694 +
66695 +       return ret;
66696 +}
66697 +EXPORT_SYMBOL_GPL(ps3_set_signal);
66698 +
66699 +u32 ps3_get_hw_thread_id(int cpu)
66700 +{
66701 +       return get_hard_smp_processor_id(cpu);
66702 +}
66703 +EXPORT_SYMBOL_GPL(ps3_get_hw_thread_id);
66704 +
66705 +/**
66706 + * ps3_enable_pm - Enable the entire performance monitoring unit.
66707 + *
66708 + * When we enable the LPM, all pending writes to counters get committed.
66709 + */
66710 +
66711 +void ps3_enable_pm(u32 cpu)
66712 +{
66713 +       int result;
66714 +       u64 tmp;
66715 +       int insert_bookmark = 0;
66716 +
66717 +       lpm_priv->tb_count = 0;
66718 +
66719 +       if (use_start_stop_bookmark) {
66720 +               if (!(lpm_priv->shadow.pm_start_stop &
66721 +                       (PS3_PM_START_STOP_START_MASK
66722 +                       | PS3_PM_START_STOP_STOP_MASK))) {
66723 +                       result = lv1_set_lpm_trigger_control(lpm_priv->lpm_id,
66724 +                               (PS3_PM_START_STOP_PPU_TH0_BOOKMARK_START |
66725 +                               PS3_PM_START_STOP_PPU_TH1_BOOKMARK_START |
66726 +                               PS3_PM_START_STOP_PPU_TH0_BOOKMARK_STOP |
66727 +                               PS3_PM_START_STOP_PPU_TH1_BOOKMARK_STOP),
66728 +                               0xFFFFFFFFFFFFFFFFULL, &tmp);
66729 +
66730 +                       if (result)
66731 +                               dev_err(sbd_core(), "%s:%u: "
66732 +                                       "lv1_set_lpm_trigger_control failed: "
66733 +                                       "%s\n", __func__, __LINE__,
66734 +                                       ps3_result(result));
66735 +
66736 +                       insert_bookmark = !result;
66737 +               }
66738 +       }
66739 +
66740 +       result = lv1_start_lpm(lpm_priv->lpm_id);
66741 +
66742 +       if (result)
66743 +               dev_err(sbd_core(), "%s:%u: lv1_start_lpm failed: %s\n",
66744 +                       __func__, __LINE__, ps3_result(result));
66745 +
66746 +       if (use_start_stop_bookmark && !result && insert_bookmark)
66747 +               ps3_set_bookmark(get_tb() | PS3_PM_BOOKMARK_START);
66748 +}
66749 +EXPORT_SYMBOL_GPL(ps3_enable_pm);
66750 +
66751 +/**
66752 + * ps3_disable_pm - Disable the entire performance monitoring unit.
66753 + */
66754 +
66755 +void ps3_disable_pm(u32 cpu)
66756 +{
66757 +       int result;
66758 +       u64 tmp;
66759 +
66760 +       ps3_set_bookmark(get_tb() | PS3_PM_BOOKMARK_STOP);
66761 +
66762 +       result = lv1_stop_lpm(lpm_priv->lpm_id, &tmp);
66763 +
66764 +       if (result) {
66765 +               if(result != LV1_WRONG_STATE)
66766 +                       dev_err(sbd_core(), "%s:%u: lv1_stop_lpm failed: %s\n",
66767 +                               __func__, __LINE__, ps3_result(result));
66768 +               return;
66769 +       }
66770 +
66771 +       lpm_priv->tb_count = tmp;
66772 +
66773 +       dev_dbg(sbd_core(), "%s:%u: tb_count %lu (%lxh)\n", __func__, __LINE__,
66774 +               lpm_priv->tb_count, lpm_priv->tb_count);
66775 +}
66776 +EXPORT_SYMBOL_GPL(ps3_disable_pm);
66777 +
66778 +/**
66779 + * ps3_lpm_copy_tb - Copy data from the trace buffer to a kernel buffer.
66780 + * @offset: Offset in bytes from the start of the trace buffer.
66781 + * @buf: Copy destination.
66782 + * @count: Maximum count of bytes to copy.
66783 + * @bytes_copied: Pointer to a variable that will recieve the number of
66784 + *  bytes copied to @buf.
66785 + *
66786 + * On error @buf will contain any successfully copied trace buffer data
66787 + * and bytes_copied will be set to the number of bytes successfully copied.
66788 + */
66789 +
66790 +int ps3_lpm_copy_tb(unsigned long offset, void *buf, unsigned long count,
66791 +                   unsigned long *bytes_copied)
66792 +{
66793 +       int result;
66794 +
66795 +       *bytes_copied = 0;
66796 +
66797 +       if (!lpm_priv->tb_cache)
66798 +               return -EPERM;
66799 +
66800 +       if (offset >= lpm_priv->tb_count)
66801 +               return 0;
66802 +
66803 +       count = min(count, lpm_priv->tb_count - offset);
66804 +
66805 +       while (*bytes_copied < count) {
66806 +               const unsigned long request = count - *bytes_copied;
66807 +               u64 tmp;
66808 +
66809 +               result = lv1_copy_lpm_trace_buffer(lpm_priv->lpm_id, offset,
66810 +                                                  request, &tmp);
66811 +               if (result) {
66812 +                       dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%lx\n",
66813 +                               __func__, __LINE__, request, offset);
66814 +
66815 +                       dev_err(sbd_core(), "%s:%u: lv1_copy_lpm_trace_buffer "
66816 +                               "failed: %s\n", __func__, __LINE__,
66817 +                               ps3_result(result));
66818 +                       return result == LV1_WRONG_STATE ? -EBUSY : -EINVAL;
66819 +               }
66820 +
66821 +               memcpy(buf, lpm_priv->tb_cache, tmp);
66822 +               buf += tmp;
66823 +               *bytes_copied += tmp;
66824 +               offset += tmp;
66825 +       }
66826 +       dev_dbg(sbd_core(), "%s:%u: copied %lxh bytes\n", __func__, __LINE__,
66827 +               *bytes_copied);
66828 +
66829 +       return 0;
66830 +}
66831 +EXPORT_SYMBOL_GPL(ps3_lpm_copy_tb);
66832 +
66833 +/**
66834 + * ps3_lpm_copy_tb_to_user - Copy data from the trace buffer to a user buffer.
66835 + * @offset: Offset in bytes from the start of the trace buffer.
66836 + * @buf: A __user copy destination.
66837 + * @count: Maximum count of bytes to copy.
66838 + * @bytes_copied: Pointer to a variable that will recieve the number of
66839 + *  bytes copied to @buf.
66840 + *
66841 + * On error @buf will contain any successfully copied trace buffer data
66842 + * and bytes_copied will be set to the number of bytes successfully copied.
66843 + */
66844 +
66845 +int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf,
66846 +                           unsigned long count, unsigned long *bytes_copied)
66847 +{
66848 +       int result;
66849 +
66850 +       *bytes_copied = 0;
66851 +
66852 +       if (!lpm_priv->tb_cache)
66853 +               return -EPERM;
66854 +
66855 +       if (offset >= lpm_priv->tb_count)
66856 +               return 0;
66857 +
66858 +       count = min(count, lpm_priv->tb_count - offset);
66859 +
66860 +       while (*bytes_copied < count) {
66861 +               const unsigned long request = count - *bytes_copied;
66862 +               u64 tmp;
66863 +
66864 +               result = lv1_copy_lpm_trace_buffer(lpm_priv->lpm_id, offset,
66865 +                                                  request, &tmp);
66866 +               if (result) {
66867 +                       dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%lx\n",
66868 +                               __func__, __LINE__, request, offset);
66869 +                       dev_err(sbd_core(), "%s:%u: lv1_copy_lpm_trace_buffer "
66870 +                               "failed: %s\n", __func__, __LINE__,
66871 +                               ps3_result(result));
66872 +                       return result == LV1_WRONG_STATE ? -EBUSY : -EINVAL;
66873 +               }
66874 +
66875 +               result = copy_to_user(buf, lpm_priv->tb_cache, tmp);
66876 +
66877 +               if (result) {
66878 +                       dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%p\n",
66879 +                               __func__, __LINE__, tmp, buf);
66880 +                       dev_err(sbd_core(), "%s:%u: copy_to_user failed: %d\n",
66881 +                               __func__, __LINE__, result);
66882 +                       return -EFAULT;
66883 +               }
66884 +
66885 +               buf += tmp;
66886 +               *bytes_copied += tmp;
66887 +               offset += tmp;
66888 +       }
66889 +       dev_dbg(sbd_core(), "%s:%u: copied %lxh bytes\n", __func__, __LINE__,
66890 +               *bytes_copied);
66891 +
66892 +       return 0;
66893 +}
66894 +EXPORT_SYMBOL_GPL(ps3_lpm_copy_tb_to_user);
66895 +
66896 +/**
66897 + * ps3_get_and_clear_pm_interrupts -
66898 + *
66899 + * Clearing interrupts for the entire performance monitoring unit.
66900 + * Reading pm_status clears the interrupt bits.
66901 + */
66902 +
66903 +u32 ps3_get_and_clear_pm_interrupts(u32 cpu)
66904 +{
66905 +       return ps3_read_pm(cpu, pm_status);
66906 +}
66907 +EXPORT_SYMBOL_GPL(ps3_get_and_clear_pm_interrupts);
66908 +
66909 +/**
66910 + * ps3_enable_pm_interrupts -
66911 + *
66912 + * Enabling interrupts for the entire performance monitoring unit.
66913 + * Enables the interrupt bits in the pm_status register.
66914 + */
66915 +
66916 +void ps3_enable_pm_interrupts(u32 cpu, u32 thread, u32 mask)
66917 +{
66918 +       if (mask)
66919 +               ps3_write_pm(cpu, pm_status, mask);
66920 +}
66921 +EXPORT_SYMBOL_GPL(ps3_enable_pm_interrupts);
66922 +
66923 +/**
66924 + * ps3_enable_pm_interrupts -
66925 + *
66926 + * Disabling interrupts for the entire performance monitoring unit.
66927 + */
66928 +
66929 +void ps3_disable_pm_interrupts(u32 cpu)
66930 +{
66931 +       ps3_get_and_clear_pm_interrupts(cpu);
66932 +       ps3_write_pm(cpu, pm_status, 0);
66933 +}
66934 +EXPORT_SYMBOL_GPL(ps3_disable_pm_interrupts);
66935 +
66936 +/**
66937 + * ps3_lpm_open - Open the logical performance monitor device.
66938 + * @tb_type: Specifies the type of trace buffer lv1 sould use for this lpm
66939 + *  instance, specified by one of enum ps3_lpm_tb_type.
66940 + * @tb_cache: Optional user supplied buffer to use as the trace buffer cache.
66941 + *  If NULL, the driver will allocate and manage an internal buffer.
66942 + *  Unused when when @tb_type is PS3_LPM_TB_TYPE_NONE.
66943 + * @tb_cache_size: The size in bytes of the user supplied @tb_cache buffer.
66944 + *  Unused when @tb_cache is NULL or @tb_type is PS3_LPM_TB_TYPE_NONE.
66945 + */
66946 +
66947 +int ps3_lpm_open(enum ps3_lpm_tb_type tb_type, void *tb_cache,
66948 +       u64 tb_cache_size)
66949 +{
66950 +       int result;
66951 +       u64 tb_size;
66952 +
66953 +       BUG_ON(!lpm_priv);
66954 +       BUG_ON(tb_type != PS3_LPM_TB_TYPE_NONE
66955 +               && tb_type != PS3_LPM_TB_TYPE_INTERNAL);
66956 +
66957 +       if (tb_type == PS3_LPM_TB_TYPE_NONE && tb_cache)
66958 +               dev_dbg(sbd_core(), "%s:%u: bad in vals\n", __func__, __LINE__);
66959 +
66960 +       if (!atomic_add_unless(&lpm_priv->open, 1, 1)) {
66961 +               dev_dbg(sbd_core(), "%s:%u: busy\n", __func__, __LINE__);
66962 +               return -EBUSY;
66963 +       }
66964 +
66965 +       /* Note tb_cache needs 128 byte alignment. */
66966 +
66967 +       if (tb_type == PS3_LPM_TB_TYPE_NONE) {
66968 +               lpm_priv->tb_cache_size = 0;
66969 +               lpm_priv->tb_cache_internal = NULL;
66970 +               lpm_priv->tb_cache = NULL;
66971 +       } else if (tb_cache) {
66972 +               if (tb_cache != (void *)_ALIGN_UP((unsigned long)tb_cache, 128)
66973 +                       || tb_cache_size != _ALIGN_UP(tb_cache_size, 128)) {
66974 +                       dev_err(sbd_core(), "%s:%u: unaligned tb_cache\n",
66975 +                               __func__, __LINE__);
66976 +                       result = -EINVAL;
66977 +                       goto fail_align;
66978 +               }
66979 +               lpm_priv->tb_cache_size = tb_cache_size;
66980 +               lpm_priv->tb_cache_internal = NULL;
66981 +               lpm_priv->tb_cache = tb_cache;
66982 +       } else {
66983 +               lpm_priv->tb_cache_size = PS3_LPM_DEFAULT_TB_CACHE_SIZE;
66984 +               lpm_priv->tb_cache_internal = kzalloc(
66985 +                       lpm_priv->tb_cache_size + 127, GFP_KERNEL);
66986 +               if (!lpm_priv->tb_cache_internal) {
66987 +                       dev_err(sbd_core(), "%s:%u: alloc internal tb_cache "
66988 +                               "failed\n", __func__, __LINE__);
66989 +                       result = -ENOMEM;
66990 +                       goto fail_malloc;
66991 +               }
66992 +               lpm_priv->tb_cache = (void *)_ALIGN_UP(
66993 +                       (unsigned long)lpm_priv->tb_cache_internal, 128);
66994 +       }
66995 +
66996 +       result = lv1_construct_lpm(lpm_priv->node_id, tb_type, 0, 0,
66997 +                               ps3_mm_phys_to_lpar(__pa(lpm_priv->tb_cache)),
66998 +                               lpm_priv->tb_cache_size, &lpm_priv->lpm_id,
66999 +                               &lpm_priv->outlet_id, &tb_size);
67000 +
67001 +       if (result) {
67002 +               dev_err(sbd_core(), "%s:%u: lv1_construct_lpm failed: %s\n",
67003 +                       __func__, __LINE__, ps3_result(result));
67004 +               result = -EINVAL;
67005 +               goto fail_construct;
67006 +       }
67007 +
67008 +       lpm_priv->shadow.pm_control = PS3_LPM_SHADOW_REG_INIT;
67009 +       lpm_priv->shadow.pm_start_stop = PS3_LPM_SHADOW_REG_INIT;
67010 +       lpm_priv->shadow.pm_interval = PS3_LPM_SHADOW_REG_INIT;
67011 +       lpm_priv->shadow.group_control = PS3_LPM_SHADOW_REG_INIT;
67012 +       lpm_priv->shadow.debug_bus_control = PS3_LPM_SHADOW_REG_INIT;
67013 +
67014 +       dev_dbg(sbd_core(), "%s:%u: lpm_id 0x%lx, outlet_id 0x%lx, "
67015 +               "tb_size 0x%lx\n", __func__, __LINE__, lpm_priv->lpm_id,
67016 +               lpm_priv->outlet_id, tb_size);
67017 +
67018 +       return 0;
67019 +
67020 +fail_construct:
67021 +       kfree(lpm_priv->tb_cache_internal);
67022 +       lpm_priv->tb_cache_internal = NULL;
67023 +fail_malloc:
67024 +fail_align:
67025 +       atomic_dec(&lpm_priv->open);
67026 +       return result;
67027 +}
67028 +EXPORT_SYMBOL_GPL(ps3_lpm_open);
67029 +
67030 +/**
67031 + * ps3_lpm_close - Close the lpm device.
67032 + *
67033 + */
67034 +
67035 +int ps3_lpm_close(void)
67036 +{
67037 +       dev_dbg(sbd_core(), "%s:%u\n", __func__, __LINE__);
67038 +
67039 +       lv1_destruct_lpm(lpm_priv->lpm_id);
67040 +       lpm_priv->lpm_id = 0;
67041 +
67042 +       kfree(lpm_priv->tb_cache_internal);
67043 +       lpm_priv->tb_cache_internal = NULL;
67044 +
67045 +       atomic_dec(&lpm_priv->open);
67046 +       return 0;
67047 +}
67048 +EXPORT_SYMBOL_GPL(ps3_lpm_close);
67049 +
67050 +static int __devinit ps3_lpm_probe(struct ps3_system_bus_device *dev)
67051 +{
67052 +       dev_dbg(&dev->core, " -> %s:%u\n", __func__, __LINE__);
67053 +
67054 +       if (lpm_priv) {
67055 +               dev_info(&dev->core, "%s:%u: called twice\n",
67056 +                       __func__, __LINE__);
67057 +               return -EBUSY;
67058 +       }
67059 +
67060 +       lpm_priv = kzalloc(sizeof(*lpm_priv), GFP_KERNEL);
67061 +
67062 +       if (!lpm_priv)
67063 +               return -ENOMEM;
67064 +
67065 +       lpm_priv->sbd = dev;
67066 +       lpm_priv->node_id = dev->lpm.node_id;
67067 +       lpm_priv->pu_id = dev->lpm.pu_id;
67068 +       lpm_priv->rights = dev->lpm.rights;
67069 +
67070 +       dev_info(&dev->core, " <- %s:%u:\n", __func__, __LINE__);
67071 +
67072 +       return 0;
67073 +}
67074 +
67075 +static int ps3_lpm_remove(struct ps3_system_bus_device *dev)
67076 +{
67077 +       dev_dbg(&dev->core, " -> %s:%u:\n", __func__, __LINE__);
67078 +
67079 +       ps3_lpm_close();
67080 +
67081 +       kfree(lpm_priv);
67082 +       lpm_priv = NULL;
67083 +
67084 +       dev_info(&dev->core, " <- %s:%u:\n", __func__, __LINE__);
67085 +       return 0;
67086 +}
67087 +
67088 +static struct ps3_system_bus_driver ps3_lpm_driver = {
67089 +       .match_id = PS3_MATCH_ID_LPM,
67090 +       .core.name      = "ps3-lpm",
67091 +       .core.owner     = THIS_MODULE,
67092 +       .probe          = ps3_lpm_probe,
67093 +       .remove         = ps3_lpm_remove,
67094 +       .shutdown       = ps3_lpm_remove,
67095 +};
67096 +
67097 +static int __init ps3_lpm_init(void)
67098 +{
67099 +       pr_debug("%s:%d:\n", __func__, __LINE__);
67100 +       return ps3_system_bus_driver_register(&ps3_lpm_driver);
67101 +}
67102 +
67103 +static void __exit ps3_lpm_exit(void)
67104 +{
67105 +       pr_debug("%s:%d:\n", __func__, __LINE__);
67106 +       ps3_system_bus_driver_unregister(&ps3_lpm_driver);
67107 +}
67108 +
67109 +module_init(ps3_lpm_init);
67110 +module_exit(ps3_lpm_exit);
67111 +
67112 +MODULE_LICENSE("GPL v2");
67113 +MODULE_DESCRIPTION("PS3 Logical Performance Monitor Driver");
67114 +MODULE_AUTHOR("Sony Corporation");
67115 +MODULE_ALIAS(PS3_MODULE_ALIAS_LPM);
67116 Index: linux-2.6.24.7/drivers/ps3/ps3-sys-manager.c
67117 ===================================================================
67118 --- linux-2.6.24.7.orig/drivers/ps3/ps3-sys-manager.c
67119 +++ linux-2.6.24.7/drivers/ps3/ps3-sys-manager.c
67120 @@ -452,7 +452,7 @@ static int ps3_sys_manager_handle_event(
67121         case PS3_SM_EVENT_THERMAL_ALERT:
67122                 dev_dbg(&dev->core, "%s:%d: THERMAL_ALERT (zone %u)\n",
67123                         __func__, __LINE__, event.value);
67124 -               printk(KERN_INFO "PS3 Thermal Alert Zone %u\n", event.value);
67125 +               pr_info("PS3 Thermal Alert Zone %u\n", event.value);
67126                 break;
67127         case PS3_SM_EVENT_THERMAL_CLEARED:
67128                 dev_dbg(&dev->core, "%s:%d: THERMAL_CLEARED (zone %u)\n",
67129 @@ -488,7 +488,7 @@ static int ps3_sys_manager_handle_cmd(st
67130         result = ps3_vuart_read(dev, &cmd, sizeof(cmd));
67131         BUG_ON(result && "need to retry here");
67132  
67133 -       if(result)
67134 +       if (result)
67135                 return result;
67136  
67137         if (cmd.version != 1) {
67138 @@ -521,7 +521,7 @@ static int ps3_sys_manager_handle_msg(st
67139         result = ps3_vuart_read(dev, &header,
67140                 sizeof(struct ps3_sys_manager_header));
67141  
67142 -       if(result)
67143 +       if (result)
67144                 return result;
67145  
67146         if (header.version != 1) {
67147 @@ -589,9 +589,9 @@ static void ps3_sys_manager_final_power_
67148                 PS3_SM_WAKE_DEFAULT);
67149         ps3_sys_manager_send_request_shutdown(dev);
67150  
67151 -       printk(KERN_EMERG "System Halted, OK to turn off power\n");
67152 +       pr_emerg("System Halted, OK to turn off power\n");
67153  
67154 -       while(1)
67155 +       while (1)
67156                 ps3_sys_manager_handle_msg(dev);
67157  }
67158  
67159 @@ -626,9 +626,9 @@ static void ps3_sys_manager_final_restar
67160                 PS3_SM_WAKE_DEFAULT);
67161         ps3_sys_manager_send_request_shutdown(dev);
67162  
67163 -       printk(KERN_EMERG "System Halted, OK to turn off power\n");
67164 +       pr_emerg("System Halted, OK to turn off power\n");
67165  
67166 -       while(1)
67167 +       while (1)
67168                 ps3_sys_manager_handle_msg(dev);
67169  }
67170  
67171 Index: linux-2.6.24.7/drivers/ps3/ps3-vuart.c
67172 ===================================================================
67173 --- linux-2.6.24.7.orig/drivers/ps3/ps3-vuart.c
67174 +++ linux-2.6.24.7/drivers/ps3/ps3-vuart.c
67175 @@ -108,18 +108,18 @@ static struct ps3_vuart_port_priv *to_po
67176  struct ports_bmp {
67177         u64 status;
67178         u64 unused[3];
67179 -} __attribute__ ((aligned (32)));
67180 +} __attribute__((aligned(32)));
67181  
67182  #define dump_ports_bmp(_b) _dump_ports_bmp(_b, __func__, __LINE__)
67183  static void __maybe_unused _dump_ports_bmp(
67184 -       const struct ports_bmp* bmp, const char* func, int line)
67185 +       const struct ports_bmp *bmp, const char *func, int line)
67186  {
67187         pr_debug("%s:%d: ports_bmp: %016lxh\n", func, line, bmp->status);
67188  }
67189  
67190  #define dump_port_params(_b) _dump_port_params(_b, __func__, __LINE__)
67191  static void __maybe_unused _dump_port_params(unsigned int port_number,
67192 -       const char* func, int line)
67193 +       const char *func, int line)
67194  {
67195  #if defined(DEBUG)
67196         static const char *strings[] = {
67197 @@ -363,7 +363,7 @@ int ps3_vuart_disable_interrupt_disconne
67198   */
67199  
67200  static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
67201 -       const void* buf, unsigned int bytes, unsigned long *bytes_written)
67202 +       const void *buf, unsigned int bytes, unsigned long *bytes_written)
67203  {
67204         int result;
67205         struct ps3_vuart_port_priv *priv = to_port_priv(dev);
67206 @@ -431,7 +431,7 @@ void ps3_vuart_clear_rx_bytes(struct ps3
67207         int result;
67208         struct ps3_vuart_port_priv *priv = to_port_priv(dev);
67209         u64 bytes_waiting;
67210 -       void* tmp;
67211 +       void *tmp;
67212  
67213         result = ps3_vuart_get_rx_bytes_waiting(dev, &bytes_waiting);
67214  
67215 @@ -526,9 +526,8 @@ int ps3_vuart_write(struct ps3_system_bu
67216  
67217         lb = kmalloc(sizeof(struct list_buffer) + bytes, GFP_KERNEL);
67218  
67219 -       if (!lb) {
67220 +       if (!lb)
67221                 return -ENOMEM;
67222 -       }
67223  
67224         memcpy(lb->data, buf, bytes);
67225         lb->head = lb->data;
67226 @@ -878,7 +877,7 @@ static int ps3_vuart_handle_port_interru
67227  struct vuart_bus_priv {
67228         struct ports_bmp *bmp;
67229         unsigned int virq;
67230 -       struct semaphore probe_mutex;
67231 +       struct mutex probe_mutex;
67232         int use_count;
67233         struct ps3_system_bus_device *devices[PORT_COUNT];
67234  } static vuart_bus_priv;
67235 @@ -926,9 +925,8 @@ static int ps3_vuart_bus_interrupt_get(v
67236  
67237         BUG_ON(vuart_bus_priv.use_count > 2);
67238  
67239 -       if (vuart_bus_priv.use_count != 1) {
67240 +       if (vuart_bus_priv.use_count != 1)
67241                 return 0;
67242 -       }
67243  
67244         BUG_ON(vuart_bus_priv.bmp);
67245  
67246 @@ -1017,7 +1015,7 @@ static int ps3_vuart_probe(struct ps3_sy
67247                 return -EINVAL;
67248         }
67249  
67250 -       down(&vuart_bus_priv.probe_mutex);
67251 +       mutex_lock(&vuart_bus_priv.probe_mutex);
67252  
67253         result = ps3_vuart_bus_interrupt_get();
67254  
67255 @@ -1077,7 +1075,7 @@ static int ps3_vuart_probe(struct ps3_sy
67256                 goto fail_probe;
67257         }
67258  
67259 -       up(&vuart_bus_priv.probe_mutex);
67260 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
67261  
67262         return result;
67263  
67264 @@ -1090,7 +1088,7 @@ fail_dev_malloc:
67265  fail_busy:
67266         ps3_vuart_bus_interrupt_put();
67267  fail_setup_interrupt:
67268 -       up(&vuart_bus_priv.probe_mutex);
67269 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
67270         dev_dbg(&dev->core, "%s:%d: failed\n", __func__, __LINE__);
67271         return result;
67272  }
67273 @@ -1129,7 +1127,7 @@ static int ps3_vuart_remove(struct ps3_s
67274  
67275         BUG_ON(!dev);
67276  
67277 -       down(&vuart_bus_priv.probe_mutex);
67278 +       mutex_lock(&vuart_bus_priv.probe_mutex);
67279  
67280         dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
67281                 dev->match_id);
67282 @@ -1137,7 +1135,7 @@ static int ps3_vuart_remove(struct ps3_s
67283         if (!dev->core.driver) {
67284                 dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
67285                         __LINE__);
67286 -               up(&vuart_bus_priv.probe_mutex);
67287 +               mutex_unlock(&vuart_bus_priv.probe_mutex);
67288                 return 0;
67289         }
67290  
67291 @@ -1160,7 +1158,7 @@ static int ps3_vuart_remove(struct ps3_s
67292         priv = NULL;
67293  
67294         dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
67295 -       up(&vuart_bus_priv.probe_mutex);
67296 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
67297         return 0;
67298  }
67299  
67300 @@ -1180,7 +1178,7 @@ static int ps3_vuart_shutdown(struct ps3
67301  
67302         BUG_ON(!dev);
67303  
67304 -       down(&vuart_bus_priv.probe_mutex);
67305 +       mutex_lock(&vuart_bus_priv.probe_mutex);
67306  
67307         dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
67308                 dev->match_id);
67309 @@ -1188,7 +1186,7 @@ static int ps3_vuart_shutdown(struct ps3
67310         if (!dev->core.driver) {
67311                 dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
67312                         __LINE__);
67313 -               up(&vuart_bus_priv.probe_mutex);
67314 +               mutex_unlock(&vuart_bus_priv.probe_mutex);
67315                 return 0;
67316         }
67317  
67318 @@ -1212,7 +1210,7 @@ static int ps3_vuart_shutdown(struct ps3
67319  
67320         dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
67321  
67322 -       up(&vuart_bus_priv.probe_mutex);
67323 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
67324         return 0;
67325  }
67326  
67327 @@ -1223,7 +1221,7 @@ static int __init ps3_vuart_bus_init(voi
67328         if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
67329                 return -ENODEV;
67330  
67331 -       init_MUTEX(&vuart_bus_priv.probe_mutex);
67332 +       mutex_init(&vuart_bus_priv.probe_mutex);
67333  
67334         return 0;
67335  }
67336 Index: linux-2.6.24.7/drivers/serial/Kconfig
67337 ===================================================================
67338 --- linux-2.6.24.7.orig/drivers/serial/Kconfig
67339 +++ linux-2.6.24.7/drivers/serial/Kconfig
67340 @@ -1284,4 +1284,14 @@ config SERIAL_OF_PLATFORM
67341           Currently, only 8250 compatible ports are supported, but
67342           others can easily be added.
67343  
67344 +config SERIAL_QE
67345 +       tristate "Freescale QUICC Engine serial port support"
67346 +       depends on QUICC_ENGINE
67347 +       select SERIAL_CORE
67348 +       select FW_LOADER
67349 +       default n
67350 +       help
67351 +         This driver supports the QE serial ports on Freescale embedded
67352 +         PowerPC that contain a QUICC Engine.
67353 +
67354  endmenu
67355 Index: linux-2.6.24.7/drivers/serial/Makefile
67356 ===================================================================
67357 --- linux-2.6.24.7.orig/drivers/serial/Makefile
67358 +++ linux-2.6.24.7/drivers/serial/Makefile
67359 @@ -64,3 +64,4 @@ obj-$(CONFIG_SERIAL_UARTLITE) += uartlit
67360  obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
67361  obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
67362  obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
67363 +obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
67364 Index: linux-2.6.24.7/drivers/serial/cpm_uart/cpm_uart_cpm1.c
67365 ===================================================================
67366 --- linux-2.6.24.7.orig/drivers/serial/cpm_uart/cpm_uart_cpm1.c
67367 +++ linux-2.6.24.7/drivers/serial/cpm_uart/cpm_uart_cpm1.c
67368 @@ -52,11 +52,7 @@
67369  #ifdef CONFIG_PPC_CPM_NEW_BINDING
67370  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
67371  {
67372 -       u16 __iomem *cpcr = &cpmp->cp_cpcr;
67373 -
67374 -       out_be16(cpcr, port->command | (cmd << 8) | CPM_CR_FLG);
67375 -       while (in_be16(cpcr) & CPM_CR_FLG)
67376 -               ;
67377 +       cpm_command(port->command, cmd);
67378  }
67379  #else
67380  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
67381 Index: linux-2.6.24.7/drivers/serial/cpm_uart/cpm_uart_cpm2.c
67382 ===================================================================
67383 --- linux-2.6.24.7.orig/drivers/serial/cpm_uart/cpm_uart_cpm2.c
67384 +++ linux-2.6.24.7/drivers/serial/cpm_uart/cpm_uart_cpm2.c
67385 @@ -52,13 +52,7 @@
67386  #ifdef CONFIG_PPC_CPM_NEW_BINDING
67387  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
67388  {
67389 -       cpm_cpm2_t __iomem *cp = cpm2_map(im_cpm);
67390 -
67391 -       out_be32(&cp->cp_cpcr, port->command | cmd | CPM_CR_FLG);
67392 -       while (in_be32(&cp->cp_cpcr) & CPM_CR_FLG)
67393 -               ;
67394 -
67395 -       cpm2_unmap(cp);
67396 +       cpm_command(port->command, cmd);
67397  }
67398  #else
67399  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
67400 @@ -171,9 +165,9 @@ void scc2_lineif(struct uart_cpm_port *p
67401          * really has to get out of the driver so boards can
67402          * be supported in a sane fashion.
67403          */
67404 +       volatile cpmux_t *cpmux = cpm2_map(im_cpmux);
67405  #ifndef CONFIG_STX_GP3
67406         volatile iop_cpm2_t *io = cpm2_map(im_ioport);
67407 -       volatile cpmux_t *cpmux = cpm2_map(im_cpmux);
67408  
67409         io->iop_pparb |= 0x008b0000;
67410         io->iop_pdirb |= 0x00880000;
67411 Index: linux-2.6.24.7/drivers/serial/mpc52xx_uart.c
67412 ===================================================================
67413 --- linux-2.6.24.7.orig/drivers/serial/mpc52xx_uart.c
67414 +++ linux-2.6.24.7/drivers/serial/mpc52xx_uart.c
67415 @@ -36,7 +36,7 @@
67416   * DCD. However, the pin multiplexing aren't changed and should be set either
67417   * by the bootloader or in the platform init code.
67418   *
67419 - * The idx field must be equal to the PSC index ( e.g. 0 for PSC1, 1 for PSC2,
67420 + * The idx field must be equal to the PSC index (e.g. 0 for PSC1, 1 for PSC2,
67421   * and so on). So the PSC1 is mapped to /dev/ttyPSC0, PSC2 to /dev/ttyPSC1 and
67422   * so on. But be warned, it's an ABSOLUTE REQUIREMENT ! This is needed mainly
67423   * fpr the console code : without this 1:1 mapping, at early boot time, when we
67424 @@ -68,11 +68,12 @@
67425  #include <linux/sysrq.h>
67426  #include <linux/console.h>
67427  
67428 -#include <asm/delay.h>
67429 -#include <asm/io.h>
67430 +#include <linux/delay.h>
67431 +#include <linux/io.h>
67432  
67433  #if defined(CONFIG_PPC_MERGE)
67434 -#include <asm/of_platform.h>
67435 +#include <linux/of.h>
67436 +#include <linux/of_platform.h>
67437  #else
67438  #include <linux/platform_device.h>
67439  #endif
67440 @@ -111,16 +112,18 @@ static void mpc52xx_uart_of_enumerate(vo
67441  #endif
67442  
67443  #define PSC(port) ((struct mpc52xx_psc __iomem *)((port)->membase))
67444 +#define FIFO(port) ((struct mpc52xx_psc_fifo __iomem *)(PSC(port)+1))
67445  
67446  
67447  /* Forward declaration of the interruption handling routine */
67448 -static irqreturn_t mpc52xx_uart_int(int irq,void *dev_id);
67449 +static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id);
67450  
67451  
67452  /* Simple macro to test if a port is console or not. This one is taken
67453   * for serial_core.c and maybe should be moved to serial_core.h ? */
67454  #ifdef CONFIG_SERIAL_CORE_CONSOLE
67455 -#define uart_console(port)     ((port)->cons && (port)->cons->index == (port)->line)
67456 +#define uart_console(port) \
67457 +       ((port)->cons && (port)->cons->index == (port)->line)
67458  #else
67459  #define uart_console(port)     (0)
67460  #endif
67461 @@ -162,7 +165,7 @@ mpc52xx_uart_stop_tx(struct uart_port *p
67462  {
67463         /* port->lock taken by caller */
67464         port->read_status_mask &= ~MPC52xx_PSC_IMR_TXRDY;
67465 -       out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
67466 +       out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
67467  }
67468  
67469  static void
67470 @@ -170,7 +173,7 @@ mpc52xx_uart_start_tx(struct uart_port *
67471  {
67472         /* port->lock taken by caller */
67473         port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
67474 -       out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
67475 +       out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
67476  }
67477  
67478  static void
67479 @@ -184,7 +187,7 @@ mpc52xx_uart_send_xchar(struct uart_port
67480                 /* Make sure tx interrupts are on */
67481                 /* Truly necessary ??? They should be anyway */
67482                 port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
67483 -               out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
67484 +               out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
67485         }
67486  
67487         spin_unlock_irqrestore(&port->lock, flags);
67488 @@ -195,7 +198,7 @@ mpc52xx_uart_stop_rx(struct uart_port *p
67489  {
67490         /* port->lock taken by caller */
67491         port->read_status_mask &= ~MPC52xx_PSC_IMR_RXRDY;
67492 -       out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
67493 +       out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
67494  }
67495  
67496  static void
67497 @@ -210,10 +213,10 @@ mpc52xx_uart_break_ctl(struct uart_port 
67498         unsigned long flags;
67499         spin_lock_irqsave(&port->lock, flags);
67500  
67501 -       if ( ctl == -1 )
67502 -               out_8(&PSC(port)->command,MPC52xx_PSC_START_BRK);
67503 +       if (ctl == -1)
67504 +               out_8(&PSC(port)->command, MPC52xx_PSC_START_BRK);
67505         else
67506 -               out_8(&PSC(port)->command,MPC52xx_PSC_STOP_BRK);
67507 +               out_8(&PSC(port)->command, MPC52xx_PSC_STOP_BRK);
67508  
67509         spin_unlock_irqrestore(&port->lock, flags);
67510  }
67511 @@ -222,6 +225,7 @@ static int
67512  mpc52xx_uart_startup(struct uart_port *port)
67513  {
67514         struct mpc52xx_psc __iomem *psc = PSC(port);
67515 +       struct mpc52xx_psc_fifo __iomem *fifo = FIFO(port);
67516         int ret;
67517  
67518         /* Request IRQ */
67519 @@ -231,23 +235,23 @@ mpc52xx_uart_startup(struct uart_port *p
67520                 return ret;
67521  
67522         /* Reset/activate the port, clear and enable interrupts */
67523 -       out_8(&psc->command,MPC52xx_PSC_RST_RX);
67524 -       out_8(&psc->command,MPC52xx_PSC_RST_TX);
67525 +       out_8(&psc->command, MPC52xx_PSC_RST_RX);
67526 +       out_8(&psc->command, MPC52xx_PSC_RST_TX);
67527  
67528 -       out_be32(&psc->sicr,0); /* UART mode DCD ignored */
67529 +       out_be32(&psc->sicr, 0);        /* UART mode DCD ignored */
67530  
67531         out_be16(&psc->mpc52xx_psc_clock_select, 0xdd00); /* /16 prescaler on */
67532  
67533 -       out_8(&psc->rfcntl, 0x00);
67534 -       out_be16(&psc->rfalarm, 0x1ff);
67535 -       out_8(&psc->tfcntl, 0x07);
67536 -       out_be16(&psc->tfalarm, 0x80);
67537 +       out_8(&fifo->rfcntl, 0x00);
67538 +       out_be16(&fifo->rfalarm, 0x1ff);
67539 +       out_8(&fifo->tfcntl, 0x07);
67540 +       out_be16(&fifo->tfalarm, 0x80);
67541  
67542         port->read_status_mask |= MPC52xx_PSC_IMR_RXRDY | MPC52xx_PSC_IMR_TXRDY;
67543 -       out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
67544 +       out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
67545  
67546 -       out_8(&psc->command,MPC52xx_PSC_TX_ENABLE);
67547 -       out_8(&psc->command,MPC52xx_PSC_RX_ENABLE);
67548 +       out_8(&psc->command, MPC52xx_PSC_TX_ENABLE);
67549 +       out_8(&psc->command, MPC52xx_PSC_RX_ENABLE);
67550  
67551         return 0;
67552  }
67553 @@ -258,12 +262,12 @@ mpc52xx_uart_shutdown(struct uart_port *
67554         struct mpc52xx_psc __iomem *psc = PSC(port);
67555  
67556         /* Shut down the port.  Leave TX active if on a console port */
67557 -       out_8(&psc->command,MPC52xx_PSC_RST_RX);
67558 +       out_8(&psc->command, MPC52xx_PSC_RST_RX);
67559         if (!uart_console(port))
67560 -               out_8(&psc->command,MPC52xx_PSC_RST_TX);
67561 +               out_8(&psc->command, MPC52xx_PSC_RST_TX);
67562  
67563         port->read_status_mask = 0;
67564 -       out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
67565 +       out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
67566  
67567         /* Release interrupt */
67568         free_irq(port->irq, port);
67569 @@ -271,7 +275,7 @@ mpc52xx_uart_shutdown(struct uart_port *
67570  
67571  static void
67572  mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
67573 -                         struct ktermios *old)
67574 +                        struct ktermios *old)
67575  {
67576         struct mpc52xx_psc __iomem *psc = PSC(port);
67577         unsigned long flags;
67578 @@ -283,14 +287,14 @@ mpc52xx_uart_set_termios(struct uart_por
67579         mr1 = 0;
67580  
67581         switch (new->c_cflag & CSIZE) {
67582 -               case CS5:       mr1 |= MPC52xx_PSC_MODE_5_BITS;
67583 -                               break;
67584 -               case CS6:       mr1 |= MPC52xx_PSC_MODE_6_BITS;
67585 -                               break;
67586 -               case CS7:       mr1 |= MPC52xx_PSC_MODE_7_BITS;
67587 -                               break;
67588 -               case CS8:
67589 -               default:        mr1 |= MPC52xx_PSC_MODE_8_BITS;
67590 +       case CS5:       mr1 |= MPC52xx_PSC_MODE_5_BITS;
67591 +               break;
67592 +       case CS6:       mr1 |= MPC52xx_PSC_MODE_6_BITS;
67593 +               break;
67594 +       case CS7:       mr1 |= MPC52xx_PSC_MODE_7_BITS;
67595 +               break;
67596 +       case CS8:
67597 +       default:        mr1 |= MPC52xx_PSC_MODE_8_BITS;
67598         }
67599  
67600         if (new->c_cflag & PARENB) {
67601 @@ -332,24 +336,24 @@ mpc52xx_uart_set_termios(struct uart_por
67602                 udelay(1);
67603  
67604         if (!j)
67605 -               printk( KERN_ERR "mpc52xx_uart.c: "
67606 +               printk(KERN_ERR "mpc52xx_uart.c: "
67607                         "Unable to flush RX & TX fifos in-time in set_termios."
67608 -                       "Some chars may have been lost.\n" );
67609 +                       "Some chars may have been lost.\n");
67610  
67611         /* Reset the TX & RX */
67612 -       out_8(&psc->command,MPC52xx_PSC_RST_RX);
67613 -       out_8(&psc->command,MPC52xx_PSC_RST_TX);
67614 +       out_8(&psc->command, MPC52xx_PSC_RST_RX);
67615 +       out_8(&psc->command, MPC52xx_PSC_RST_TX);
67616  
67617         /* Send new mode settings */
67618 -       out_8(&psc->command,MPC52xx_PSC_SEL_MODE_REG_1);
67619 -       out_8(&psc->mode,mr1);
67620 -       out_8(&psc->mode,mr2);
67621 -       out_8(&psc->ctur,ctr >> 8);
67622 -       out_8(&psc->ctlr,ctr & 0xff);
67623 +       out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1);
67624 +       out_8(&psc->mode, mr1);
67625 +       out_8(&psc->mode, mr2);
67626 +       out_8(&psc->ctur, ctr >> 8);
67627 +       out_8(&psc->ctlr, ctr & 0xff);
67628  
67629         /* Reenable TX & RX */
67630 -       out_8(&psc->command,MPC52xx_PSC_TX_ENABLE);
67631 -       out_8(&psc->command,MPC52xx_PSC_RX_ENABLE);
67632 +       out_8(&psc->command, MPC52xx_PSC_TX_ENABLE);
67633 +       out_8(&psc->command, MPC52xx_PSC_RX_ENABLE);
67634  
67635         /* We're all set, release the lock */
67636         spin_unlock_irqrestore(&port->lock, flags);
67637 @@ -364,7 +368,8 @@ mpc52xx_uart_type(struct uart_port *port
67638  static void
67639  mpc52xx_uart_release_port(struct uart_port *port)
67640  {
67641 -       if (port->flags & UPF_IOREMAP) { /* remapped by us ? */
67642 +       /* remapped by us ? */
67643 +       if (port->flags & UPF_IOREMAP) {
67644                 iounmap(port->membase);
67645                 port->membase = NULL;
67646         }
67647 @@ -379,7 +384,7 @@ mpc52xx_uart_request_port(struct uart_po
67648  
67649         if (port->flags & UPF_IOREMAP) /* Need to remap ? */
67650                 port->membase = ioremap(port->mapbase,
67651 -                                       sizeof(struct mpc52xx_psc));
67652 +                                       sizeof(struct mpc52xx_psc));
67653  
67654         if (!port->membase)
67655                 return -EINVAL;
67656 @@ -398,22 +403,22 @@ mpc52xx_uart_request_port(struct uart_po
67657  static void
67658  mpc52xx_uart_config_port(struct uart_port *port, int flags)
67659  {
67660 -       if ( (flags & UART_CONFIG_TYPE) &&
67661 -            (mpc52xx_uart_request_port(port) == 0) )
67662 -               port->type = PORT_MPC52xx;
67663 +       if ((flags & UART_CONFIG_TYPE)
67664 +               && (mpc52xx_uart_request_port(port) == 0))
67665 +               port->type = PORT_MPC52xx;
67666  }
67667  
67668  static int
67669  mpc52xx_uart_verify_port(struct uart_port *port, struct serial_struct *ser)
67670  {
67671 -       if ( ser->type != PORT_UNKNOWN && ser->type != PORT_MPC52xx )
67672 +       if (ser->type != PORT_UNKNOWN && ser->type != PORT_MPC52xx)
67673                 return -EINVAL;
67674  
67675 -       if ( (ser->irq != port->irq) ||
67676 -            (ser->io_type != SERIAL_IO_MEM) ||
67677 -            (ser->baud_base != port->uartclk)  ||
67678 -            (ser->iomem_base != (void*)port->mapbase) ||
67679 -            (ser->hub6 != 0 ) )
67680 +       if ((ser->irq != port->irq) ||
67681 +           (ser->io_type != SERIAL_IO_MEM) ||
67682 +           (ser->baud_base != port->uartclk)  ||
67683 +           (ser->iomem_base != (void *)port->mapbase) ||
67684 +           (ser->hub6 != 0))
67685                 return -EINVAL;
67686  
67687         return 0;
67688 @@ -455,8 +460,8 @@ mpc52xx_uart_int_rx_chars(struct uart_po
67689         unsigned short status;
67690  
67691         /* While we can read, do so ! */
67692 -       while ( (status = in_be16(&PSC(port)->mpc52xx_psc_status)) &
67693 -               MPC52xx_PSC_SR_RXRDY) {
67694 +       while ((status = in_be16(&PSC(port)->mpc52xx_psc_status)) &
67695 +               MPC52xx_PSC_SR_RXRDY) {
67696  
67697                 /* Get the char */
67698                 ch = in_8(&PSC(port)->mpc52xx_psc_buffer_8);
67699 @@ -474,9 +479,9 @@ mpc52xx_uart_int_rx_chars(struct uart_po
67700                 flag = TTY_NORMAL;
67701                 port->icount.rx++;
67702  
67703 -               if ( status & (MPC52xx_PSC_SR_PE |
67704 -                              MPC52xx_PSC_SR_FE |
67705 -                              MPC52xx_PSC_SR_RB) ) {
67706 +               if (status & (MPC52xx_PSC_SR_PE |
67707 +                             MPC52xx_PSC_SR_FE |
67708 +                             MPC52xx_PSC_SR_RB)) {
67709  
67710                         if (status & MPC52xx_PSC_SR_RB) {
67711                                 flag = TTY_BREAK;
67712 @@ -487,7 +492,7 @@ mpc52xx_uart_int_rx_chars(struct uart_po
67713                                 flag = TTY_FRAME;
67714  
67715                         /* Clear error condition */
67716 -                       out_8(&PSC(port)->command,MPC52xx_PSC_RST_ERR_STAT);
67717 +                       out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
67718  
67719                 }
67720                 tty_insert_flip_char(tty, ch, flag);
67721 @@ -568,16 +573,16 @@ mpc52xx_uart_int(int irq, void *dev_id)
67722  
67723                 /* Do we need to receive chars ? */
67724                 /* For this RX interrupts must be on and some chars waiting */
67725 -               if ( status & MPC52xx_PSC_IMR_RXRDY )
67726 +               if (status & MPC52xx_PSC_IMR_RXRDY)
67727                         keepgoing |= mpc52xx_uart_int_rx_chars(port);
67728  
67729                 /* Do we need to send chars ? */
67730                 /* For this, TX must be ready and TX interrupt enabled */
67731 -               if ( status & MPC52xx_PSC_IMR_TXRDY )
67732 +               if (status & MPC52xx_PSC_IMR_TXRDY)
67733                         keepgoing |= mpc52xx_uart_int_tx_chars(port);
67734  
67735                 /* Limit number of iteration */
67736 -               if ( !(--pass) )
67737 +               if (!(--pass))
67738                         keepgoing = 0;
67739  
67740         } while (keepgoing);
67741 @@ -596,7 +601,7 @@ mpc52xx_uart_int(int irq, void *dev_id)
67742  
67743  static void __init
67744  mpc52xx_console_get_options(struct uart_port *port,
67745 -                            int *baud, int *parity, int *bits, int *flow)
67746 +                           int *baud, int *parity, int *bits, int *flow)
67747  {
67748         struct mpc52xx_psc __iomem *psc = PSC(port);
67749         unsigned char mr1;
67750 @@ -604,7 +609,7 @@ mpc52xx_console_get_options(struct uart_
67751         pr_debug("mpc52xx_console_get_options(port=%p)\n", port);
67752  
67753         /* Read the mode registers */
67754 -       out_8(&psc->command,MPC52xx_PSC_SEL_MODE_REG_1);
67755 +       out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1);
67756         mr1 = in_8(&psc->mode);
67757  
67758         /* CT{U,L}R are write-only ! */
67759 @@ -616,11 +621,18 @@ mpc52xx_console_get_options(struct uart_
67760  
67761         /* Parse them */
67762         switch (mr1 & MPC52xx_PSC_MODE_BITS_MASK) {
67763 -               case MPC52xx_PSC_MODE_5_BITS:   *bits = 5; break;
67764 -               case MPC52xx_PSC_MODE_6_BITS:   *bits = 6; break;
67765 -               case MPC52xx_PSC_MODE_7_BITS:   *bits = 7; break;
67766 -               case MPC52xx_PSC_MODE_8_BITS:
67767 -               default:                        *bits = 8;
67768 +       case MPC52xx_PSC_MODE_5_BITS:
67769 +               *bits = 5;
67770 +               break;
67771 +       case MPC52xx_PSC_MODE_6_BITS:
67772 +               *bits = 6;
67773 +               break;
67774 +       case MPC52xx_PSC_MODE_7_BITS:
67775 +               *bits = 7;
67776 +               break;
67777 +       case MPC52xx_PSC_MODE_8_BITS:
67778 +       default:
67779 +               *bits = 8;
67780         }
67781  
67782         if (mr1 & MPC52xx_PSC_MODE_PARNONE)
67783 @@ -657,7 +669,7 @@ mpc52xx_console_write(struct console *co
67784                 /* Wait the TX buffer to be empty */
67785                 j = 20000;      /* Maximum wait */
67786                 while (!(in_be16(&psc->mpc52xx_psc_status) &
67787 -                        MPC52xx_PSC_SR_TXEMP) && --j)
67788 +                        MPC52xx_PSC_SR_TXEMP) && --j)
67789                         udelay(1);
67790         }
67791  
67792 @@ -730,16 +742,18 @@ mpc52xx_console_setup(struct console *co
67793         }
67794  
67795         pr_debug("Console on ttyPSC%x is %s\n",
67796 -                co->index, mpc52xx_uart_nodes[co->index]->full_name);
67797 +                co->index, mpc52xx_uart_nodes[co->index]->full_name);
67798  
67799         /* Fetch register locations */
67800 -       if ((ret = of_address_to_resource(np, 0, &res)) != 0) {
67801 +       ret = of_address_to_resource(np, 0, &res);
67802 +       if (ret) {
67803                 pr_debug("Could not get resources for PSC%x\n", co->index);
67804                 return ret;
67805         }
67806  
67807         /* Search for bus-frequency property in this node or a parent */
67808 -       if ((ipb_freq = mpc52xx_find_ipb_freq(np)) == 0) {
67809 +       ipb_freq = mpc52xx_find_ipb_freq(np);
67810 +       if (ipb_freq == 0) {
67811                 pr_debug("Could not find IPB bus frequency!\n");
67812                 return -EINVAL;
67813         }
67814 @@ -757,7 +771,8 @@ mpc52xx_console_setup(struct console *co
67815                 return -EINVAL;
67816  
67817         pr_debug("mpc52xx-psc uart at %p, mapped to %p, irq=%x, freq=%i\n",
67818 -                (void*)port->mapbase, port->membase, port->irq, port->uartclk);
67819 +                (void *)port->mapbase, port->membase,
67820 +                port->irq, port->uartclk);
67821  
67822         /* Setup the port parameters accoding to options */
67823         if (options)
67824 @@ -766,7 +781,7 @@ mpc52xx_console_setup(struct console *co
67825                 mpc52xx_console_get_options(port, &baud, &parity, &bits, &flow);
67826  
67827         pr_debug("Setting console parameters: %i %i%c1 flow=%c\n",
67828 -                baud, bits, parity, flow);
67829 +                baud, bits, parity, flow);
67830  
67831         return uart_set_options(port, co, baud, parity, bits, flow);
67832  }
67833 @@ -781,7 +796,7 @@ static struct console mpc52xx_console = 
67834         .device = uart_console_device,
67835         .setup  = mpc52xx_console_setup,
67836         .flags  = CON_PRINTBUFFER,
67837 -       .index  = -1,   /* Specified on the cmdline (e.g. console=ttyPSC0 ) */
67838 +       .index  = -1,   /* Specified on the cmdline (e.g. console=ttyPSC0) */
67839         .data   = &mpc52xx_uart_driver,
67840  };
67841  
67842 @@ -809,7 +824,6 @@ console_initcall(mpc52xx_console_init);
67843  /* ======================================================================== */
67844  
67845  static struct uart_driver mpc52xx_uart_driver = {
67846 -       .owner          = THIS_MODULE,
67847         .driver_name    = "mpc52xx_psc_uart",
67848         .dev_name       = "ttyPSC",
67849         .major          = SERIAL_PSC_MAJOR,
67850 @@ -837,7 +851,7 @@ mpc52xx_uart_probe(struct platform_devic
67851         if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM)
67852                 return -EINVAL;
67853  
67854 -       if (!mpc52xx_match_psc_function(idx,"uart"))
67855 +       if (!mpc52xx_match_psc_function(idx, "uart"))
67856                 return -ENODEV;
67857  
67858         /* Init the port structure */
67859 @@ -848,13 +862,13 @@ mpc52xx_uart_probe(struct platform_devic
67860         port->fifosize  = 512;
67861         port->iotype    = UPIO_MEM;
67862         port->flags     = UPF_BOOT_AUTOCONF |
67863 -                         ( uart_console(port) ? 0 : UPF_IOREMAP );
67864 +                         (uart_console(port) ? 0 : UPF_IOREMAP);
67865         port->line      = idx;
67866         port->ops       = &mpc52xx_uart_ops;
67867         port->dev       = &dev->dev;
67868  
67869         /* Search for IRQ and mapbase */
67870 -       for (i=0 ; i<dev->num_resources ; i++, res++) {
67871 +       for (i = 0 ; i < dev->num_resources ; i++, res++) {
67872                 if (res->flags & IORESOURCE_MEM)
67873                         port->mapbase = res->start;
67874                 else if (res->flags & IORESOURCE_IRQ)
67875 @@ -866,7 +880,7 @@ mpc52xx_uart_probe(struct platform_devic
67876         /* Add the port to the uart sub-system */
67877         ret = uart_add_one_port(&mpc52xx_uart_driver, port);
67878         if (!ret)
67879 -               platform_set_drvdata(dev, (void*)port);
67880 +               platform_set_drvdata(dev, (void *)port);
67881  
67882         return ret;
67883  }
67884 @@ -917,6 +931,7 @@ static struct platform_driver mpc52xx_ua
67885         .resume         = mpc52xx_uart_resume,
67886  #endif
67887         .driver         = {
67888 +               .owner  = THIS_MODULE,
67889                 .name   = "mpc52xx-psc",
67890         },
67891  };
67892 @@ -946,10 +961,11 @@ mpc52xx_uart_of_probe(struct of_device *
67893         if (idx >= MPC52xx_PSC_MAXNUM)
67894                 return -EINVAL;
67895         pr_debug("Found %s assigned to ttyPSC%x\n",
67896 -                mpc52xx_uart_nodes[idx]->full_name, idx);
67897 +                mpc52xx_uart_nodes[idx]->full_name, idx);
67898  
67899         /* Search for bus-frequency property in this node or a parent */
67900 -       if ((ipb_freq = mpc52xx_find_ipb_freq(op->node)) == 0) {
67901 +       ipb_freq = mpc52xx_find_ipb_freq(op->node);
67902 +       if (ipb_freq == 0) {
67903                 dev_dbg(&op->dev, "Could not find IPB bus frequency!\n");
67904                 return -EINVAL;
67905         }
67906 @@ -962,22 +978,23 @@ mpc52xx_uart_of_probe(struct of_device *
67907         port->fifosize  = 512;
67908         port->iotype    = UPIO_MEM;
67909         port->flags     = UPF_BOOT_AUTOCONF |
67910 -                         ( uart_console(port) ? 0 : UPF_IOREMAP );
67911 +                         (uart_console(port) ? 0 : UPF_IOREMAP);
67912         port->line      = idx;
67913         port->ops       = &mpc52xx_uart_ops;
67914         port->dev       = &op->dev;
67915  
67916         /* Search for IRQ and mapbase */
67917 -       if ((ret = of_address_to_resource(op->node, 0, &res)) != 0)
67918 +       ret = of_address_to_resource(op->node, 0, &res);
67919 +       if (ret)
67920                 return ret;
67921  
67922         port->mapbase = res.start;
67923         port->irq = irq_of_parse_and_map(op->node, 0);
67924  
67925         dev_dbg(&op->dev, "mpc52xx-psc uart at %p, irq=%x, freq=%i\n",
67926 -               (void*)port->mapbase, port->irq, port->uartclk);
67927 +               (void *)port->mapbase, port->irq, port->uartclk);
67928  
67929 -       if ((port->irq==NO_IRQ) || !port->mapbase) {
67930 +       if ((port->irq == NO_IRQ) || !port->mapbase) {
67931                 printk(KERN_ERR "Could not allocate resources for PSC\n");
67932                 return -EINVAL;
67933         }
67934 @@ -985,7 +1002,7 @@ mpc52xx_uart_of_probe(struct of_device *
67935         /* Add the port to the uart sub-system */
67936         ret = uart_add_one_port(&mpc52xx_uart_driver, port);
67937         if (!ret)
67938 -               dev_set_drvdata(&op->dev, (void*)port);
67939 +               dev_set_drvdata(&op->dev, (void *)port);
67940  
67941         return ret;
67942  }
67943 @@ -1048,6 +1065,7 @@ mpc52xx_uart_of_assign(struct device_nod
67944         if (idx < 0)
67945                 return; /* No free slot; abort */
67946  
67947 +       of_node_get(np);
67948         /* If the slot is already occupied, then swap slots */
67949         if (mpc52xx_uart_nodes[idx] && (free_idx != -1))
67950                 mpc52xx_uart_nodes[free_idx] = mpc52xx_uart_nodes[idx];
67951 @@ -1057,7 +1075,7 @@ mpc52xx_uart_of_assign(struct device_nod
67952  static void
67953  mpc52xx_uart_of_enumerate(void)
67954  {
67955 -       static int enum_done = 0;
67956 +       static int enum_done;
67957         struct device_node *np;
67958         const unsigned int *devno;
67959         int i;
67960 @@ -1071,7 +1089,7 @@ mpc52xx_uart_of_enumerate(void)
67961  
67962                 /* Is a particular device number requested? */
67963                 devno = of_get_property(np, "port-number", NULL);
67964 -               mpc52xx_uart_of_assign(of_node_get(np), devno ? *devno : -1);
67965 +               mpc52xx_uart_of_assign(np, devno ? *devno : -1);
67966         }
67967  
67968         enum_done = 1;
67969 @@ -1079,15 +1097,13 @@ mpc52xx_uart_of_enumerate(void)
67970         for (i = 0; i < MPC52xx_PSC_MAXNUM; i++) {
67971                 if (mpc52xx_uart_nodes[i])
67972                         pr_debug("%s assigned to ttyPSC%x\n",
67973 -                                mpc52xx_uart_nodes[i]->full_name, i);
67974 +                                mpc52xx_uart_nodes[i]->full_name, i);
67975         }
67976  }
67977  
67978  MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match);
67979  
67980  static struct of_platform_driver mpc52xx_uart_of_driver = {
67981 -       .owner          = THIS_MODULE,
67982 -       .name           = "mpc52xx-psc-uart",
67983         .match_table    = mpc52xx_uart_of_match,
67984         .probe          = mpc52xx_uart_of_probe,
67985         .remove         = mpc52xx_uart_of_remove,
67986 @@ -1113,7 +1129,8 @@ mpc52xx_uart_init(void)
67987  
67988         printk(KERN_INFO "Serial: MPC52xx PSC UART driver\n");
67989  
67990 -       if ((ret = uart_register_driver(&mpc52xx_uart_driver)) != 0) {
67991 +       ret = uart_register_driver(&mpc52xx_uart_driver);
67992 +       if (ret) {
67993                 printk(KERN_ERR "%s: uart_register_driver failed (%i)\n",
67994                        __FILE__, ret);
67995                 return ret;
67996 Index: linux-2.6.24.7/drivers/serial/uartlite.c
67997 ===================================================================
67998 --- linux-2.6.24.7.orig/drivers/serial/uartlite.c
67999 +++ linux-2.6.24.7/drivers/serial/uartlite.c
68000 @@ -539,7 +539,7 @@ static int __devinit ulite_assign(struct
68001   *
68002   * @dev: pointer to device structure
68003   */
68004 -static int __devinit ulite_release(struct device *dev)
68005 +static int __devexit ulite_release(struct device *dev)
68006  {
68007         struct uart_port *port = dev_get_drvdata(dev);
68008         int rc = 0;
68009 @@ -572,14 +572,14 @@ static int __devinit ulite_probe(struct 
68010         return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start);
68011  }
68012  
68013 -static int ulite_remove(struct platform_device *pdev)
68014 +static int __devexit ulite_remove(struct platform_device *pdev)
68015  {
68016         return ulite_release(&pdev->dev);
68017  }
68018  
68019  static struct platform_driver ulite_platform_driver = {
68020         .probe  = ulite_probe,
68021 -       .remove = ulite_remove,
68022 +       .remove = __devexit_p(ulite_remove),
68023         .driver = {
68024                    .owner = THIS_MODULE,
68025                    .name  = "uartlite",
68026 Index: linux-2.6.24.7/drivers/serial/ucc_uart.c
68027 ===================================================================
68028 --- /dev/null
68029 +++ linux-2.6.24.7/drivers/serial/ucc_uart.c
68030 @@ -0,0 +1,1514 @@
68031 +/*
68032 + * Freescale QUICC Engine UART device driver
68033 + *
68034 + * Author: Timur Tabi <timur@freescale.com>
68035 + *
68036 + * Copyright 2007 Freescale Semiconductor, Inc.  This file is licensed under
68037 + * the terms of the GNU General Public License version 2.  This program
68038 + * is licensed "as is" without any warranty of any kind, whether express
68039 + * or implied.
68040 + *
68041 + * This driver adds support for UART devices via Freescale's QUICC Engine
68042 + * found on some Freescale SOCs.
68043 + *
68044 + * If Soft-UART support is needed but not already present, then this driver
68045 + * will request and upload the "Soft-UART" microcode upon probe.  The
68046 + * filename of the microcode should be fsl_qe_ucode_uart_X_YZ.bin, where "X"
68047 + * is the name of the SOC (e.g. 8323), and YZ is the revision of the SOC,
68048 + * (e.g. "11" for 1.1).
68049 + */
68050 +
68051 +#include <linux/module.h>
68052 +#include <linux/serial.h>
68053 +#include <linux/serial_core.h>
68054 +#include <linux/io.h>
68055 +#include <linux/of_platform.h>
68056 +#include <linux/dma-mapping.h>
68057 +
68058 +#include <linux/fs_uart_pd.h>
68059 +#include <asm/ucc_slow.h>
68060 +
68061 +#include <linux/firmware.h>
68062 +#include <asm/reg.h>
68063 +
68064 +/*
68065 + * The GUMR flag for Soft UART.  This would normally be defined in qe.h,
68066 + * but Soft-UART is a hack and we want to keep everything related to it in
68067 + * this file.
68068 + */
68069 +#define UCC_SLOW_GUMR_H_SUART          0x00004000      /* Soft-UART */
68070 +
68071 +/*
68072 + * soft_uart is 1 if we need to use Soft-UART mode
68073 + */
68074 +static int soft_uart;
68075 +/*
68076 + * firmware_loaded is 1 if the firmware has been loaded, 0 otherwise.
68077 + */
68078 +static int firmware_loaded;
68079 +
68080 +/* Enable this macro to configure all serial ports in internal loopback
68081 +   mode */
68082 +/* #define LOOPBACK */
68083 +
68084 +/* The major and minor device numbers are defined in
68085 + * http://www.lanana.org/docs/device-list/devices-2.6+.txt.  For the QE
68086 + * UART, we have major number 204 and minor numbers 46 - 49, which are the
68087 + * same as for the CPM2.  This decision was made because no Freescale part
68088 + * has both a CPM and a QE.
68089 + */
68090 +#define SERIAL_QE_MAJOR 204
68091 +#define SERIAL_QE_MINOR 46
68092 +
68093 +/* Since we only have minor numbers 46 - 49, there is a hard limit of 4 ports */
68094 +#define UCC_MAX_UART    4
68095 +
68096 +/* The number of buffer descriptors for receiving characters. */
68097 +#define RX_NUM_FIFO     4
68098 +
68099 +/* The number of buffer descriptors for transmitting characters. */
68100 +#define TX_NUM_FIFO     4
68101 +
68102 +/* The maximum size of the character buffer for a single RX BD. */
68103 +#define RX_BUF_SIZE     32
68104 +
68105 +/* The maximum size of the character buffer for a single TX BD. */
68106 +#define TX_BUF_SIZE     32
68107 +
68108 +/*
68109 + * The number of jiffies to wait after receiving a close command before the
68110 + * device is actually closed.  This allows the last few characters to be
68111 + * sent over the wire.
68112 + */
68113 +#define UCC_WAIT_CLOSING 100
68114 +
68115 +struct ucc_uart_pram {
68116 +       struct ucc_slow_pram common;
68117 +       u8 res1[8];             /* reserved */
68118 +       __be16 maxidl;          /* Maximum idle chars */
68119 +       __be16 idlc;            /* temp idle counter */
68120 +       __be16 brkcr;           /* Break count register */
68121 +       __be16 parec;           /* receive parity error counter */
68122 +       __be16 frmec;           /* receive framing error counter */
68123 +       __be16 nosec;           /* receive noise counter */
68124 +       __be16 brkec;           /* receive break condition counter */
68125 +       __be16 brkln;           /* last received break length */
68126 +       __be16 uaddr[2];        /* UART address character 1 & 2 */
68127 +       __be16 rtemp;           /* Temp storage */
68128 +       __be16 toseq;           /* Transmit out of sequence char */
68129 +       __be16 cchars[8];       /* control characters 1-8 */
68130 +       __be16 rccm;            /* receive control character mask */
68131 +       __be16 rccr;            /* receive control character register */
68132 +       __be16 rlbc;            /* receive last break character */
68133 +       __be16 res2;            /* reserved */
68134 +       __be32 res3;            /* reserved, should be cleared */
68135 +       u8 res4;                /* reserved, should be cleared */
68136 +       u8 res5[3];             /* reserved, should be cleared */
68137 +       __be32 res6;            /* reserved, should be cleared */
68138 +       __be32 res7;            /* reserved, should be cleared */
68139 +       __be32 res8;            /* reserved, should be cleared */
68140 +       __be32 res9;            /* reserved, should be cleared */
68141 +       __be32 res10;           /* reserved, should be cleared */
68142 +       __be32 res11;           /* reserved, should be cleared */
68143 +       __be32 res12;           /* reserved, should be cleared */
68144 +       __be32 res13;           /* reserved, should be cleared */
68145 +/* The rest is for Soft-UART only */
68146 +       __be16 supsmr;          /* 0x90, Shadow UPSMR */
68147 +       __be16 res92;           /* 0x92, reserved, initialize to 0 */
68148 +       __be32 rx_state;        /* 0x94, RX state, initialize to 0 */
68149 +       __be32 rx_cnt;          /* 0x98, RX count, initialize to 0 */
68150 +       u8 rx_length;           /* 0x9C, Char length, set to 1+CL+PEN+1+SL */
68151 +       u8 rx_bitmark;          /* 0x9D, reserved, initialize to 0 */
68152 +       u8 rx_temp_dlst_qe;     /* 0x9E, reserved, initialize to 0 */
68153 +       u8 res14[0xBC - 0x9F];  /* reserved */
68154 +       __be32 dump_ptr;        /* 0xBC, Dump pointer */
68155 +       __be32 rx_frame_rem;    /* 0xC0, reserved, initialize to 0 */
68156 +       u8 rx_frame_rem_size;   /* 0xC4, reserved, initialize to 0 */
68157 +       u8 tx_mode;             /* 0xC5, mode, 0=AHDLC, 1=UART */
68158 +       __be16 tx_state;        /* 0xC6, TX state */
68159 +       u8 res15[0xD0 - 0xC8];  /* reserved */
68160 +       __be32 resD0;           /* 0xD0, reserved, initialize to 0 */
68161 +       u8 resD4;               /* 0xD4, reserved, initialize to 0 */
68162 +       __be16 resD5;           /* 0xD5, reserved, initialize to 0 */
68163 +} __attribute__ ((packed));
68164 +
68165 +/* SUPSMR definitions, for Soft-UART only */
68166 +#define UCC_UART_SUPSMR_SL             0x8000
68167 +#define UCC_UART_SUPSMR_RPM_MASK       0x6000
68168 +#define UCC_UART_SUPSMR_RPM_ODD        0x0000
68169 +#define UCC_UART_SUPSMR_RPM_LOW        0x2000
68170 +#define UCC_UART_SUPSMR_RPM_EVEN       0x4000
68171 +#define UCC_UART_SUPSMR_RPM_HIGH       0x6000
68172 +#define UCC_UART_SUPSMR_PEN            0x1000
68173 +#define UCC_UART_SUPSMR_TPM_MASK       0x0C00
68174 +#define UCC_UART_SUPSMR_TPM_ODD        0x0000
68175 +#define UCC_UART_SUPSMR_TPM_LOW        0x0400
68176 +#define UCC_UART_SUPSMR_TPM_EVEN       0x0800
68177 +#define UCC_UART_SUPSMR_TPM_HIGH       0x0C00
68178 +#define UCC_UART_SUPSMR_FRZ            0x0100
68179 +#define UCC_UART_SUPSMR_UM_MASK        0x00c0
68180 +#define UCC_UART_SUPSMR_UM_NORMAL       0x0000
68181 +#define UCC_UART_SUPSMR_UM_MAN_MULTI    0x0040
68182 +#define UCC_UART_SUPSMR_UM_AUTO_MULTI   0x00c0
68183 +#define UCC_UART_SUPSMR_CL_MASK        0x0030
68184 +#define UCC_UART_SUPSMR_CL_8           0x0030
68185 +#define UCC_UART_SUPSMR_CL_7           0x0020
68186 +#define UCC_UART_SUPSMR_CL_6           0x0010
68187 +#define UCC_UART_SUPSMR_CL_5           0x0000
68188 +
68189 +#define UCC_UART_TX_STATE_AHDLC        0x00
68190 +#define UCC_UART_TX_STATE_UART         0x01
68191 +#define UCC_UART_TX_STATE_X1           0x00
68192 +#define UCC_UART_TX_STATE_X16          0x80
68193 +
68194 +#define UCC_UART_PRAM_ALIGNMENT 0x100
68195 +
68196 +#define UCC_UART_SIZE_OF_BD     UCC_SLOW_SIZE_OF_BD
68197 +#define NUM_CONTROL_CHARS       8
68198 +
68199 +/* Private per-port data structure */
68200 +struct uart_qe_port {
68201 +       struct uart_port port;
68202 +       struct ucc_slow __iomem *uccp;
68203 +       struct ucc_uart_pram __iomem *uccup;
68204 +       struct ucc_slow_info us_info;
68205 +       struct ucc_slow_private *us_private;
68206 +       struct device_node *np;
68207 +       unsigned int ucc_num;   /* First ucc is 0, not 1 */
68208 +
68209 +       u16 rx_nrfifos;
68210 +       u16 rx_fifosize;
68211 +       u16 tx_nrfifos;
68212 +       u16 tx_fifosize;
68213 +       int wait_closing;
68214 +       u32 flags;
68215 +       struct qe_bd *rx_bd_base;
68216 +       struct qe_bd *rx_cur;
68217 +       struct qe_bd *tx_bd_base;
68218 +       struct qe_bd *tx_cur;
68219 +       unsigned char *tx_buf;
68220 +       unsigned char *rx_buf;
68221 +       void *bd_virt;          /* virtual address of the BD buffers */
68222 +       dma_addr_t bd_dma_addr; /* bus address of the BD buffers */
68223 +       unsigned int bd_size;   /* size of BD buffer space */
68224 +};
68225 +
68226 +static struct uart_driver ucc_uart_driver = {
68227 +       .owner          = THIS_MODULE,
68228 +       .driver_name    = "serial",
68229 +       .dev_name       = "ttyQE",
68230 +       .major          = SERIAL_QE_MAJOR,
68231 +       .minor          = SERIAL_QE_MINOR,
68232 +       .nr             = UCC_MAX_UART,
68233 +};
68234 +
68235 +/*
68236 + * Virtual to physical address translation.
68237 + *
68238 + * Given the virtual address for a character buffer, this function returns
68239 + * the physical (DMA) equivalent.
68240 + */
68241 +static inline dma_addr_t cpu2qe_addr(void *addr, struct uart_qe_port *qe_port)
68242 +{
68243 +       if (likely((addr >= qe_port->bd_virt)) &&
68244 +           (addr < (qe_port->bd_virt + qe_port->bd_size)))
68245 +               return qe_port->bd_dma_addr + (addr - qe_port->bd_virt);
68246 +
68247 +       /* something nasty happened */
68248 +       printk(KERN_ERR "%s: addr=%p\n", __FUNCTION__, addr);
68249 +       BUG();
68250 +       return 0;
68251 +}
68252 +
68253 +/*
68254 + * Physical to virtual address translation.
68255 + *
68256 + * Given the physical (DMA) address for a character buffer, this function
68257 + * returns the virtual equivalent.
68258 + */
68259 +static inline void *qe2cpu_addr(dma_addr_t addr, struct uart_qe_port *qe_port)
68260 +{
68261 +       /* sanity check */
68262 +       if (likely((addr >= qe_port->bd_dma_addr) &&
68263 +                  (addr < (qe_port->bd_dma_addr + qe_port->bd_size))))
68264 +               return qe_port->bd_virt + (addr - qe_port->bd_dma_addr);
68265 +
68266 +       /* something nasty happened */
68267 +       printk(KERN_ERR "%s: addr=%x\n", __FUNCTION__, addr);
68268 +       BUG();
68269 +       return NULL;
68270 +}
68271 +
68272 +/*
68273 + * Return 1 if the QE is done transmitting all buffers for this port
68274 + *
68275 + * This function scans each BD in sequence.  If we find a BD that is not
68276 + * ready (READY=1), then we return 0 indicating that the QE is still sending
68277 + * data.  If we reach the last BD (WRAP=1), then we know we've scanned
68278 + * the entire list, and all BDs are done.
68279 + */
68280 +static unsigned int qe_uart_tx_empty(struct uart_port *port)
68281 +{
68282 +       struct uart_qe_port *qe_port =
68283 +               container_of(port, struct uart_qe_port, port);
68284 +       struct qe_bd *bdp = qe_port->tx_bd_base;
68285 +
68286 +       while (1) {
68287 +               if (in_be16(&bdp->status) & BD_SC_READY)
68288 +                       /* This BD is not done, so return "not done" */
68289 +                       return 0;
68290 +
68291 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
68292 +                       /*
68293 +                        * This BD is done and it's the last one, so return
68294 +                        * "done"
68295 +                        */
68296 +                       return 1;
68297 +
68298 +               bdp++;
68299 +       };
68300 +}
68301 +
68302 +/*
68303 + * Set the modem control lines
68304 + *
68305 + * Although the QE can control the modem control lines (e.g. CTS), we
68306 + * don't need that support. This function must exist, however, otherwise
68307 + * the kernel will panic.
68308 + */
68309 +void qe_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
68310 +{
68311 +}
68312 +
68313 +/*
68314 + * Get the current modem control line status
68315 + *
68316 + * Although the QE can control the modem control lines (e.g. CTS), this
68317 + * driver currently doesn't support that, so we always return Carrier
68318 + * Detect, Data Set Ready, and Clear To Send.
68319 + */
68320 +static unsigned int qe_uart_get_mctrl(struct uart_port *port)
68321 +{
68322 +       return TIOCM_CAR | TIOCM_DSR | TIOCM_CTS;
68323 +}
68324 +
68325 +/*
68326 + * Disable the transmit interrupt.
68327 + *
68328 + * Although this function is called "stop_tx", it does not actually stop
68329 + * transmission of data.  Instead, it tells the QE to not generate an
68330 + * interrupt when the UCC is finished sending characters.
68331 + */
68332 +static void qe_uart_stop_tx(struct uart_port *port)
68333 +{
68334 +       struct uart_qe_port *qe_port =
68335 +               container_of(port, struct uart_qe_port, port);
68336 +
68337 +       clrbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_TX);
68338 +}
68339 +
68340 +/*
68341 + * Transmit as many characters to the HW as possible.
68342 + *
68343 + * This function will attempt to stuff of all the characters from the
68344 + * kernel's transmit buffer into TX BDs.
68345 + *
68346 + * A return value of non-zero indicates that it sucessfully stuffed all
68347 + * characters from the kernel buffer.
68348 + *
68349 + * A return value of zero indicates that there are still characters in the
68350 + * kernel's buffer that have not been transmitted, but there are no more BDs
68351 + * available.  This function should be called again after a BD has been made
68352 + * available.
68353 + */
68354 +static int qe_uart_tx_pump(struct uart_qe_port *qe_port)
68355 +{
68356 +       struct qe_bd *bdp;
68357 +       unsigned char *p;
68358 +       unsigned int count;
68359 +       struct uart_port *port = &qe_port->port;
68360 +       struct circ_buf *xmit = &port->info->xmit;
68361 +
68362 +       bdp = qe_port->rx_cur;
68363 +
68364 +       /* Handle xon/xoff */
68365 +       if (port->x_char) {
68366 +               /* Pick next descriptor and fill from buffer */
68367 +               bdp = qe_port->tx_cur;
68368 +
68369 +               p = qe2cpu_addr(bdp->buf, qe_port);
68370 +
68371 +               *p++ = port->x_char;
68372 +               out_be16(&bdp->length, 1);
68373 +               setbits16(&bdp->status, BD_SC_READY);
68374 +               /* Get next BD. */
68375 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
68376 +                       bdp = qe_port->tx_bd_base;
68377 +               else
68378 +                       bdp++;
68379 +               qe_port->tx_cur = bdp;
68380 +
68381 +               port->icount.tx++;
68382 +               port->x_char = 0;
68383 +               return 1;
68384 +       }
68385 +
68386 +       if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
68387 +               qe_uart_stop_tx(port);
68388 +               return 0;
68389 +       }
68390 +
68391 +       /* Pick next descriptor and fill from buffer */
68392 +       bdp = qe_port->tx_cur;
68393 +
68394 +       while (!(in_be16(&bdp->status) & BD_SC_READY) &&
68395 +              (xmit->tail != xmit->head)) {
68396 +               count = 0;
68397 +               p = qe2cpu_addr(bdp->buf, qe_port);
68398 +               while (count < qe_port->tx_fifosize) {
68399 +                       *p++ = xmit->buf[xmit->tail];
68400 +                       xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
68401 +                       port->icount.tx++;
68402 +                       count++;
68403 +                       if (xmit->head == xmit->tail)
68404 +                               break;
68405 +               }
68406 +
68407 +               out_be16(&bdp->length, count);
68408 +               setbits16(&bdp->status, BD_SC_READY);
68409 +
68410 +               /* Get next BD. */
68411 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
68412 +                       bdp = qe_port->tx_bd_base;
68413 +               else
68414 +                       bdp++;
68415 +       }
68416 +       qe_port->tx_cur = bdp;
68417 +
68418 +       if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
68419 +               uart_write_wakeup(port);
68420 +
68421 +       if (uart_circ_empty(xmit)) {
68422 +               /* The kernel buffer is empty, so turn off TX interrupts.  We
68423 +                  don't need to be told when the QE is finished transmitting
68424 +                  the data. */
68425 +               qe_uart_stop_tx(port);
68426 +               return 0;
68427 +       }
68428 +
68429 +       return 1;
68430 +}
68431 +
68432 +/*
68433 + * Start transmitting data
68434 + *
68435 + * This function will start transmitting any available data, if the port
68436 + * isn't already transmitting data.
68437 + */
68438 +static void qe_uart_start_tx(struct uart_port *port)
68439 +{
68440 +       struct uart_qe_port *qe_port =
68441 +               container_of(port, struct uart_qe_port, port);
68442 +
68443 +       /* If we currently are transmitting, then just return */
68444 +       if (in_be16(&qe_port->uccp->uccm) & UCC_UART_UCCE_TX)
68445 +               return;
68446 +
68447 +       /* Otherwise, pump the port and start transmission */
68448 +       if (qe_uart_tx_pump(qe_port))
68449 +               setbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_TX);
68450 +}
68451 +
68452 +/*
68453 + * Stop transmitting data
68454 + */
68455 +static void qe_uart_stop_rx(struct uart_port *port)
68456 +{
68457 +       struct uart_qe_port *qe_port =
68458 +               container_of(port, struct uart_qe_port, port);
68459 +
68460 +       clrbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_RX);
68461 +}
68462 +
68463 +/*
68464 + * Enable status change interrupts
68465 + *
68466 + * We don't support status change interrupts, but we need to define this
68467 + * function otherwise the kernel will panic.
68468 + */
68469 +static void qe_uart_enable_ms(struct uart_port *port)
68470 +{
68471 +}
68472 +
68473 +/* Start or stop sending  break signal
68474 + *
68475 + * This function controls the sending of a break signal.  If break_state=1,
68476 + * then we start sending a break signal.  If break_state=0, then we stop
68477 + * sending the break signal.
68478 + */
68479 +static void qe_uart_break_ctl(struct uart_port *port, int break_state)
68480 +{
68481 +       struct uart_qe_port *qe_port =
68482 +               container_of(port, struct uart_qe_port, port);
68483 +
68484 +       if (break_state)
68485 +               ucc_slow_stop_tx(qe_port->us_private);
68486 +       else
68487 +               ucc_slow_restart_tx(qe_port->us_private);
68488 +}
68489 +
68490 +/* ISR helper function for receiving character.
68491 + *
68492 + * This function is called by the ISR to handling receiving characters
68493 + */
68494 +static void qe_uart_int_rx(struct uart_qe_port *qe_port)
68495 +{
68496 +       int i;
68497 +       unsigned char ch, *cp;
68498 +       struct uart_port *port = &qe_port->port;
68499 +       struct tty_struct *tty = port->info->tty;
68500 +       struct qe_bd *bdp;
68501 +       u16 status;
68502 +       unsigned int flg;
68503 +
68504 +       /* Just loop through the closed BDs and copy the characters into
68505 +        * the buffer.
68506 +        */
68507 +       bdp = qe_port->rx_cur;
68508 +       while (1) {
68509 +               status = in_be16(&bdp->status);
68510 +
68511 +               /* If this one is empty, then we assume we've read them all */
68512 +               if (status & BD_SC_EMPTY)
68513 +                       break;
68514 +
68515 +               /* get number of characters, and check space in RX buffer */
68516 +               i = in_be16(&bdp->length);
68517 +
68518 +               /* If we don't have enough room in RX buffer for the entire BD,
68519 +                * then we try later, which will be the next RX interrupt.
68520 +                */
68521 +               if (tty_buffer_request_room(tty, i) < i) {
68522 +                       dev_dbg(port->dev, "ucc-uart: no room in RX buffer\n");
68523 +                       return;
68524 +               }
68525 +
68526 +               /* get pointer */
68527 +               cp = qe2cpu_addr(bdp->buf, qe_port);
68528 +
68529 +               /* loop through the buffer */
68530 +               while (i-- > 0) {
68531 +                       ch = *cp++;
68532 +                       port->icount.rx++;
68533 +                       flg = TTY_NORMAL;
68534 +
68535 +                       if (!i && status &
68536 +                           (BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV))
68537 +                               goto handle_error;
68538 +                       if (uart_handle_sysrq_char(port, ch))
68539 +                               continue;
68540 +
68541 +error_return:
68542 +                       tty_insert_flip_char(tty, ch, flg);
68543 +
68544 +               }
68545 +
68546 +               /* This BD is ready to be used again. Clear status. get next */
68547 +               clrsetbits_be16(&bdp->status, BD_SC_BR | BD_SC_FR | BD_SC_PR |
68548 +                       BD_SC_OV | BD_SC_ID, BD_SC_EMPTY);
68549 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
68550 +                       bdp = qe_port->rx_bd_base;
68551 +               else
68552 +                       bdp++;
68553 +
68554 +       }
68555 +
68556 +       /* Write back buffer pointer */
68557 +       qe_port->rx_cur = bdp;
68558 +
68559 +       /* Activate BH processing */
68560 +       tty_flip_buffer_push(tty);
68561 +
68562 +       return;
68563 +
68564 +       /* Error processing */
68565 +
68566 +handle_error:
68567 +       /* Statistics */
68568 +       if (status & BD_SC_BR)
68569 +               port->icount.brk++;
68570 +       if (status & BD_SC_PR)
68571 +               port->icount.parity++;
68572 +       if (status & BD_SC_FR)
68573 +               port->icount.frame++;
68574 +       if (status & BD_SC_OV)
68575 +               port->icount.overrun++;
68576 +
68577 +       /* Mask out ignored conditions */
68578 +       status &= port->read_status_mask;
68579 +
68580 +       /* Handle the remaining ones */
68581 +       if (status & BD_SC_BR)
68582 +               flg = TTY_BREAK;
68583 +       else if (status & BD_SC_PR)
68584 +               flg = TTY_PARITY;
68585 +       else if (status & BD_SC_FR)
68586 +               flg = TTY_FRAME;
68587 +
68588 +       /* Overrun does not affect the current character ! */
68589 +       if (status & BD_SC_OV)
68590 +               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
68591 +#ifdef SUPPORT_SYSRQ
68592 +       port->sysrq = 0;
68593 +#endif
68594 +       goto error_return;
68595 +}
68596 +
68597 +/* Interrupt handler
68598 + *
68599 + * This interrupt handler is called after a BD is processed.
68600 + */
68601 +static irqreturn_t qe_uart_int(int irq, void *data)
68602 +{
68603 +       struct uart_qe_port *qe_port = (struct uart_qe_port *) data;
68604 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
68605 +       u16 events;
68606 +
68607 +       /* Clear the interrupts */
68608 +       events = in_be16(&uccp->ucce);
68609 +       out_be16(&uccp->ucce, events);
68610 +
68611 +       if (events & UCC_UART_UCCE_BRKE)
68612 +               uart_handle_break(&qe_port->port);
68613 +
68614 +       if (events & UCC_UART_UCCE_RX)
68615 +               qe_uart_int_rx(qe_port);
68616 +
68617 +       if (events & UCC_UART_UCCE_TX)
68618 +               qe_uart_tx_pump(qe_port);
68619 +
68620 +       return events ? IRQ_HANDLED : IRQ_NONE;
68621 +}
68622 +
68623 +/* Initialize buffer descriptors
68624 + *
68625 + * This function initializes all of the RX and TX buffer descriptors.
68626 + */
68627 +static void qe_uart_initbd(struct uart_qe_port *qe_port)
68628 +{
68629 +       int i;
68630 +       void *bd_virt;
68631 +       struct qe_bd *bdp;
68632 +
68633 +       /* Set the physical address of the host memory buffers in the buffer
68634 +        * descriptors, and the virtual address for us to work with.
68635 +        */
68636 +       bd_virt = qe_port->bd_virt;
68637 +       bdp = qe_port->rx_bd_base;
68638 +       qe_port->rx_cur = qe_port->rx_bd_base;
68639 +       for (i = 0; i < (qe_port->rx_nrfifos - 1); i++) {
68640 +               out_be16(&bdp->status, BD_SC_EMPTY | BD_SC_INTRPT);
68641 +               out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
68642 +               out_be16(&bdp->length, 0);
68643 +               bd_virt += qe_port->rx_fifosize;
68644 +               bdp++;
68645 +       }
68646 +
68647 +       /* */
68648 +       out_be16(&bdp->status, BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT);
68649 +       out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
68650 +       out_be16(&bdp->length, 0);
68651 +
68652 +       /* Set the physical address of the host memory
68653 +        * buffers in the buffer descriptors, and the
68654 +        * virtual address for us to work with.
68655 +        */
68656 +       bd_virt = qe_port->bd_virt +
68657 +               L1_CACHE_ALIGN(qe_port->rx_nrfifos * qe_port->rx_fifosize);
68658 +       qe_port->tx_cur = qe_port->tx_bd_base;
68659 +       bdp = qe_port->tx_bd_base;
68660 +       for (i = 0; i < (qe_port->tx_nrfifos - 1); i++) {
68661 +               out_be16(&bdp->status, BD_SC_INTRPT);
68662 +               out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
68663 +               out_be16(&bdp->length, 0);
68664 +               bd_virt += qe_port->tx_fifosize;
68665 +               bdp++;
68666 +       }
68667 +
68668 +       /* Loopback requires the preamble bit to be set on the first TX BD */
68669 +#ifdef LOOPBACK
68670 +       setbits16(&qe_port->tx_cur->status, BD_SC_P);
68671 +#endif
68672 +
68673 +       out_be16(&bdp->status, BD_SC_WRAP | BD_SC_INTRPT);
68674 +       out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
68675 +       out_be16(&bdp->length, 0);
68676 +}
68677 +
68678 +/*
68679 + * Initialize a UCC for UART.
68680 + *
68681 + * This function configures a given UCC to be used as a UART device. Basic
68682 + * UCC initialization is handled in qe_uart_request_port().  This function
68683 + * does all the UART-specific stuff.
68684 + */
68685 +static void qe_uart_init_ucc(struct uart_qe_port *qe_port)
68686 +{
68687 +       u32 cecr_subblock;
68688 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
68689 +       struct ucc_uart_pram *uccup = qe_port->uccup;
68690 +
68691 +       unsigned int i;
68692 +
68693 +       /* First, disable TX and RX in the UCC */
68694 +       ucc_slow_disable(qe_port->us_private, COMM_DIR_RX_AND_TX);
68695 +
68696 +       /* Program the UCC UART parameter RAM */
68697 +       out_8(&uccup->common.rbmr, UCC_BMR_GBL | UCC_BMR_BO_BE);
68698 +       out_8(&uccup->common.tbmr, UCC_BMR_GBL | UCC_BMR_BO_BE);
68699 +       out_be16(&uccup->common.mrblr, qe_port->rx_fifosize);
68700 +       out_be16(&uccup->maxidl, 0x10);
68701 +       out_be16(&uccup->brkcr, 1);
68702 +       out_be16(&uccup->parec, 0);
68703 +       out_be16(&uccup->frmec, 0);
68704 +       out_be16(&uccup->nosec, 0);
68705 +       out_be16(&uccup->brkec, 0);
68706 +       out_be16(&uccup->uaddr[0], 0);
68707 +       out_be16(&uccup->uaddr[1], 0);
68708 +       out_be16(&uccup->toseq, 0);
68709 +       for (i = 0; i < 8; i++)
68710 +               out_be16(&uccup->cchars[i], 0xC000);
68711 +       out_be16(&uccup->rccm, 0xc0ff);
68712 +
68713 +       /* Configure the GUMR registers for UART */
68714 +       if (soft_uart)
68715 +               /* Soft-UART requires a 1X multiplier for TX */
68716 +               clrsetbits_be32(&uccp->gumr_l,
68717 +                       UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
68718 +                       UCC_SLOW_GUMR_L_RDCR_MASK,
68719 +                       UCC_SLOW_GUMR_L_MODE_UART | UCC_SLOW_GUMR_L_TDCR_1 |
68720 +                       UCC_SLOW_GUMR_L_RDCR_16);
68721 +       else
68722 +               clrsetbits_be32(&uccp->gumr_l,
68723 +                       UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
68724 +                       UCC_SLOW_GUMR_L_RDCR_MASK,
68725 +                       UCC_SLOW_GUMR_L_MODE_UART | UCC_SLOW_GUMR_L_TDCR_16 |
68726 +                       UCC_SLOW_GUMR_L_RDCR_16);
68727 +
68728 +       clrsetbits_be32(&uccp->gumr_h, UCC_SLOW_GUMR_H_RFW,
68729 +               UCC_SLOW_GUMR_H_TRX | UCC_SLOW_GUMR_H_TTX);
68730 +
68731 +#ifdef LOOPBACK
68732 +       clrsetbits_be32(&uccp->gumr_l, UCC_SLOW_GUMR_L_DIAG_MASK,
68733 +               UCC_SLOW_GUMR_L_DIAG_LOOP);
68734 +       clrsetbits_be32(&uccp->gumr_h,
68735 +               UCC_SLOW_GUMR_H_CTSP | UCC_SLOW_GUMR_H_RSYN,
68736 +               UCC_SLOW_GUMR_H_CDS);
68737 +#endif
68738 +
68739 +       /* Enable rx interrupts  and clear all pending events.  */
68740 +       out_be16(&uccp->uccm, 0);
68741 +       out_be16(&uccp->ucce, 0xffff);
68742 +       out_be16(&uccp->udsr, 0x7e7e);
68743 +
68744 +       /* Initialize UPSMR */
68745 +       out_be16(&uccp->upsmr, 0);
68746 +
68747 +       if (soft_uart) {
68748 +               out_be16(&uccup->supsmr, 0x30);
68749 +               out_be16(&uccup->res92, 0);
68750 +               out_be32(&uccup->rx_state, 0);
68751 +               out_be32(&uccup->rx_cnt, 0);
68752 +               out_8(&uccup->rx_bitmark, 0);
68753 +               out_8(&uccup->rx_length, 10);
68754 +               out_be32(&uccup->dump_ptr, 0x4000);
68755 +               out_8(&uccup->rx_temp_dlst_qe, 0);
68756 +               out_be32(&uccup->rx_frame_rem, 0);
68757 +               out_8(&uccup->rx_frame_rem_size, 0);
68758 +               /* Soft-UART requires TX to be 1X */
68759 +               out_8(&uccup->tx_mode,
68760 +                       UCC_UART_TX_STATE_UART | UCC_UART_TX_STATE_X1);
68761 +               out_be16(&uccup->tx_state, 0);
68762 +               out_8(&uccup->resD4, 0);
68763 +               out_be16(&uccup->resD5, 0);
68764 +
68765 +               /* Set UART mode.
68766 +                * Enable receive and transmit.
68767 +                */
68768 +
68769 +               /* From the microcode errata:
68770 +                * 1.GUMR_L register, set mode=0010 (QMC).
68771 +                * 2.Set GUMR_H[17] bit. (UART/AHDLC mode).
68772 +                * 3.Set GUMR_H[19:20] (Transparent mode)
68773 +                * 4.Clear GUMR_H[26] (RFW)
68774 +                * ...
68775 +                * 6.Receiver must use 16x over sampling
68776 +                */
68777 +               clrsetbits_be32(&uccp->gumr_l,
68778 +                       UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
68779 +                       UCC_SLOW_GUMR_L_RDCR_MASK,
68780 +                       UCC_SLOW_GUMR_L_MODE_QMC | UCC_SLOW_GUMR_L_TDCR_16 |
68781 +                       UCC_SLOW_GUMR_L_RDCR_16);
68782 +
68783 +               clrsetbits_be32(&uccp->gumr_h,
68784 +                       UCC_SLOW_GUMR_H_RFW | UCC_SLOW_GUMR_H_RSYN,
68785 +                       UCC_SLOW_GUMR_H_SUART | UCC_SLOW_GUMR_H_TRX |
68786 +                       UCC_SLOW_GUMR_H_TTX | UCC_SLOW_GUMR_H_TFL);
68787 +
68788 +#ifdef LOOPBACK
68789 +               clrsetbits_be32(&uccp->gumr_l, UCC_SLOW_GUMR_L_DIAG_MASK,
68790 +                               UCC_SLOW_GUMR_L_DIAG_LOOP);
68791 +               clrbits32(&uccp->gumr_h, UCC_SLOW_GUMR_H_CTSP |
68792 +                         UCC_SLOW_GUMR_H_CDS);
68793 +#endif
68794 +
68795 +               cecr_subblock = ucc_slow_get_qe_cr_subblock(qe_port->ucc_num);
68796 +               qe_issue_cmd(QE_INIT_TX_RX, cecr_subblock,
68797 +                       QE_CR_PROTOCOL_UNSPECIFIED, 0);
68798 +       }
68799 +}
68800 +
68801 +/*
68802 + * Initialize the port.
68803 + */
68804 +static int qe_uart_startup(struct uart_port *port)
68805 +{
68806 +       struct uart_qe_port *qe_port =
68807 +               container_of(port, struct uart_qe_port, port);
68808 +       int ret;
68809 +
68810 +       /*
68811 +        * If we're using Soft-UART mode, then we need to make sure the
68812 +        * firmware has been uploaded first.
68813 +        */
68814 +       if (soft_uart && !firmware_loaded) {
68815 +               dev_err(port->dev, "Soft-UART firmware not uploaded\n");
68816 +               return -ENODEV;
68817 +       }
68818 +
68819 +       qe_uart_initbd(qe_port);
68820 +       qe_uart_init_ucc(qe_port);
68821 +
68822 +       /* Install interrupt handler. */
68823 +       ret = request_irq(port->irq, qe_uart_int, IRQF_SHARED, "ucc-uart",
68824 +               qe_port);
68825 +       if (ret) {
68826 +               dev_err(port->dev, "could not claim IRQ %u\n", port->irq);
68827 +               return ret;
68828 +       }
68829 +
68830 +       /* Startup rx-int */
68831 +       setbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_RX);
68832 +       ucc_slow_enable(qe_port->us_private, COMM_DIR_RX_AND_TX);
68833 +
68834 +       return 0;
68835 +}
68836 +
68837 +/*
68838 + * Shutdown the port.
68839 + */
68840 +static void qe_uart_shutdown(struct uart_port *port)
68841 +{
68842 +       struct uart_qe_port *qe_port =
68843 +               container_of(port, struct uart_qe_port, port);
68844 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
68845 +       unsigned int timeout = 20;
68846 +
68847 +       /* Disable RX and TX */
68848 +
68849 +       /* Wait for all the BDs marked sent */
68850 +       while (!qe_uart_tx_empty(port)) {
68851 +               if (!--timeout) {
68852 +                       dev_warn(port->dev, "shutdown timeout\n");
68853 +                       break;
68854 +               }
68855 +               set_current_state(TASK_UNINTERRUPTIBLE);
68856 +               schedule_timeout(2);
68857 +       }
68858 +
68859 +       if (qe_port->wait_closing) {
68860 +               /* Wait a bit longer */
68861 +               set_current_state(TASK_UNINTERRUPTIBLE);
68862 +               schedule_timeout(qe_port->wait_closing);
68863 +       }
68864 +
68865 +       /* Stop uarts */
68866 +       ucc_slow_disable(qe_port->us_private, COMM_DIR_RX_AND_TX);
68867 +       clrbits16(&uccp->uccm, UCC_UART_UCCE_TX | UCC_UART_UCCE_RX);
68868 +
68869 +       /* Shut them really down and reinit buffer descriptors */
68870 +       ucc_slow_graceful_stop_tx(qe_port->us_private);
68871 +       qe_uart_initbd(qe_port);
68872 +
68873 +       free_irq(port->irq, qe_port);
68874 +}
68875 +
68876 +/*
68877 + * Set the serial port parameters.
68878 + */
68879 +static void qe_uart_set_termios(struct uart_port *port,
68880 +                               struct ktermios *termios, struct ktermios *old)
68881 +{
68882 +       struct uart_qe_port *qe_port =
68883 +               container_of(port, struct uart_qe_port, port);
68884 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
68885 +       unsigned int baud;
68886 +       unsigned long flags;
68887 +       u16 upsmr = in_be16(&uccp->upsmr);
68888 +       struct ucc_uart_pram __iomem *uccup = qe_port->uccup;
68889 +       u16 supsmr = in_be16(&uccup->supsmr);
68890 +       u8 char_length = 2; /* 1 + CL + PEN + 1 + SL */
68891 +
68892 +       /* Character length programmed into the mode register is the
68893 +        * sum of: 1 start bit, number of data bits, 0 or 1 parity bit,
68894 +        * 1 or 2 stop bits, minus 1.
68895 +        * The value 'bits' counts this for us.
68896 +        */
68897 +
68898 +       /* byte size */
68899 +       upsmr &= UCC_UART_UPSMR_CL_MASK;
68900 +       supsmr &= UCC_UART_SUPSMR_CL_MASK;
68901 +
68902 +       switch (termios->c_cflag & CSIZE) {
68903 +       case CS5:
68904 +               upsmr |= UCC_UART_UPSMR_CL_5;
68905 +               supsmr |= UCC_UART_SUPSMR_CL_5;
68906 +               char_length += 5;
68907 +               break;
68908 +       case CS6:
68909 +               upsmr |= UCC_UART_UPSMR_CL_6;
68910 +               supsmr |= UCC_UART_SUPSMR_CL_6;
68911 +               char_length += 6;
68912 +               break;
68913 +       case CS7:
68914 +               upsmr |= UCC_UART_UPSMR_CL_7;
68915 +               supsmr |= UCC_UART_SUPSMR_CL_7;
68916 +               char_length += 7;
68917 +               break;
68918 +       default:        /* case CS8 */
68919 +               upsmr |= UCC_UART_UPSMR_CL_8;
68920 +               supsmr |= UCC_UART_SUPSMR_CL_8;
68921 +               char_length += 8;
68922 +               break;
68923 +       }
68924 +
68925 +       /* If CSTOPB is set, we want two stop bits */
68926 +       if (termios->c_cflag & CSTOPB) {
68927 +               upsmr |= UCC_UART_UPSMR_SL;
68928 +               supsmr |= UCC_UART_SUPSMR_SL;
68929 +               char_length++;  /* + SL */
68930 +       }
68931 +
68932 +       if (termios->c_cflag & PARENB) {
68933 +               upsmr |= UCC_UART_UPSMR_PEN;
68934 +               supsmr |= UCC_UART_SUPSMR_PEN;
68935 +               char_length++;  /* + PEN */
68936 +
68937 +               if (!(termios->c_cflag & PARODD)) {
68938 +                       upsmr &= ~(UCC_UART_UPSMR_RPM_MASK |
68939 +                                  UCC_UART_UPSMR_TPM_MASK);
68940 +                       upsmr |= UCC_UART_UPSMR_RPM_EVEN |
68941 +                               UCC_UART_UPSMR_TPM_EVEN;
68942 +                       supsmr &= ~(UCC_UART_SUPSMR_RPM_MASK |
68943 +                                   UCC_UART_SUPSMR_TPM_MASK);
68944 +                       supsmr |= UCC_UART_SUPSMR_RPM_EVEN |
68945 +                               UCC_UART_SUPSMR_TPM_EVEN;
68946 +               }
68947 +       }
68948 +
68949 +       /*
68950 +        * Set up parity check flag
68951 +        */
68952 +       port->read_status_mask = BD_SC_EMPTY | BD_SC_OV;
68953 +       if (termios->c_iflag & INPCK)
68954 +               port->read_status_mask |= BD_SC_FR | BD_SC_PR;
68955 +       if (termios->c_iflag & (BRKINT | PARMRK))
68956 +               port->read_status_mask |= BD_SC_BR;
68957 +
68958 +       /*
68959 +        * Characters to ignore
68960 +        */
68961 +       port->ignore_status_mask = 0;
68962 +       if (termios->c_iflag & IGNPAR)
68963 +               port->ignore_status_mask |= BD_SC_PR | BD_SC_FR;
68964 +       if (termios->c_iflag & IGNBRK) {
68965 +               port->ignore_status_mask |= BD_SC_BR;
68966 +               /*
68967 +                * If we're ignore parity and break indicators, ignore
68968 +                * overruns too.  (For real raw support).
68969 +                */
68970 +               if (termios->c_iflag & IGNPAR)
68971 +                       port->ignore_status_mask |= BD_SC_OV;
68972 +       }
68973 +       /*
68974 +        * !!! ignore all characters if CREAD is not set
68975 +        */
68976 +       if ((termios->c_cflag & CREAD) == 0)
68977 +               port->read_status_mask &= ~BD_SC_EMPTY;
68978 +
68979 +       baud = uart_get_baud_rate(port, termios, old, 0, 115200);
68980 +
68981 +       /* Do we really need a spinlock here? */
68982 +       spin_lock_irqsave(&port->lock, flags);
68983 +
68984 +       out_be16(&uccp->upsmr, upsmr);
68985 +       if (soft_uart) {
68986 +               out_be16(&uccup->supsmr, supsmr);
68987 +               out_8(&uccup->rx_length, char_length);
68988 +
68989 +               /* Soft-UART requires a 1X multiplier for TX */
68990 +               qe_setbrg(qe_port->us_info.rx_clock, baud, 16);
68991 +               qe_setbrg(qe_port->us_info.tx_clock, baud, 1);
68992 +       } else {
68993 +               qe_setbrg(qe_port->us_info.rx_clock, baud, 16);
68994 +               qe_setbrg(qe_port->us_info.tx_clock, baud, 16);
68995 +       }
68996 +
68997 +       spin_unlock_irqrestore(&port->lock, flags);
68998 +}
68999 +
69000 +/*
69001 + * Return a pointer to a string that describes what kind of port this is.
69002 + */
69003 +static const char *qe_uart_type(struct uart_port *port)
69004 +{
69005 +       return "QE";
69006 +}
69007 +
69008 +/*
69009 + * Allocate any memory and I/O resources required by the port.
69010 + */
69011 +static int qe_uart_request_port(struct uart_port *port)
69012 +{
69013 +       int ret;
69014 +       struct uart_qe_port *qe_port =
69015 +               container_of(port, struct uart_qe_port, port);
69016 +       struct ucc_slow_info *us_info = &qe_port->us_info;
69017 +       struct ucc_slow_private *uccs;
69018 +       unsigned int rx_size, tx_size;
69019 +       void *bd_virt;
69020 +       dma_addr_t bd_dma_addr = 0;
69021 +
69022 +       ret = ucc_slow_init(us_info, &uccs);
69023 +       if (ret) {
69024 +               dev_err(port->dev, "could not initialize UCC%u\n",
69025 +                      qe_port->ucc_num);
69026 +               return ret;
69027 +       }
69028 +
69029 +       qe_port->us_private = uccs;
69030 +       qe_port->uccp = uccs->us_regs;
69031 +       qe_port->uccup = (struct ucc_uart_pram *) uccs->us_pram;
69032 +       qe_port->rx_bd_base = uccs->rx_bd;
69033 +       qe_port->tx_bd_base = uccs->tx_bd;
69034 +
69035 +       /*
69036 +        * Allocate the transmit and receive data buffers.
69037 +        */
69038 +
69039 +       rx_size = L1_CACHE_ALIGN(qe_port->rx_nrfifos * qe_port->rx_fifosize);
69040 +       tx_size = L1_CACHE_ALIGN(qe_port->tx_nrfifos * qe_port->tx_fifosize);
69041 +
69042 +       bd_virt = dma_alloc_coherent(NULL, rx_size + tx_size, &bd_dma_addr,
69043 +               GFP_KERNEL);
69044 +       if (!bd_virt) {
69045 +               dev_err(port->dev, "could not allocate buffer descriptors\n");
69046 +               return -ENOMEM;
69047 +       }
69048 +
69049 +       qe_port->bd_virt = bd_virt;
69050 +       qe_port->bd_dma_addr = bd_dma_addr;
69051 +       qe_port->bd_size = rx_size + tx_size;
69052 +
69053 +       qe_port->rx_buf = bd_virt;
69054 +       qe_port->tx_buf = qe_port->rx_buf + rx_size;
69055 +
69056 +       return 0;
69057 +}
69058 +
69059 +/*
69060 + * Configure the port.
69061 + *
69062 + * We say we're a CPM-type port because that's mostly true.  Once the device
69063 + * is configured, this driver operates almost identically to the CPM serial
69064 + * driver.
69065 + */
69066 +static void qe_uart_config_port(struct uart_port *port, int flags)
69067 +{
69068 +       if (flags & UART_CONFIG_TYPE) {
69069 +               port->type = PORT_CPM;
69070 +               qe_uart_request_port(port);
69071 +       }
69072 +}
69073 +
69074 +/*
69075 + * Release any memory and I/O resources that were allocated in
69076 + * qe_uart_request_port().
69077 + */
69078 +static void qe_uart_release_port(struct uart_port *port)
69079 +{
69080 +       struct uart_qe_port *qe_port =
69081 +               container_of(port, struct uart_qe_port, port);
69082 +       struct ucc_slow_private *uccs = qe_port->us_private;
69083 +
69084 +       dma_free_coherent(NULL, qe_port->bd_size, qe_port->bd_virt,
69085 +                         qe_port->bd_dma_addr);
69086 +
69087 +       ucc_slow_free(uccs);
69088 +}
69089 +
69090 +/*
69091 + * Verify that the data in serial_struct is suitable for this device.
69092 + */
69093 +static int qe_uart_verify_port(struct uart_port *port,
69094 +                              struct serial_struct *ser)
69095 +{
69096 +       if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM)
69097 +               return -EINVAL;
69098 +
69099 +       if (ser->irq < 0 || ser->irq >= NR_IRQS)
69100 +               return -EINVAL;
69101 +
69102 +       if (ser->baud_base < 9600)
69103 +               return -EINVAL;
69104 +
69105 +       return 0;
69106 +}
69107 +/* UART operations
69108 + *
69109 + * Details on these functions can be found in Documentation/serial/driver
69110 + */
69111 +static struct uart_ops qe_uart_pops = {
69112 +       .tx_empty       = qe_uart_tx_empty,
69113 +       .set_mctrl      = qe_uart_set_mctrl,
69114 +       .get_mctrl      = qe_uart_get_mctrl,
69115 +       .stop_tx        = qe_uart_stop_tx,
69116 +       .start_tx       = qe_uart_start_tx,
69117 +       .stop_rx        = qe_uart_stop_rx,
69118 +       .enable_ms      = qe_uart_enable_ms,
69119 +       .break_ctl      = qe_uart_break_ctl,
69120 +       .startup        = qe_uart_startup,
69121 +       .shutdown       = qe_uart_shutdown,
69122 +       .set_termios    = qe_uart_set_termios,
69123 +       .type           = qe_uart_type,
69124 +       .release_port   = qe_uart_release_port,
69125 +       .request_port   = qe_uart_request_port,
69126 +       .config_port    = qe_uart_config_port,
69127 +       .verify_port    = qe_uart_verify_port,
69128 +};
69129 +
69130 +/*
69131 + * Obtain the SOC model number and revision level
69132 + *
69133 + * This function parses the device tree to obtain the SOC model.  It then
69134 + * reads the SVR register to the revision.
69135 + *
69136 + * The device tree stores the SOC model two different ways.
69137 + *
69138 + * The new way is:
69139 + *
69140 + *             cpu@0 {
69141 + *                     compatible = "PowerPC,8323";
69142 + *                     device_type = "cpu";
69143 + *                     ...
69144 + *
69145 + *
69146 + * The old way is:
69147 + *              PowerPC,8323@0 {
69148 + *                     device_type = "cpu";
69149 + *                     ...
69150 + *
69151 + * This code first checks the new way, and then the old way.
69152 + */
69153 +static unsigned int soc_info(unsigned int *rev_h, unsigned int *rev_l)
69154 +{
69155 +       struct device_node *np;
69156 +       const char *soc_string;
69157 +       unsigned int svr;
69158 +       unsigned int soc;
69159 +
69160 +       /* Find the CPU node */
69161 +       np = of_find_node_by_type(NULL, "cpu");
69162 +       if (!np)
69163 +               return 0;
69164 +       /* Find the compatible property */
69165 +       soc_string = of_get_property(np, "compatible", NULL);
69166 +       if (!soc_string)
69167 +               /* No compatible property, so try the name. */
69168 +               soc_string = np->name;
69169 +
69170 +       /* Extract the SOC number from the "PowerPC," string */
69171 +       if ((sscanf(soc_string, "PowerPC,%u", &soc) != 1) || !soc)
69172 +               return 0;
69173 +
69174 +       /* Get the revision from the SVR */
69175 +       svr = mfspr(SPRN_SVR);
69176 +       *rev_h = (svr >> 4) & 0xf;
69177 +       *rev_l = svr & 0xf;
69178 +
69179 +       return soc;
69180 +}
69181 +
69182 +/*
69183 + * requst_firmware_nowait() callback function
69184 + *
69185 + * This function is called by the kernel when a firmware is made available,
69186 + * or if it times out waiting for the firmware.
69187 + */
69188 +static void uart_firmware_cont(const struct firmware *fw, void *context)
69189 +{
69190 +       struct qe_firmware *firmware;
69191 +       struct device *dev = context;
69192 +       int ret;
69193 +
69194 +       if (!fw) {
69195 +               dev_err(dev, "firmware not found\n");
69196 +               return;
69197 +       }
69198 +
69199 +       firmware = (struct qe_firmware *) fw->data;
69200 +
69201 +       if (firmware->header.length != fw->size) {
69202 +               dev_err(dev, "invalid firmware\n");
69203 +               return;
69204 +       }
69205 +
69206 +       ret = qe_upload_firmware(firmware);
69207 +       if (ret) {
69208 +               dev_err(dev, "could not load firmware\n");
69209 +               return;
69210 +       }
69211 +
69212 +       firmware_loaded = 1;
69213 +}
69214 +
69215 +static int ucc_uart_probe(struct of_device *ofdev,
69216 +       const struct of_device_id *match)
69217 +{
69218 +       struct device_node *np = ofdev->node;
69219 +       const unsigned int *iprop;      /* Integer OF properties */
69220 +       const char *sprop;      /* String OF properties */
69221 +       struct uart_qe_port *qe_port = NULL;
69222 +       struct resource res;
69223 +       int ret;
69224 +
69225 +       /*
69226 +        * Determine if we need Soft-UART mode
69227 +        */
69228 +       if (of_find_property(np, "soft-uart", NULL)) {
69229 +               dev_dbg(&ofdev->dev, "using Soft-UART mode\n");
69230 +               soft_uart = 1;
69231 +       }
69232 +
69233 +       /*
69234 +        * If we are using Soft-UART, determine if we need to upload the
69235 +        * firmware, too.
69236 +        */
69237 +       if (soft_uart) {
69238 +               struct qe_firmware_info *qe_fw_info;
69239 +
69240 +               qe_fw_info = qe_get_firmware_info();
69241 +
69242 +               /* Check if the firmware has been uploaded. */
69243 +               if (qe_fw_info && strstr(qe_fw_info->id, "Soft-UART")) {
69244 +                       firmware_loaded = 1;
69245 +               } else {
69246 +                       char filename[32];
69247 +                       unsigned int soc;
69248 +                       unsigned int rev_h;
69249 +                       unsigned int rev_l;
69250 +
69251 +                       soc = soc_info(&rev_h, &rev_l);
69252 +                       if (!soc) {
69253 +                               dev_err(&ofdev->dev, "unknown CPU model\n");
69254 +                               return -ENXIO;
69255 +                       }
69256 +                       sprintf(filename, "fsl_qe_ucode_uart_%u_%u%u.bin",
69257 +                               soc, rev_h, rev_l);
69258 +
69259 +                       dev_info(&ofdev->dev, "waiting for firmware %s\n",
69260 +                               filename);
69261 +
69262 +                       /*
69263 +                        * We call request_firmware_nowait instead of
69264 +                        * request_firmware so that the driver can load and
69265 +                        * initialize the ports without holding up the rest of
69266 +                        * the kernel.  If hotplug support is enabled in the
69267 +                        * kernel, then we use it.
69268 +                        */
69269 +                       ret = request_firmware_nowait(THIS_MODULE,
69270 +                               FW_ACTION_HOTPLUG, filename, &ofdev->dev,
69271 +                               &ofdev->dev, uart_firmware_cont);
69272 +                       if (ret) {
69273 +                               dev_err(&ofdev->dev,
69274 +                                       "could not load firmware %s\n",
69275 +                                       filename);
69276 +                               return ret;
69277 +                       }
69278 +               }
69279 +       }
69280 +
69281 +       qe_port = kzalloc(sizeof(struct uart_qe_port), GFP_KERNEL);
69282 +       if (!qe_port) {
69283 +               dev_err(&ofdev->dev, "can't allocate QE port structure\n");
69284 +               return -ENOMEM;
69285 +       }
69286 +
69287 +       /* Search for IRQ and mapbase */
69288 +       ret = of_address_to_resource(np, 0, &res);
69289 +       if (ret) {
69290 +               dev_err(&ofdev->dev, "missing 'reg' property in device tree\n");
69291 +               kfree(qe_port);
69292 +               return ret;
69293 +       }
69294 +       if (!res.start) {
69295 +               dev_err(&ofdev->dev, "invalid 'reg' property in device tree\n");
69296 +               kfree(qe_port);
69297 +               return -EINVAL;
69298 +       }
69299 +       qe_port->port.mapbase = res.start;
69300 +
69301 +       /* Get the UCC number (device ID) */
69302 +       /* UCCs are numbered 1-7 */
69303 +       iprop = of_get_property(np, "device-id", NULL);
69304 +       if (!iprop || (*iprop < 1) || (*iprop > UCC_MAX_NUM)) {
69305 +               dev_err(&ofdev->dev,
69306 +                       "missing or invalid UCC specified in device tree\n");
69307 +               kfree(qe_port);
69308 +               return -ENODEV;
69309 +       }
69310 +       qe_port->ucc_num = *iprop - 1;
69311 +
69312 +       /*
69313 +        * In the future, we should not require the BRG to be specified in the
69314 +        * device tree.  If no clock-source is specified, then just pick a BRG
69315 +        * to use.  This requires a new QE library function that manages BRG
69316 +        * assignments.
69317 +        */
69318 +
69319 +       sprop = of_get_property(np, "rx-clock-name", NULL);
69320 +       if (!sprop) {
69321 +               dev_err(&ofdev->dev, "missing rx-clock-name in device tree\n");
69322 +               kfree(qe_port);
69323 +               return -ENODEV;
69324 +       }
69325 +
69326 +       qe_port->us_info.rx_clock = qe_clock_source(sprop);
69327 +       if ((qe_port->us_info.rx_clock < QE_BRG1) ||
69328 +           (qe_port->us_info.rx_clock > QE_BRG16)) {
69329 +               dev_err(&ofdev->dev, "rx-clock-name must be a BRG for UART\n");
69330 +               kfree(qe_port);
69331 +               return -ENODEV;
69332 +       }
69333 +
69334 +#ifdef LOOPBACK
69335 +       /* In internal loopback mode, TX and RX must use the same clock */
69336 +       qe_port->us_info.tx_clock = qe_port->us_info.rx_clock;
69337 +#else
69338 +       sprop = of_get_property(np, "tx-clock-name", NULL);
69339 +       if (!sprop) {
69340 +               dev_err(&ofdev->dev, "missing tx-clock-name in device tree\n");
69341 +               kfree(qe_port);
69342 +               return -ENODEV;
69343 +       }
69344 +       qe_port->us_info.tx_clock = qe_clock_source(sprop);
69345 +#endif
69346 +       if ((qe_port->us_info.tx_clock < QE_BRG1) ||
69347 +           (qe_port->us_info.tx_clock > QE_BRG16)) {
69348 +               dev_err(&ofdev->dev, "tx-clock-name must be a BRG for UART\n");
69349 +               kfree(qe_port);
69350 +               return -ENODEV;
69351 +       }
69352 +
69353 +       /* Get the port number, numbered 0-3 */
69354 +       iprop = of_get_property(np, "port-number", NULL);
69355 +       if (!iprop) {
69356 +               dev_err(&ofdev->dev, "missing port-number in device tree\n");
69357 +               kfree(qe_port);
69358 +               return -EINVAL;
69359 +       }
69360 +       qe_port->port.line = *iprop;
69361 +       if (qe_port->port.line >= UCC_MAX_UART) {
69362 +               dev_err(&ofdev->dev, "port-number must be 0-%u\n",
69363 +                       UCC_MAX_UART - 1);
69364 +               kfree(qe_port);
69365 +               return -EINVAL;
69366 +       }
69367 +
69368 +       qe_port->port.irq = irq_of_parse_and_map(np, 0);
69369 +       if (qe_port->port.irq == NO_IRQ) {
69370 +               dev_err(&ofdev->dev, "could not map IRQ for UCC%u\n",
69371 +                      qe_port->ucc_num + 1);
69372 +               kfree(qe_port);
69373 +               return -EINVAL;
69374 +       }
69375 +
69376 +       /*
69377 +        * Newer device trees have an "fsl,qe" compatible property for the QE
69378 +        * node, but we still need to support older device trees.
69379 +        */
69380 +       np = of_find_compatible_node(NULL, NULL, "fsl,qe");
69381 +       if (!np) {
69382 +               np = of_find_node_by_type(NULL, "qe");
69383 +               if (!np) {
69384 +                       dev_err(&ofdev->dev, "could not find 'qe' node\n");
69385 +                       kfree(qe_port);
69386 +                       return -EINVAL;
69387 +               }
69388 +       }
69389 +
69390 +       iprop = of_get_property(np, "brg-frequency", NULL);
69391 +       if (!iprop) {
69392 +               dev_err(&ofdev->dev,
69393 +                      "missing brg-frequency in device tree\n");
69394 +               kfree(qe_port);
69395 +               return -EINVAL;
69396 +       }
69397 +
69398 +       if (*iprop)
69399 +               qe_port->port.uartclk = *iprop;
69400 +       else {
69401 +               /*
69402 +                * Older versions of U-Boot do not initialize the brg-frequency
69403 +                * property, so in this case we assume the BRG frequency is
69404 +                * half the QE bus frequency.
69405 +                */
69406 +               iprop = of_get_property(np, "bus-frequency", NULL);
69407 +               if (!iprop) {
69408 +                       dev_err(&ofdev->dev,
69409 +                               "missing QE bus-frequency in device tree\n");
69410 +                       kfree(qe_port);
69411 +                       return -EINVAL;
69412 +               }
69413 +               if (*iprop)
69414 +                       qe_port->port.uartclk = *iprop / 2;
69415 +               else {
69416 +                       dev_err(&ofdev->dev,
69417 +                               "invalid QE bus-frequency in device tree\n");
69418 +                       kfree(qe_port);
69419 +                       return -EINVAL;
69420 +               }
69421 +       }
69422 +
69423 +       spin_lock_init(&qe_port->port.lock);
69424 +       qe_port->np = np;
69425 +       qe_port->port.dev = &ofdev->dev;
69426 +       qe_port->port.ops = &qe_uart_pops;
69427 +       qe_port->port.iotype = UPIO_MEM;
69428 +
69429 +       qe_port->tx_nrfifos = TX_NUM_FIFO;
69430 +       qe_port->tx_fifosize = TX_BUF_SIZE;
69431 +       qe_port->rx_nrfifos = RX_NUM_FIFO;
69432 +       qe_port->rx_fifosize = RX_BUF_SIZE;
69433 +
69434 +       qe_port->wait_closing = UCC_WAIT_CLOSING;
69435 +       qe_port->port.fifosize = 512;
69436 +       qe_port->port.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP;
69437 +
69438 +       qe_port->us_info.ucc_num = qe_port->ucc_num;
69439 +       qe_port->us_info.regs = (phys_addr_t) res.start;
69440 +       qe_port->us_info.irq = qe_port->port.irq;
69441 +
69442 +       qe_port->us_info.rx_bd_ring_len = qe_port->rx_nrfifos;
69443 +       qe_port->us_info.tx_bd_ring_len = qe_port->tx_nrfifos;
69444 +
69445 +       /* Make sure ucc_slow_init() initializes both TX and RX */
69446 +       qe_port->us_info.init_tx = 1;
69447 +       qe_port->us_info.init_rx = 1;
69448 +
69449 +       /* Add the port to the uart sub-system.  This will cause
69450 +        * qe_uart_config_port() to be called, so the us_info structure must
69451 +        * be initialized.
69452 +        */
69453 +       ret = uart_add_one_port(&ucc_uart_driver, &qe_port->port);
69454 +       if (ret) {
69455 +               dev_err(&ofdev->dev, "could not add /dev/ttyQE%u\n",
69456 +                      qe_port->port.line);
69457 +               kfree(qe_port);
69458 +               return ret;
69459 +       }
69460 +
69461 +       dev_set_drvdata(&ofdev->dev, qe_port);
69462 +
69463 +       dev_info(&ofdev->dev, "UCC%u assigned to /dev/ttyQE%u\n",
69464 +               qe_port->ucc_num + 1, qe_port->port.line);
69465 +
69466 +       /* Display the mknod command for this device */
69467 +       dev_dbg(&ofdev->dev, "mknod command is 'mknod /dev/ttyQE%u c %u %u'\n",
69468 +              qe_port->port.line, SERIAL_QE_MAJOR,
69469 +              SERIAL_QE_MINOR + qe_port->port.line);
69470 +
69471 +       return 0;
69472 +}
69473 +
69474 +static int ucc_uart_remove(struct of_device *ofdev)
69475 +{
69476 +       struct uart_qe_port *qe_port = dev_get_drvdata(&ofdev->dev);
69477 +
69478 +       dev_info(&ofdev->dev, "removing /dev/ttyQE%u\n", qe_port->port.line);
69479 +
69480 +       uart_remove_one_port(&ucc_uart_driver, &qe_port->port);
69481 +
69482 +       dev_set_drvdata(&ofdev->dev, NULL);
69483 +       kfree(qe_port);
69484 +
69485 +       return 0;
69486 +}
69487 +
69488 +static struct of_device_id ucc_uart_match[] = {
69489 +       {
69490 +               .type = "serial",
69491 +               .compatible = "ucc_uart",
69492 +       },
69493 +       {},
69494 +};
69495 +MODULE_DEVICE_TABLE(of, ucc_uart_match);
69496 +
69497 +static struct of_platform_driver ucc_uart_of_driver = {
69498 +       .owner          = THIS_MODULE,
69499 +       .name           = "ucc_uart",
69500 +       .match_table    = ucc_uart_match,
69501 +       .probe          = ucc_uart_probe,
69502 +       .remove         = ucc_uart_remove,
69503 +};
69504 +
69505 +static int __init ucc_uart_init(void)
69506 +{
69507 +       int ret;
69508 +
69509 +       printk(KERN_INFO "Freescale QUICC Engine UART device driver\n");
69510 +#ifdef LOOPBACK
69511 +       printk(KERN_INFO "ucc-uart: Using loopback mode\n");
69512 +#endif
69513 +
69514 +       ret = uart_register_driver(&ucc_uart_driver);
69515 +       if (ret) {
69516 +               printk(KERN_ERR "ucc-uart: could not register UART driver\n");
69517 +               return ret;
69518 +       }
69519 +
69520 +       ret = of_register_platform_driver(&ucc_uart_of_driver);
69521 +       if (ret)
69522 +               printk(KERN_ERR
69523 +                      "ucc-uart: could not register platform driver\n");
69524 +
69525 +       return ret;
69526 +}
69527 +
69528 +static void __exit ucc_uart_exit(void)
69529 +{
69530 +       printk(KERN_INFO
69531 +              "Freescale QUICC Engine UART device driver unloading\n");
69532 +
69533 +       of_unregister_platform_driver(&ucc_uart_of_driver);
69534 +       uart_unregister_driver(&ucc_uart_driver);
69535 +}
69536 +
69537 +module_init(ucc_uart_init);
69538 +module_exit(ucc_uart_exit);
69539 +
69540 +MODULE_DESCRIPTION("Freescale QUICC Engine (QE) UART");
69541 +MODULE_AUTHOR("Timur Tabi <timur@freescale.com>");
69542 +MODULE_LICENSE("GPL v2");
69543 +MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_QE_MAJOR);
69544 +
69545 Index: linux-2.6.24.7/drivers/spi/mpc52xx_psc_spi.c
69546 ===================================================================
69547 --- linux-2.6.24.7.orig/drivers/spi/mpc52xx_psc_spi.c
69548 +++ linux-2.6.24.7/drivers/spi/mpc52xx_psc_spi.c
69549 @@ -330,6 +330,7 @@ static void mpc52xx_psc_spi_cleanup(stru
69550  
69551  static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
69552  {
69553 +       struct device_node *np;
69554         struct mpc52xx_cdm __iomem *cdm;
69555         struct mpc52xx_gpio __iomem *gpio;
69556         struct mpc52xx_psc __iomem *psc = mps->psc;
69557 @@ -338,8 +339,12 @@ static int mpc52xx_psc_spi_port_config(i
69558         int ret = 0;
69559  
69560  #if defined(CONFIG_PPC_MERGE)
69561 -       cdm = mpc52xx_find_and_map("mpc5200-cdm");
69562 -       gpio = mpc52xx_find_and_map("mpc5200-gpio");
69563 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-cdm");
69564 +       cdm = of_iomap(np, 0);
69565 +       of_node_put(np);
69566 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-gpio");
69567 +       gpio = of_iomap(np, 0);
69568 +       of_node_put(np);
69569  #else
69570         cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
69571         gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
69572 Index: linux-2.6.24.7/fs/openpromfs/inode.c
69573 ===================================================================
69574 --- linux-2.6.24.7.orig/fs/openpromfs/inode.c
69575 +++ linux-2.6.24.7/fs/openpromfs/inode.c
69576 @@ -131,7 +131,7 @@ static void property_stop(struct seq_fil
69577         /* Nothing to do */
69578  }
69579  
69580 -static const struct seq_operations property_op = {
69581 +static struct seq_operations property_op = {
69582         .start          = property_start,
69583         .next           = property_next,
69584         .stop           = property_stop,
69585 Index: linux-2.6.24.7/include/asm-powerpc/8xx_immap.h
69586 ===================================================================
69587 --- linux-2.6.24.7.orig/include/asm-powerpc/8xx_immap.h
69588 +++ linux-2.6.24.7/include/asm-powerpc/8xx_immap.h
69589 @@ -123,7 +123,7 @@ typedef struct      mem_ctlr {
69590  #define OR_G5LA                0x00000400      /* Output #GPL5 on #GPL_A5              */
69591  #define OR_G5LS                0x00000200      /* Drive #GPL high on falling edge of...*/
69592  #define OR_BI          0x00000100      /* Burst inhibit                        */
69593 -#define OR_SCY_MSK     0x000000f0      /* Cycle Lenght in Clocks               */
69594 +#define OR_SCY_MSK     0x000000f0      /* Cycle Length in Clocks               */
69595  #define OR_SCY_0_CLK   0x00000000      /* 0 clock cycles wait states           */
69596  #define OR_SCY_1_CLK   0x00000010      /* 1 clock cycles wait states           */
69597  #define OR_SCY_2_CLK   0x00000020      /* 2 clock cycles wait states           */
69598 Index: linux-2.6.24.7/include/asm-powerpc/commproc.h
69599 ===================================================================
69600 --- linux-2.6.24.7.orig/include/asm-powerpc/commproc.h
69601 +++ linux-2.6.24.7/include/asm-powerpc/commproc.h
69602 @@ -693,7 +693,7 @@ typedef struct risc_timer_pram {
69603  #define        CICR_SCC_SCC3           ((uint)0x00200000)      /* SCC3 @ SCCc */
69604  #define        CICR_SCB_SCC2           ((uint)0x00040000)      /* SCC2 @ SCCb */
69605  #define        CICR_SCA_SCC1           ((uint)0x00000000)      /* SCC1 @ SCCa */
69606 -#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrrupt */
69607 +#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrupt */
69608  #define CICR_HP_MASK           ((uint)0x00001f00)      /* Hi-pri int. */
69609  #define CICR_IEN               ((uint)0x00000080)      /* Int. enable */
69610  #define CICR_SPS               ((uint)0x00000001)      /* SCC Spread */
69611 Index: linux-2.6.24.7/include/asm-powerpc/cpm.h
69612 ===================================================================
69613 --- linux-2.6.24.7.orig/include/asm-powerpc/cpm.h
69614 +++ linux-2.6.24.7/include/asm-powerpc/cpm.h
69615 @@ -10,5 +10,6 @@ int cpm_muram_free(unsigned long offset)
69616  unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
69617  void __iomem *cpm_muram_addr(unsigned long offset);
69618  dma_addr_t cpm_muram_dma(void __iomem *addr);
69619 +int cpm_command(u32 command, u8 opcode);
69620  
69621  #endif
69622 Index: linux-2.6.24.7/include/asm-powerpc/cputable.h
69623 ===================================================================
69624 --- linux-2.6.24.7.orig/include/asm-powerpc/cputable.h
69625 +++ linux-2.6.24.7/include/asm-powerpc/cputable.h
69626 @@ -57,6 +57,14 @@ enum powerpc_pmc_type {
69627         PPC_PMC_PA6T = 2,
69628  };
69629  
69630 +struct pt_regs;
69631 +
69632 +extern int machine_check_generic(struct pt_regs *regs);
69633 +extern int machine_check_4xx(struct pt_regs *regs);
69634 +extern int machine_check_440A(struct pt_regs *regs);
69635 +extern int machine_check_e500(struct pt_regs *regs);
69636 +extern int machine_check_e200(struct pt_regs *regs);
69637 +
69638  /* NOTE WELL: Update identify_cpu() if fields are added or removed! */
69639  struct cpu_spec {
69640         /* CPU is matched via (PVR & pvr_mask) == pvr_value */
69641 @@ -97,6 +105,11 @@ struct cpu_spec {
69642  
69643         /* Name of processor class, for the ELF AT_PLATFORM entry */
69644         char            *platform;
69645 +
69646 +       /* Processor specific machine check handling. Return negative
69647 +        * if the error is fatal, 1 if it was fully recovered and 0 to
69648 +        * pass up (not CPU originated) */
69649 +       int             (*machine_check)(struct pt_regs *regs);
69650  };
69651  
69652  extern struct cpu_spec         *cur_cpu_spec;
69653 Index: linux-2.6.24.7/include/asm-powerpc/cputhreads.h
69654 ===================================================================
69655 --- /dev/null
69656 +++ linux-2.6.24.7/include/asm-powerpc/cputhreads.h
69657 @@ -0,0 +1,71 @@
69658 +#ifndef _ASM_POWERPC_CPUTHREADS_H
69659 +#define _ASM_POWERPC_CPUTHREADS_H
69660 +
69661 +#include <linux/cpumask.h>
69662 +
69663 +/*
69664 + * Mapping of threads to cores
69665 + */
69666 +
69667 +#ifdef CONFIG_SMP
69668 +extern int threads_per_core;
69669 +extern int threads_shift;
69670 +extern cpumask_t threads_core_mask;
69671 +#else
69672 +#define threads_per_core       1
69673 +#define threads_shift          0
69674 +#define threads_core_mask      (CPU_MASK_CPU0)
69675 +#endif
69676 +
69677 +/* cpu_thread_mask_to_cores - Return a cpumask of one per cores
69678 + *                            hit by the argument
69679 + *
69680 + * @threads:   a cpumask of threads
69681 + *
69682 + * This function returns a cpumask which will have one "cpu" (or thread)
69683 + * bit set for each core that has at least one thread set in the argument.
69684 + *
69685 + * This can typically be used for things like IPI for tlb invalidations
69686 + * since those need to be done only once per core/TLB
69687 + */
69688 +static inline cpumask_t cpu_thread_mask_to_cores(cpumask_t threads)
69689 +{
69690 +       cpumask_t       tmp, res;
69691 +       int             i;
69692 +
69693 +       res = CPU_MASK_NONE;
69694 +       for (i = 0; i < NR_CPUS; i += threads_per_core) {
69695 +               cpus_shift_right(tmp, threads_core_mask, i);
69696 +               if (cpus_intersects(threads, tmp))
69697 +                       cpu_set(i, res);
69698 +       }
69699 +       return res;
69700 +}
69701 +
69702 +static inline int cpu_nr_cores(void)
69703 +{
69704 +       return NR_CPUS >> threads_shift;
69705 +}
69706 +
69707 +static inline cpumask_t cpu_online_cores_map(void)
69708 +{
69709 +       return cpu_thread_mask_to_cores(cpu_online_map);
69710 +}
69711 +
69712 +static inline int cpu_thread_to_core(int cpu)
69713 +{
69714 +       return cpu >> threads_shift;
69715 +}
69716 +
69717 +static inline int cpu_thread_in_core(int cpu)
69718 +{
69719 +       return cpu & (threads_per_core - 1);
69720 +}
69721 +
69722 +static inline int cpu_first_thread_in_core(int cpu)
69723 +{
69724 +       return cpu & ~(threads_per_core - 1);
69725 +}
69726 +
69727 +#endif /* _ASM_POWERPC_CPUTHREADS_H */
69728 +
69729 Index: linux-2.6.24.7/include/asm-powerpc/dcr-native.h
69730 ===================================================================
69731 --- linux-2.6.24.7.orig/include/asm-powerpc/dcr-native.h
69732 +++ linux-2.6.24.7/include/asm-powerpc/dcr-native.h
69733 @@ -22,6 +22,8 @@
69734  #ifdef __KERNEL__
69735  #ifndef __ASSEMBLY__
69736  
69737 +#include <linux/spinlock.h>
69738 +
69739  typedef struct {
69740         unsigned int base;
69741  } dcr_host_t;
69742 @@ -55,20 +57,28 @@ do {                                                                \
69743  } while (0)
69744  
69745  /* R/W of indirect DCRs make use of standard naming conventions for DCRs */
69746 -#define mfdcri(base, reg)                      \
69747 -({                                             \
69748 -       mtdcr(base ## _CFGADDR, base ## _ ## reg);      \
69749 -       mfdcr(base ## _CFGDATA);                        \
69750 +extern spinlock_t dcr_ind_lock;
69751 +
69752 +#define mfdcri(base, reg)                              \
69753 +({                                                     \
69754 +       unsigned long flags;                            \
69755 +       unsigned int val;                               \
69756 +       spin_lock_irqsave(&dcr_ind_lock, flags);        \
69757 +       mtdcr(DCRN_ ## base ## _CONFIG_ADDR, reg);      \
69758 +       val = mfdcr(DCRN_ ## base ## _CONFIG_DATA);     \
69759 +       spin_unlock_irqrestore(&dcr_ind_lock, flags);   \
69760 +       val;                                            \
69761  })
69762  
69763 -#define mtdcri(base, reg, data)                        \
69764 -do {                                           \
69765 -       mtdcr(base ## _CFGADDR, base ## _ ## reg);      \
69766 -       mtdcr(base ## _CFGDATA, data);          \
69767 +#define mtdcri(base, reg, data)                                \
69768 +do {                                                   \
69769 +       unsigned long flags;                            \
69770 +       spin_lock_irqsave(&dcr_ind_lock, flags);        \
69771 +       mtdcr(DCRN_ ## base ## _CONFIG_ADDR, reg);      \
69772 +       mtdcr(DCRN_ ## base ## _CONFIG_DATA, data);     \
69773 +       spin_unlock_irqrestore(&dcr_ind_lock, flags);   \
69774  } while (0)
69775  
69776  #endif /* __ASSEMBLY__ */
69777  #endif /* __KERNEL__ */
69778  #endif /* _ASM_POWERPC_DCR_NATIVE_H */
69779 -
69780 -
69781 Index: linux-2.6.24.7/include/asm-powerpc/dcr-regs.h
69782 ===================================================================
69783 --- /dev/null
69784 +++ linux-2.6.24.7/include/asm-powerpc/dcr-regs.h
69785 @@ -0,0 +1,71 @@
69786 +/*
69787 + * Common DCR / SDR / CPR register definitions used on various IBM/AMCC
69788 + * 4xx processors
69789 + *
69790 + *    Copyright 2007 Benjamin Herrenschmidt, IBM Corp
69791 + *                   <benh@kernel.crashing.org>
69792 + *
69793 + * Mostly lifted from asm-ppc/ibm4xx.h by
69794 + *
69795 + *    Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
69796 + *
69797 + */
69798 +
69799 +#ifndef __DCR_REGS_H__
69800 +#define __DCR_REGS_H__
69801 +
69802 +/*
69803 + * Most DCRs used for controlling devices such as the MAL, DMA engine,
69804 + * etc... are obtained for the device tree.
69805 + *
69806 + * The definitions in this files are fixed DCRs and indirect DCRs that
69807 + * are commonly used outside of specific drivers or refer to core
69808 + * common registers that may occasionally have to be tweaked outside
69809 + * of the driver main register set
69810 + */
69811 +
69812 +/* CPRs (440GX and 440SP/440SPe) */
69813 +#define DCRN_CPR0_CONFIG_ADDR  0xc
69814 +#define DCRN_CPR0_CONFIG_DATA  0xd
69815 +
69816 +/* SDRs (440GX and 440SP/440SPe) */
69817 +#define DCRN_SDR0_CONFIG_ADDR  0xe
69818 +#define DCRN_SDR0_CONFIG_DATA  0xf
69819 +
69820 +#define SDR0_PFC0              0x4100
69821 +#define SDR0_PFC1              0x4101
69822 +#define SDR0_PFC1_EPS          0x1c00000
69823 +#define SDR0_PFC1_EPS_SHIFT    22
69824 +#define SDR0_PFC1_RMII         0x02000000
69825 +#define SDR0_MFR               0x4300
69826 +#define SDR0_MFR_TAH0          0x80000000      /* TAHOE0 Enable */
69827 +#define SDR0_MFR_TAH1          0x40000000      /* TAHOE1 Enable */
69828 +#define SDR0_MFR_PCM           0x10000000      /* PPC440GP irq compat mode */
69829 +#define SDR0_MFR_ECS           0x08000000      /* EMAC int clk */
69830 +#define SDR0_MFR_T0TXFL                0x00080000
69831 +#define SDR0_MFR_T0TXFH                0x00040000
69832 +#define SDR0_MFR_T1TXFL                0x00020000
69833 +#define SDR0_MFR_T1TXFH                0x00010000
69834 +#define SDR0_MFR_E0TXFL                0x00008000
69835 +#define SDR0_MFR_E0TXFH                0x00004000
69836 +#define SDR0_MFR_E0RXFL                0x00002000
69837 +#define SDR0_MFR_E0RXFH                0x00001000
69838 +#define SDR0_MFR_E1TXFL                0x00000800
69839 +#define SDR0_MFR_E1TXFH                0x00000400
69840 +#define SDR0_MFR_E1RXFL                0x00000200
69841 +#define SDR0_MFR_E1RXFH                0x00000100
69842 +#define SDR0_MFR_E2TXFL                0x00000080
69843 +#define SDR0_MFR_E2TXFH                0x00000040
69844 +#define SDR0_MFR_E2RXFL                0x00000020
69845 +#define SDR0_MFR_E2RXFH                0x00000010
69846 +#define SDR0_MFR_E3TXFL                0x00000008
69847 +#define SDR0_MFR_E3TXFH                0x00000004
69848 +#define SDR0_MFR_E3RXFL                0x00000002
69849 +#define SDR0_MFR_E3RXFH                0x00000001
69850 +#define SDR0_UART0             0x0120
69851 +#define SDR0_UART1             0x0121
69852 +#define SDR0_UART2             0x0122
69853 +#define SDR0_UART3             0x0123
69854 +#define SDR0_CUST0             0x4000
69855 +
69856 +#endif /* __DCR_REGS_H__ */
69857 Index: linux-2.6.24.7/include/asm-powerpc/dma-mapping.h
69858 ===================================================================
69859 --- linux-2.6.24.7.orig/include/asm-powerpc/dma-mapping.h
69860 +++ linux-2.6.24.7/include/asm-powerpc/dma-mapping.h
69861 @@ -87,6 +87,9 @@ static inline int dma_supported(struct d
69862         return dma_ops->dma_supported(dev, mask);
69863  }
69864  
69865 +/* We have our own implementation of pci_set_dma_mask() */
69866 +#define HAVE_ARCH_PCI_SET_DMA_MASK
69867 +
69868  static inline int dma_set_mask(struct device *dev, u64 dma_mask)
69869  {
69870         struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
69871 @@ -186,8 +189,6 @@ static inline void dma_unmap_sg(struct d
69872  extern struct dma_mapping_ops dma_iommu_ops;
69873  extern struct dma_mapping_ops dma_direct_ops;
69874  
69875 -extern unsigned long dma_direct_offset;
69876 -
69877  #else /* CONFIG_PPC64 */
69878  
69879  #define dma_supported(dev, mask)       (1)
69880 Index: linux-2.6.24.7/include/asm-powerpc/firmware.h
69881 ===================================================================
69882 --- linux-2.6.24.7.orig/include/asm-powerpc/firmware.h
69883 +++ linux-2.6.24.7/include/asm-powerpc/firmware.h
69884 @@ -64,7 +64,7 @@ enum {
69885         FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
69886         FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
69887         FW_FEATURE_CELLEB_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_BEAT,
69888 -       FW_FEATURE_CELLEB_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_BEAT,
69889 +       FW_FEATURE_CELLEB_ALWAYS = 0,
69890         FW_FEATURE_NATIVE_POSSIBLE = 0,
69891         FW_FEATURE_NATIVE_ALWAYS = 0,
69892         FW_FEATURE_POSSIBLE =
69893 Index: linux-2.6.24.7/include/asm-powerpc/immap_86xx.h
69894 ===================================================================
69895 --- linux-2.6.24.7.orig/include/asm-powerpc/immap_86xx.h
69896 +++ linux-2.6.24.7/include/asm-powerpc/immap_86xx.h
69897 @@ -89,14 +89,14 @@ struct ccsr_guts {
69898   * them.
69899   *
69900   * guts: Pointer to GUTS structure
69901 - * co: The DMA controller (1 or 2)
69902 + * co: The DMA controller (0 or 1)
69903   * ch: The channel on the DMA controller (0, 1, 2, or 3)
69904   * device: The device to set as the source (CCSR_GUTS_DMACR_DEV_xx)
69905   */
69906  static inline void guts_set_dmacr(struct ccsr_guts __iomem *guts,
69907         unsigned int co, unsigned int ch, unsigned int device)
69908  {
69909 -       unsigned int shift = 16 + (8 * (2 - co) + 2 * (3 - ch));
69910 +       unsigned int shift = 16 + (8 * (1 - co) + 2 * (3 - ch));
69911  
69912         clrsetbits_be32(&guts->dmacr, 3 << shift, device << shift);
69913  }
69914 @@ -118,6 +118,27 @@ static inline void guts_set_dmacr(struct
69915  #define CCSR_GUTS_PMUXCR_DMA1_0                0x00000002
69916  #define CCSR_GUTS_PMUXCR_DMA1_3                0x00000001
69917  
69918 +/*
69919 + * Set the DMA external control bits in the GUTS
69920 + *
69921 + * The DMA external control bits in the PMUXCR are only meaningful for
69922 + * channels 0 and 3.  Any other channels are ignored.
69923 + *
69924 + * guts: Pointer to GUTS structure
69925 + * co: The DMA controller (0 or 1)
69926 + * ch: The channel on the DMA controller (0, 1, 2, or 3)
69927 + * value: the new value for the bit (0 or 1)
69928 + */
69929 +static inline void guts_set_pmuxcr_dma(struct ccsr_guts __iomem *guts,
69930 +       unsigned int co, unsigned int ch, unsigned int value)
69931 +{
69932 +       if ((ch == 0) || (ch == 3)) {
69933 +               unsigned int shift = 2 * (co + 1) - (ch & 1) - 1;
69934 +
69935 +               clrsetbits_be32(&guts->pmuxcr, 1 << shift, value << shift);
69936 +       }
69937 +}
69938 +
69939  #define CCSR_GUTS_CLKDVDR_PXCKEN       0x80000000
69940  #define CCSR_GUTS_CLKDVDR_SSICKEN      0x20000000
69941  #define CCSR_GUTS_CLKDVDR_PXCKINV      0x10000000
69942 Index: linux-2.6.24.7/include/asm-powerpc/immap_qe.h
69943 ===================================================================
69944 --- linux-2.6.24.7.orig/include/asm-powerpc/immap_qe.h
69945 +++ linux-2.6.24.7/include/asm-powerpc/immap_qe.h
69946 @@ -393,9 +393,39 @@ struct dbg {
69947         u8      res2[0x48];
69948  } __attribute__ ((packed));
69949  
69950 -/* RISC Special Registers (Trap and Breakpoint) */
69951 +/*
69952 + * RISC Special Registers (Trap and Breakpoint).  These are described in
69953 + * the QE Developer's Handbook.
69954 + */
69955  struct rsp {
69956 -       u32     reg[0x40];      /* 64 32-bit registers */
69957 +       __be32 tibcr[16];       /* Trap/instruction breakpoint control regs */
69958 +       u8 res0[64];
69959 +       __be32 ibcr0;
69960 +       __be32 ibs0;
69961 +       __be32 ibcnr0;
69962 +       u8 res1[4];
69963 +       __be32 ibcr1;
69964 +       __be32 ibs1;
69965 +       __be32 ibcnr1;
69966 +       __be32 npcr;
69967 +       __be32 dbcr;
69968 +       __be32 dbar;
69969 +       __be32 dbamr;
69970 +       __be32 dbsr;
69971 +       __be32 dbcnr;
69972 +       u8 res2[12];
69973 +       __be32 dbdr_h;
69974 +       __be32 dbdr_l;
69975 +       __be32 dbdmr_h;
69976 +       __be32 dbdmr_l;
69977 +       __be32 bsr;
69978 +       __be32 bor;
69979 +       __be32 bior;
69980 +       u8 res3[4];
69981 +       __be32 iatr[4];
69982 +       __be32 eccr;            /* Exception control configuration register */
69983 +       __be32 eicr;
69984 +       u8 res4[0x100-0xf8];
69985  } __attribute__ ((packed));
69986  
69987  struct qe_immap {
69988 Index: linux-2.6.24.7/include/asm-powerpc/io.h
69989 ===================================================================
69990 --- linux-2.6.24.7.orig/include/asm-powerpc/io.h
69991 +++ linux-2.6.24.7/include/asm-powerpc/io.h
69992 @@ -50,15 +50,16 @@ extern int check_legacy_ioport(unsigned 
69993  #define PCI_DRAM_OFFSET        pci_dram_offset
69994  #else
69995  #define _IO_BASE       pci_io_base
69996 -#define _ISA_MEM_BASE  0
69997 +#define _ISA_MEM_BASE  isa_mem_base
69998  #define PCI_DRAM_OFFSET        0
69999  #endif
70000  
70001  extern unsigned long isa_io_base;
70002 -extern unsigned long isa_mem_base;
70003  extern unsigned long pci_io_base;
70004  extern unsigned long pci_dram_offset;
70005  
70006 +extern resource_size_t isa_mem_base;
70007 +
70008  #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_INDIRECT_IO)
70009  #error CONFIG_PPC_INDIRECT_IO is not yet supported on 32 bits
70010  #endif
70011 Index: linux-2.6.24.7/include/asm-powerpc/iommu.h
70012 ===================================================================
70013 --- linux-2.6.24.7.orig/include/asm-powerpc/iommu.h
70014 +++ linux-2.6.24.7/include/asm-powerpc/iommu.h
70015 @@ -69,10 +69,9 @@ struct iommu_table {
70016  };
70017  
70018  struct scatterlist;
70019 -struct device_node;
70020  
70021  /* Frees table for an individual device node */
70022 -extern void iommu_free_table(struct device_node *dn);
70023 +extern void iommu_free_table(struct iommu_table *tbl, const char *node_name);
70024  
70025  /* Initializes an iommu_table based in values set in the passed-in
70026   * structure
70027 Index: linux-2.6.24.7/include/asm-powerpc/ipic.h
70028 ===================================================================
70029 --- linux-2.6.24.7.orig/include/asm-powerpc/ipic.h
70030 +++ linux-2.6.24.7/include/asm-powerpc/ipic.h
70031 @@ -20,11 +20,13 @@
70032  
70033  /* Flags when we init the IPIC */
70034  #define IPIC_SPREADMODE_GRP_A  0x00000001
70035 -#define IPIC_SPREADMODE_GRP_D  0x00000002
70036 -#define IPIC_SPREADMODE_MIX_A  0x00000004
70037 -#define IPIC_SPREADMODE_MIX_B  0x00000008
70038 -#define IPIC_DISABLE_MCP_OUT   0x00000010
70039 -#define IPIC_IRQ0_MCP          0x00000020
70040 +#define IPIC_SPREADMODE_GRP_B  0x00000002
70041 +#define IPIC_SPREADMODE_GRP_C  0x00000004
70042 +#define IPIC_SPREADMODE_GRP_D  0x00000008
70043 +#define IPIC_SPREADMODE_MIX_A  0x00000010
70044 +#define IPIC_SPREADMODE_MIX_B  0x00000020
70045 +#define IPIC_DISABLE_MCP_OUT   0x00000040
70046 +#define IPIC_IRQ0_MCP          0x00000080
70047  
70048  /* IPIC registers offsets */
70049  #define IPIC_SICFR     0x00    /* System Global Interrupt Configuration Register */
70050 Index: linux-2.6.24.7/include/asm-powerpc/iseries/hv_lp_event.h
70051 ===================================================================
70052 --- linux-2.6.24.7.orig/include/asm-powerpc/iseries/hv_lp_event.h
70053 +++ linux-2.6.24.7/include/asm-powerpc/iseries/hv_lp_event.h
70054 @@ -78,7 +78,7 @@ extern int HvLpEvent_openPath(HvLpEvent_
70055  
70056  /*
70057   * Close an Lp Event Path for a type and partition
70058 - * returns 0 on sucess
70059 + * returns 0 on success
70060   */
70061  extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
70062  
70063 Index: linux-2.6.24.7/include/asm-powerpc/kexec.h
70064 ===================================================================
70065 --- linux-2.6.24.7.orig/include/asm-powerpc/kexec.h
70066 +++ linux-2.6.24.7/include/asm-powerpc/kexec.h
70067 @@ -123,6 +123,9 @@ struct pt_regs;
70068  extern void default_machine_kexec(struct kimage *image);
70069  extern int default_machine_kexec_prepare(struct kimage *image);
70070  extern void default_machine_crash_shutdown(struct pt_regs *regs);
70071 +typedef void (*crash_shutdown_t)(void);
70072 +extern int crash_shutdown_register(crash_shutdown_t handler);
70073 +extern int crash_shutdown_unregister(crash_shutdown_t handler);
70074  
70075  extern void machine_kexec_simple(struct kimage *image);
70076  extern void crash_kexec_secondary(struct pt_regs *regs);
70077 Index: linux-2.6.24.7/include/asm-powerpc/lmb.h
70078 ===================================================================
70079 --- linux-2.6.24.7.orig/include/asm-powerpc/lmb.h
70080 +++ linux-2.6.24.7/include/asm-powerpc/lmb.h
70081 @@ -51,6 +51,7 @@ extern unsigned long __init __lmb_alloc_
70082  extern unsigned long __init lmb_phys_mem_size(void);
70083  extern unsigned long __init lmb_end_of_DRAM(void);
70084  extern void __init lmb_enforce_memory_limit(unsigned long memory_limit);
70085 +extern int __init lmb_is_reserved(unsigned long addr);
70086  
70087  extern void lmb_dump_all(void);
70088  
70089 Index: linux-2.6.24.7/include/asm-powerpc/machdep.h
70090 ===================================================================
70091 --- linux-2.6.24.7.orig/include/asm-powerpc/machdep.h
70092 +++ linux-2.6.24.7/include/asm-powerpc/machdep.h
70093 @@ -204,6 +204,13 @@ struct machdep_calls {
70094         /*
70095          * optional PCI "hooks"
70096          */
70097 +       /* Called in indirect_* to avoid touching devices */
70098 +       int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
70099 +
70100 +       /* Called at then very end of pcibios_init() */
70101 +       void (*pcibios_after_init)(void);
70102 +
70103 +#endif /* CONFIG_PPC32 */
70104  
70105         /* Called after PPC generic resource fixup to perform
70106            machine specific fixups */
70107 @@ -212,18 +219,9 @@ struct machdep_calls {
70108         /* Called for each PCI bus in the system when it's probed */
70109         void (*pcibios_fixup_bus)(struct pci_bus *);
70110  
70111 -       /* Called when pci_enable_device() is called (initial=0) or
70112 -        * when a device with no assigned resource is found (initial=1).
70113 -        * Returns 0 to allow assignment/enabling of the device. */
70114 -       int  (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
70115 -
70116 -       /* Called in indirect_* to avoid touching devices */
70117 -       int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
70118 -
70119 -       /* Called at then very end of pcibios_init() */
70120 -       void (*pcibios_after_init)(void);
70121 -
70122 -#endif /* CONFIG_PPC32 */
70123 +       /* Called when pci_enable_device() is called. Returns 0 to
70124 +        * allow assignment/enabling of the device. */
70125 +       int  (*pcibios_enable_device_hook)(struct pci_dev *);
70126  
70127         /* Called to shutdown machine specific hardware not already controlled
70128          * by other drivers.
70129 @@ -253,6 +251,16 @@ struct machdep_calls {
70130          */
70131         void (*machine_kexec)(struct kimage *image);
70132  #endif /* CONFIG_KEXEC */
70133 +
70134 +#ifdef CONFIG_SUSPEND
70135 +       /* These are called to disable and enable, respectively, IRQs when
70136 +        * entering a suspend state.  If NULL, then the generic versions
70137 +        * will be called.  The generic versions disable/enable the
70138 +        * decrementer along with interrupts.
70139 +        */
70140 +       void (*suspend_disable_irqs)(void);
70141 +       void (*suspend_enable_irqs)(void);
70142 +#endif
70143  };
70144  
70145  extern void power4_idle(void);
70146 @@ -326,5 +334,31 @@ static inline void log_error(char *buf, 
70147                 ppc_md.log_error(buf, err_type, fatal);
70148  }
70149  
70150 +#define __define_machine_initcall(mach,level,fn,id) \
70151 +       static int __init __machine_initcall_##mach##_##fn(void) { \
70152 +               if (machine_is(mach)) return fn(); \
70153 +               return 0; \
70154 +       } \
70155 +       __define_initcall(level,__machine_initcall_##mach##_##fn,id);
70156 +
70157 +#define machine_core_initcall(mach,fn)         __define_machine_initcall(mach,"1",fn,1)
70158 +#define machine_core_initcall_sync(mach,fn)    __define_machine_initcall(mach,"1s",fn,1s)
70159 +#define machine_postcore_initcall(mach,fn)     __define_machine_initcall(mach,"2",fn,2)
70160 +#define machine_postcore_initcall_sync(mach,fn)        __define_machine_initcall(mach,"2s",fn,2s)
70161 +#define machine_arch_initcall(mach,fn)         __define_machine_initcall(mach,"3",fn,3)
70162 +#define machine_arch_initcall_sync(mach,fn)    __define_machine_initcall(mach,"3s",fn,3s)
70163 +#define machine_subsys_initcall(mach,fn)       __define_machine_initcall(mach,"4",fn,4)
70164 +#define machine_subsys_initcall_sync(mach,fn)  __define_machine_initcall(mach,"4s",fn,4s)
70165 +#define machine_fs_initcall(mach,fn)           __define_machine_initcall(mach,"5",fn,5)
70166 +#define machine_fs_initcall_sync(mach,fn)      __define_machine_initcall(mach,"5s",fn,5s)
70167 +#define machine_rootfs_initcall(mach,fn)       __define_machine_initcall(mach,"rootfs",fn,rootfs)
70168 +#define machine_device_initcall(mach,fn)       __define_machine_initcall(mach,"6",fn,6)
70169 +#define machine_device_initcall_sync(mach,fn)  __define_machine_initcall(mach,"6s",fn,6s)
70170 +#define machine_late_initcall(mach,fn)         __define_machine_initcall(mach,"7",fn,7)
70171 +#define machine_late_initcall_sync(mach,fn)    __define_machine_initcall(mach,"7s",fn,7s)
70172 +
70173 +void generic_suspend_disable_irqs(void);
70174 +void generic_suspend_enable_irqs(void);
70175 +
70176  #endif /* __KERNEL__ */
70177  #endif /* _ASM_POWERPC_MACHDEP_H */
70178 Index: linux-2.6.24.7/include/asm-powerpc/mmu-hash64.h
70179 ===================================================================
70180 --- linux-2.6.24.7.orig/include/asm-powerpc/mmu-hash64.h
70181 +++ linux-2.6.24.7/include/asm-powerpc/mmu-hash64.h
70182 @@ -80,7 +80,7 @@ extern char initial_stab[];
70183  #define HPTE_V_AVPN_SHIFT      7
70184  #define HPTE_V_AVPN            ASM_CONST(0x3fffffffffffff80)
70185  #define HPTE_V_AVPN_VAL(x)     (((x) & HPTE_V_AVPN) >> HPTE_V_AVPN_SHIFT)
70186 -#define HPTE_V_COMPARE(x,y)    (!(((x) ^ (y)) & 0xffffffffffffff80))
70187 +#define HPTE_V_COMPARE(x,y)    (!(((x) ^ (y)) & 0xffffffffffffff80UL))
70188  #define HPTE_V_BOLTED          ASM_CONST(0x0000000000000010)
70189  #define HPTE_V_LOCK            ASM_CONST(0x0000000000000008)
70190  #define HPTE_V_LARGE           ASM_CONST(0x0000000000000004)
70191 @@ -180,6 +180,7 @@ extern int mmu_vmalloc_psize;
70192  extern int mmu_io_psize;
70193  extern int mmu_kernel_ssize;
70194  extern int mmu_highuser_ssize;
70195 +extern u16 mmu_slb_size;
70196  
70197  /*
70198   * If the processor supports 64k normal pages but not 64k cache
70199 @@ -277,6 +278,7 @@ extern int hash_huge_page(struct mm_stru
70200  extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
70201                              unsigned long pstart, unsigned long mode,
70202                              int psize, int ssize);
70203 +extern void set_huge_psize(int psize);
70204  
70205  extern void htab_initialize(void);
70206  extern void htab_initialize_secondary(void);
70207 Index: linux-2.6.24.7/include/asm-powerpc/mpc52xx.h
70208 ===================================================================
70209 --- linux-2.6.24.7.orig/include/asm-powerpc/mpc52xx.h
70210 +++ linux-2.6.24.7/include/asm-powerpc/mpc52xx.h
70211 @@ -248,8 +248,6 @@ struct mpc52xx_cdm {
70212  
70213  #ifndef __ASSEMBLY__
70214  
70215 -extern void __iomem * mpc52xx_find_and_map(const char *);
70216 -extern void __iomem * mpc52xx_find_and_map_path(const char *path);
70217  extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node);
70218  extern void mpc5200_setup_xlb_arbiter(void);
70219  extern void mpc52xx_declare_of_platform_devices(void);
70220 @@ -257,7 +255,12 @@ extern void mpc52xx_declare_of_platform_
70221  extern void mpc52xx_init_irq(void);
70222  extern unsigned int mpc52xx_get_irq(void);
70223  
70224 +#ifdef CONFIG_PCI
70225  extern int __init mpc52xx_add_bridge(struct device_node *node);
70226 +extern void __init mpc52xx_setup_pci(void);
70227 +#else
70228 +static inline void mpc52xx_setup_pci(void) { }
70229 +#endif
70230  
70231  extern void __init mpc52xx_map_wdt(void);
70232  extern void mpc52xx_restart(char *cmd);
70233 Index: linux-2.6.24.7/include/asm-powerpc/mpc52xx_psc.h
70234 ===================================================================
70235 --- linux-2.6.24.7.orig/include/asm-powerpc/mpc52xx_psc.h
70236 +++ linux-2.6.24.7/include/asm-powerpc/mpc52xx_psc.h
70237 @@ -153,6 +153,9 @@ struct mpc52xx_psc {
70238         u8              reserved16[3];
70239         u8              irfdr;          /* PSC + 0x54 */
70240         u8              reserved17[3];
70241 +};
70242 +
70243 +struct mpc52xx_psc_fifo {
70244         u16             rfnum;          /* PSC + 0x58 */
70245         u16             reserved18;
70246         u16             tfnum;          /* PSC + 0x5c */
70247 Index: linux-2.6.24.7/include/asm-powerpc/mpc8260.h
70248 ===================================================================
70249 --- linux-2.6.24.7.orig/include/asm-powerpc/mpc8260.h
70250 +++ linux-2.6.24.7/include/asm-powerpc/mpc8260.h
70251 @@ -8,6 +8,7 @@
70252  #ifndef __ASM_POWERPC_MPC8260_H__
70253  #define __ASM_POWERPC_MPC8260_H__
70254  
70255 +#define MPC82XX_BCR_PLDP 0x00800000 /* Pipeline Maximum Depth */
70256  
70257  #ifdef CONFIG_8260
70258  
70259 Index: linux-2.6.24.7/include/asm-powerpc/mpic.h
70260 ===================================================================
70261 --- linux-2.6.24.7.orig/include/asm-powerpc/mpic.h
70262 +++ linux-2.6.24.7/include/asm-powerpc/mpic.h
70263 @@ -22,7 +22,9 @@
70264  #define MPIC_GREG_GLOBAL_CONF_0                0x00020
70265  #define                MPIC_GREG_GCONF_RESET                   0x80000000
70266  #define                MPIC_GREG_GCONF_8259_PTHROU_DIS         0x20000000
70267 +#define                MPIC_GREG_GCONF_NO_BIAS                 0x10000000
70268  #define                MPIC_GREG_GCONF_BASE_MASK               0x000fffff
70269 +#define                MPIC_GREG_GCONF_MCK                     0x08000000
70270  #define MPIC_GREG_GLOBAL_CONF_1                0x00030
70271  #define                MPIC_GREG_GLOBAL_CONF_1_SIE             0x08000000
70272  #define                MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK  0x70000000
70273 @@ -78,6 +80,7 @@
70274  #define        MPIC_CPU_WHOAMI_MASK                    0x0000001f
70275  #define MPIC_CPU_INTACK                        0x000a0
70276  #define MPIC_CPU_EOI                   0x000b0
70277 +#define MPIC_CPU_MCACK                 0x000c0
70278  
70279  /*
70280   * Per-source registers
70281 @@ -141,6 +144,7 @@
70282  #define TSI108_CPU_WHOAMI              0xffffffff
70283  #define TSI108_CPU_INTACK              0x00004
70284  #define TSI108_CPU_EOI                 0x00008
70285 +#define TSI108_CPU_MCACK               0x00004 /* Doesn't really exist here */
70286  
70287  /*
70288   * Per-source registers
70289 @@ -183,6 +187,7 @@ enum {
70290         MPIC_IDX_CPU_WHOAMI,
70291         MPIC_IDX_CPU_INTACK,
70292         MPIC_IDX_CPU_EOI,
70293 +       MPIC_IDX_CPU_MCACK,
70294  
70295         MPIC_IDX_IRQ_BASE,
70296         MPIC_IDX_IRQ_STRIDE,
70297 @@ -344,6 +349,10 @@ struct mpic
70298  #define MPIC_USES_DCR                  0x00000080
70299  /* MPIC has 11-bit vector fields (or larger) */
70300  #define MPIC_LARGE_VECTORS             0x00000100
70301 +/* Enable delivery of prio 15 interrupts as MCK instead of EE */
70302 +#define MPIC_ENABLE_MCK                        0x00000200
70303 +/* Disable bias among target selection, spread interrupts evenly */
70304 +#define MPIC_NO_BIAS                   0x00000400
70305  
70306  /* MPIC HW modification ID */
70307  #define MPIC_REGSET_MASK               0xf0000000
70308 @@ -447,10 +456,19 @@ extern void mpic_send_ipi(unsigned int i
70309  /* Send a message (IPI) to a given target (cpu number or MSG_*) */
70310  void smp_mpic_message_pass(int target, int msg);
70311  
70312 +/* Unmask a specific virq */
70313 +extern void mpic_unmask_irq(unsigned int irq);
70314 +/* Mask a specific virq */
70315 +extern void mpic_mask_irq(unsigned int irq);
70316 +/* EOI a specific virq */
70317 +extern void mpic_end_irq(unsigned int irq);
70318 +
70319  /* Fetch interrupt from a given mpic */
70320  extern unsigned int mpic_get_one_irq(struct mpic *mpic);
70321 -/* This one gets to the primary mpic */
70322 +/* This one gets from the primary mpic */
70323  extern unsigned int mpic_get_irq(void);
70324 +/* Fetch Machine Check interrupt from primary mpic */
70325 +extern unsigned int mpic_get_mcirq(void);
70326  
70327  /* Set the EPIC clock ratio */
70328  void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio);
70329 Index: linux-2.6.24.7/include/asm-powerpc/nvram.h
70330 ===================================================================
70331 --- linux-2.6.24.7.orig/include/asm-powerpc/nvram.h
70332 +++ linux-2.6.24.7/include/asm-powerpc/nvram.h
70333 @@ -10,6 +10,8 @@
70334  #ifndef _ASM_POWERPC_NVRAM_H
70335  #define _ASM_POWERPC_NVRAM_H
70336  
70337 +#include <linux/errno.h>
70338 +
70339  #define NVRW_CNT 0x20
70340  #define NVRAM_HEADER_LEN 16 /* sizeof(struct nvram_header) */
70341  #define NVRAM_BLOCK_LEN 16
70342 @@ -71,7 +73,16 @@ extern int nvram_clear_error_log(void);
70343  extern struct nvram_partition *nvram_find_partition(int sig, const char *name);
70344  
70345  extern int pSeries_nvram_init(void);
70346 +
70347 +#ifdef CONFIG_MMIO_NVRAM
70348  extern int mmio_nvram_init(void);
70349 +#else
70350 +static inline int mmio_nvram_init(void)
70351 +{
70352 +       return -ENODEV;
70353 +}
70354 +#endif
70355 +
70356  #endif /* __KERNEL__ */
70357  
70358  /* PowerMac specific nvram stuffs */
70359 Index: linux-2.6.24.7/include/asm-powerpc/of_platform.h
70360 ===================================================================
70361 --- linux-2.6.24.7.orig/include/asm-powerpc/of_platform.h
70362 +++ linux-2.6.24.7/include/asm-powerpc/of_platform.h
70363 @@ -15,8 +15,14 @@
70364  #include <linux/of_platform.h>
70365  
70366  /* Platform drivers register/unregister */
70367 -extern int of_register_platform_driver(struct of_platform_driver *drv);
70368 -extern void of_unregister_platform_driver(struct of_platform_driver *drv);
70369 +static inline int of_register_platform_driver(struct of_platform_driver *drv)
70370 +{
70371 +       return of_register_driver(drv, &of_platform_bus_type);
70372 +}
70373 +static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
70374 +{
70375 +       of_unregister_driver(drv);
70376 +}
70377  
70378  /* Platform devices and busses creation */
70379  extern struct of_device *of_platform_device_create(struct device_node *np,
70380 @@ -26,9 +32,11 @@ extern struct of_device *of_platform_dev
70381  #define OF_NO_DEEP_PROBE ((struct of_device_id *)-1)
70382  
70383  extern int of_platform_bus_probe(struct device_node *root,
70384 -                                struct of_device_id *matches,
70385 +                                const struct of_device_id *matches,
70386                                  struct device *parent);
70387  
70388  extern struct of_device *of_find_device_by_phandle(phandle ph);
70389  
70390 +extern void of_instantiate_rtc(void);
70391 +
70392  #endif /* _ASM_POWERPC_OF_PLATFORM_H */
70393 Index: linux-2.6.24.7/include/asm-powerpc/pci-bridge.h
70394 ===================================================================
70395 --- linux-2.6.24.7.orig/include/asm-powerpc/pci-bridge.h
70396 +++ linux-2.6.24.7/include/asm-powerpc/pci-bridge.h
70397 @@ -1,15 +1,42 @@
70398  #ifndef _ASM_POWERPC_PCI_BRIDGE_H
70399  #define _ASM_POWERPC_PCI_BRIDGE_H
70400  #ifdef __KERNEL__
70401 -
70402 +/*
70403 + * This program is free software; you can redistribute it and/or
70404 + * modify it under the terms of the GNU General Public License
70405 + * as published by the Free Software Foundation; either version
70406 + * 2 of the License, or (at your option) any later version.
70407 + */
70408  #include <linux/pci.h>
70409  #include <linux/list.h>
70410  #include <linux/ioport.h>
70411  
70412 -#ifndef CONFIG_PPC64
70413 -
70414  struct device_node;
70415 -struct pci_controller;
70416 +
70417 +extern unsigned int ppc_pci_flags;
70418 +enum {
70419 +       /* Force re-assigning all resources (ignore firmware
70420 +        * setup completely)
70421 +        */
70422 +       PPC_PCI_REASSIGN_ALL_RSRC       = 0x00000001,
70423 +
70424 +       /* Re-assign all bus numbers */
70425 +       PPC_PCI_REASSIGN_ALL_BUS        = 0x00000002,
70426 +
70427 +       /* Do not try to assign, just use existing setup */
70428 +       PPC_PCI_PROBE_ONLY              = 0x00000004,
70429 +
70430 +       /* Don't bother with ISA alignment unless the bridge has
70431 +        * ISA forwarding enabled
70432 +        */
70433 +       PPC_PCI_CAN_SKIP_ISA_ALIGN      = 0x00000008,
70434 +
70435 +       /* Enable domain numbers in /proc */
70436 +       PPC_PCI_ENABLE_PROC_DOMAINS     = 0x00000010,
70437 +       /* ... except for domain 0 */
70438 +       PPC_PCI_COMPAT_DOMAIN_0         = 0x00000020,
70439 +};
70440 +
70441  
70442  /*
70443   * Structure of a PCI controller (host bridge)
70444 @@ -17,26 +44,41 @@ struct pci_controller;
70445  struct pci_controller {
70446         struct pci_bus *bus;
70447         char is_dynamic;
70448 -       void *arch_data;
70449 +#ifdef CONFIG_PPC64
70450 +       int node;
70451 +#endif
70452 +       struct device_node *dn;
70453         struct list_head list_node;
70454         struct device *parent;
70455  
70456         int first_busno;
70457         int last_busno;
70458 +#ifndef CONFIG_PPC64
70459         int self_busno;
70460 +#endif
70461  
70462         void __iomem *io_base_virt;
70463 +#ifdef CONFIG_PPC64
70464 +       void *io_base_alloc;
70465 +#endif
70466         resource_size_t io_base_phys;
70467 +#ifndef CONFIG_PPC64
70468 +       resource_size_t pci_io_size;
70469 +#endif
70470  
70471         /* Some machines (PReP) have a non 1:1 mapping of
70472          * the PCI memory space in the CPU bus space
70473          */
70474         resource_size_t pci_mem_offset;
70475 +#ifdef CONFIG_PPC64
70476 +       unsigned long pci_io_size;
70477 +#endif
70478  
70479         struct pci_ops *ops;
70480 -       volatile unsigned int __iomem *cfg_addr;
70481 -       volatile void __iomem *cfg_data;
70482 +       unsigned int __iomem *cfg_addr;
70483 +       void __iomem *cfg_data;
70484  
70485 +#ifndef CONFIG_PPC64
70486         /*
70487          * Used for variants of PCI indirect handling and possible quirks:
70488          *  SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1
70489 @@ -51,21 +93,30 @@ struct pci_controller {
70490          *   set.
70491          *  BIG_ENDIAN - cfg_addr is a big endian register
70492          */
70493 -#define PPC_INDIRECT_TYPE_SET_CFG_TYPE         (0x00000001)
70494 -#define PPC_INDIRECT_TYPE_EXT_REG              (0x00000002)
70495 -#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004)
70496 -#define PPC_INDIRECT_TYPE_NO_PCIE_LINK         (0x00000008)
70497 -#define PPC_INDIRECT_TYPE_BIG_ENDIAN           (0x00000010)
70498 +#define PPC_INDIRECT_TYPE_SET_CFG_TYPE         0x00000001
70499 +#define PPC_INDIRECT_TYPE_EXT_REG              0x00000002
70500 +#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS 0x00000004
70501 +#define PPC_INDIRECT_TYPE_NO_PCIE_LINK         0x00000008
70502 +#define PPC_INDIRECT_TYPE_BIG_ENDIAN           0x00000010
70503         u32 indirect_type;
70504 -
70505 +#endif /* !CONFIG_PPC64 */
70506         /* Currently, we limit ourselves to 1 IO range and 3 mem
70507          * ranges since the common pci_bus structure can't handle more
70508          */
70509         struct resource io_resource;
70510         struct resource mem_resources[3];
70511         int global_number;              /* PCI domain number */
70512 +#ifdef CONFIG_PPC64
70513 +       unsigned long buid;
70514 +       unsigned long dma_window_base_cur;
70515 +       unsigned long dma_window_size;
70516 +
70517 +       void *private_data;
70518 +#endif /* CONFIG_PPC64 */
70519  };
70520  
70521 +#ifndef CONFIG_PPC64
70522 +
70523  static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
70524  {
70525         return bus->sysdata;
70526 @@ -81,18 +132,18 @@ static inline int isa_vaddr_is_ioport(vo
70527  
70528  /* These are used for config access before all the PCI probing
70529     has been done. */
70530 -int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
70531 -                          int where, u8 *val);
70532 -int early_read_config_word(struct pci_controller *hose, int bus, int dev_fn,
70533 -                          int where, u16 *val);
70534 -int early_read_config_dword(struct pci_controller *hose, int bus, int dev_fn,
70535 -                           int where, u32 *val);
70536 -int early_write_config_byte(struct pci_controller *hose, int bus, int dev_fn,
70537 -                           int where, u8 val);
70538 -int early_write_config_word(struct pci_controller *hose, int bus, int dev_fn,
70539 -                           int where, u16 val);
70540 -int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
70541 -                            int where, u32 val);
70542 +extern int early_read_config_byte(struct pci_controller *hose, int bus,
70543 +                       int dev_fn, int where, u8 *val);
70544 +extern int early_read_config_word(struct pci_controller *hose, int bus,
70545 +                       int dev_fn, int where, u16 *val);
70546 +extern int early_read_config_dword(struct pci_controller *hose, int bus,
70547 +                       int dev_fn, int where, u32 *val);
70548 +extern int early_write_config_byte(struct pci_controller *hose, int bus,
70549 +                       int dev_fn, int where, u8 val);
70550 +extern int early_write_config_word(struct pci_controller *hose, int bus,
70551 +                       int dev_fn, int where, u16 val);
70552 +extern int early_write_config_dword(struct pci_controller *hose, int bus,
70553 +                       int dev_fn, int where, u32 val);
70554  
70555  extern int early_find_capability(struct pci_controller *hose, int bus,
70556                                  int dev_fn, int cap);
70557 @@ -101,87 +152,33 @@ extern void setup_indirect_pci(struct pc
70558                                resource_size_t cfg_addr,
70559                                resource_size_t cfg_data, u32 flags);
70560  extern void setup_grackle(struct pci_controller *hose);
70561 -extern void __init update_bridge_resource(struct pci_dev *dev,
70562 -                                         struct resource *res);
70563 -
70564 -#else
70565 -
70566 -
70567 -/*
70568 - * This program is free software; you can redistribute it and/or
70569 - * modify it under the terms of the GNU General Public License
70570 - * as published by the Free Software Foundation; either version
70571 - * 2 of the License, or (at your option) any later version.
70572 - */
70573 -
70574 -/*
70575 - * Structure of a PCI controller (host bridge)
70576 - */
70577 -struct pci_controller {
70578 -       struct pci_bus *bus;
70579 -       char is_dynamic;
70580 -       int node;
70581 -       void *arch_data;
70582 -       struct list_head list_node;
70583 -       struct device *parent;
70584 -
70585 -       int first_busno;
70586 -       int last_busno;
70587 -
70588 -       void __iomem *io_base_virt;
70589 -       void *io_base_alloc;
70590 -       resource_size_t io_base_phys;
70591 -
70592 -       /* Some machines have a non 1:1 mapping of
70593 -        * the PCI memory space in the CPU bus space
70594 -        */
70595 -       resource_size_t pci_mem_offset;
70596 -       unsigned long pci_io_size;
70597 -
70598 -       struct pci_ops *ops;
70599 -       volatile unsigned int __iomem *cfg_addr;
70600 -       volatile void __iomem *cfg_data;
70601 -
70602 -       /* Currently, we limit ourselves to 1 IO range and 3 mem
70603 -        * ranges since the common pci_bus structure can't handle more
70604 -        */
70605 -       struct resource io_resource;
70606 -       struct resource mem_resources[3];
70607 -       int global_number;
70608 -       unsigned long buid;
70609 -       unsigned long dma_window_base_cur;
70610 -       unsigned long dma_window_size;
70611 -
70612 -       void *private_data;
70613 -};
70614 +#else  /* CONFIG_PPC64 */
70615  
70616  /*
70617   * PCI stuff, for nodes representing PCI devices, pointed to
70618   * by device_node->data.
70619   */
70620 -struct pci_controller;
70621  struct iommu_table;
70622  
70623  struct pci_dn {
70624         int     busno;                  /* pci bus number */
70625 -       int     bussubno;               /* pci subordinate bus number */
70626         int     devfn;                  /* pci device and function number */
70627 -       int     class_code;             /* pci device class */
70628  
70629         struct  pci_controller *phb;    /* for pci devices */
70630         struct  iommu_table *iommu_table;       /* for phb's or bridges */
70631 -       struct  pci_dev *pcidev;        /* back-pointer to the pci device */
70632         struct  device_node *node;      /* back-pointer to the device_node */
70633  
70634         int     pci_ext_config_space;   /* for pci devices */
70635  
70636  #ifdef CONFIG_EEH
70637 +       struct  pci_dev *pcidev;        /* back-pointer to the pci device */
70638 +       int     class_code;             /* pci device class */
70639         int     eeh_mode;               /* See eeh.h for possible EEH_MODEs */
70640         int     eeh_config_addr;
70641         int     eeh_pe_config_addr; /* new-style partition endpoint address */
70642 -       int     eeh_check_count;        /* # times driver ignored error */
70643 -       int     eeh_freeze_count;       /* # times this device froze up. */
70644 -       int     eeh_false_positives;    /* # times this device reported #ff's */
70645 +       int     eeh_check_count;        /* # times driver ignored error */
70646 +       int     eeh_freeze_count;       /* # times this device froze up. */
70647 +       int     eeh_false_positives;    /* # times this device reported #ff's */
70648         u32     config_space[16];       /* saved PCI config space */
70649  #endif
70650  };
70651 @@ -189,7 +186,7 @@ struct pci_dn {
70652  /* Get the pointer to a device_node's pci_dn */
70653  #define PCI_DN(dn)     ((struct pci_dn *) (dn)->data)
70654  
70655 -struct device_node *fetch_dev_dn(struct pci_dev *dev);
70656 +extern struct device_node *fetch_dev_dn(struct pci_dev *dev);
70657  
70658  /* Get a device_node from a pci_dev.  This code must be fast except
70659   * in the case where the sysdata is incorrect and needs to be fixed
70660 @@ -227,14 +224,14 @@ static inline struct device_node *pci_bu
70661  }
70662  
70663  /** Find the bus corresponding to the indicated device node */
70664 -struct pci_bus * pcibios_find_pci_bus(struct device_node *dn);
70665 +extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn);
70666  
70667  /** Remove all of the PCI devices under this bus */
70668 -void pcibios_remove_pci_devices(struct pci_bus *bus);
70669 +extern void pcibios_remove_pci_devices(struct pci_bus *bus);
70670  
70671  /** Discover new pci devices under this bus, and add them */
70672 -void pcibios_add_pci_devices(struct pci_bus * bus);
70673 -void pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus);
70674 +extern void pcibios_add_pci_devices(struct pci_bus *bus);
70675 +extern void pcibios_fixup_new_pci_devices(struct pci_bus *bus);
70676  
70677  extern int pcibios_remove_root_bus(struct pci_controller *phb);
70678  
70679 @@ -270,20 +267,18 @@ extern int pcibios_map_io_space(struct p
70680  #define PHB_SET_NODE(PHB, NODE)                ((PHB)->node = -1)
70681  #endif
70682  
70683 -#endif /* CONFIG_PPC64 */
70684 +#endif /* CONFIG_PPC64 */
70685  
70686  /* Get the PCI host controller for an OF device */
70687 -extern struct pci_controller*
70688 -pci_find_hose_for_OF_device(struct device_node* node);
70689 +extern struct pci_controller *pci_find_hose_for_OF_device(
70690 +                       struct device_node* node);
70691  
70692  /* Fill up host controller resources from the OF node */
70693 -extern void
70694 -pci_process_bridge_OF_ranges(struct pci_controller *hose,
70695 -                          struct device_node *dev, int primary);
70696 +extern void pci_process_bridge_OF_ranges(struct pci_controller *hose,
70697 +                       struct device_node *dev, int primary);
70698  
70699  /* Allocate & free a PCI host bridge structure */
70700 -extern struct pci_controller *
70701 -pcibios_alloc_controller(struct device_node *dev);
70702 +extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev);
70703  extern void pcibios_free_controller(struct pci_controller *phb);
70704  
70705  #ifdef CONFIG_PCI
70706 @@ -298,9 +293,7 @@ static inline int pcibios_vaddr_is_iopor
70707  {
70708         return 0;
70709  }
70710 -#endif
70711 -
70712 +#endif /* CONFIG_PCI */
70713  
70714 -
70715 -#endif /* __KERNEL__ */
70716 -#endif
70717 +#endif /* __KERNEL__ */
70718 +#endif /* _ASM_POWERPC_PCI_BRIDGE_H */
70719 Index: linux-2.6.24.7/include/asm-powerpc/pci.h
70720 ===================================================================
70721 --- linux-2.6.24.7.orig/include/asm-powerpc/pci.h
70722 +++ linux-2.6.24.7/include/asm-powerpc/pci.h
70723 @@ -36,11 +36,10 @@ struct pci_dev;
70724  
70725  /*
70726   * Set this to 1 if you want the kernel to re-assign all PCI
70727 - * bus numbers
70728 + * bus numbers (don't do that on ppc64 yet !)
70729   */
70730 -extern int pci_assign_all_buses;
70731 -#define pcibios_assign_all_busses()    (pci_assign_all_buses)
70732 -
70733 +#define pcibios_assign_all_busses()            (ppc_pci_flags & \
70734 +                                        PPC_PCI_REASSIGN_ALL_BUS)
70735  #define pcibios_scan_all_fns(a, b)     0
70736  
70737  static inline void pcibios_set_master(struct pci_dev *dev)
70738 @@ -95,9 +94,6 @@ static inline void pci_dma_burst_advice(
70739  #define get_pci_dma_ops()      NULL
70740  #endif
70741  
70742 -/* Decide whether to display the domain number in /proc */
70743 -extern int pci_proc_domain(struct pci_bus *bus);
70744 -
70745  #else /* 32-bit */
70746  
70747  #ifdef CONFIG_PCI
70748 @@ -109,17 +105,14 @@ static inline void pci_dma_burst_advice(
70749         *strategy_parameter = ~0UL;
70750  }
70751  #endif
70752 -
70753 -/* Set the name of the bus as it appears in /proc/bus/pci */
70754 -static inline int pci_proc_domain(struct pci_bus *bus)
70755 -{
70756 -       return 0;
70757 -}
70758 -
70759  #endif /* CONFIG_PPC64 */
70760  
70761  extern int pci_domain_nr(struct pci_bus *bus);
70762  
70763 +/* Decide whether to display the domain number in /proc */
70764 +extern int pci_proc_domain(struct pci_bus *bus);
70765 +
70766 +
70767  struct vm_area_struct;
70768  /* Map a range of PCI memory or I/O space for a device into user space */
70769  int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
70770 @@ -199,13 +192,12 @@ static inline struct resource *pcibios_s
70771         return root;
70772  }
70773  
70774 -extern void pcibios_fixup_device_resources(struct pci_dev *dev,
70775 -                       struct pci_bus *bus);
70776 -
70777  extern void pcibios_setup_new_device(struct pci_dev *dev);
70778  
70779  extern void pcibios_claim_one_bus(struct pci_bus *b);
70780  
70781 +extern void pcibios_resource_survey(void);
70782 +
70783  extern struct pci_controller *init_phb_dynamic(struct device_node *dn);
70784  
70785  extern struct pci_dev *of_create_pci_dev(struct device_node *node,
70786 @@ -229,5 +221,8 @@ extern void pci_resource_to_user(const s
70787                                  const struct resource *rsrc,
70788                                  resource_size_t *start, resource_size_t *end);
70789  
70790 +extern void pcibios_do_bus_setup(struct pci_bus *bus);
70791 +extern void pcibios_fixup_of_probed_bus(struct pci_bus *bus);
70792 +
70793  #endif /* __KERNEL__ */
70794  #endif /* __ASM_POWERPC_PCI_H */
70795 Index: linux-2.6.24.7/include/asm-powerpc/ppc-pci.h
70796 ===================================================================
70797 --- linux-2.6.24.7.orig/include/asm-powerpc/ppc-pci.h
70798 +++ linux-2.6.24.7/include/asm-powerpc/ppc-pci.h
70799 @@ -22,7 +22,6 @@ extern void pci_setup_phb_io_dynamic(str
70800  
70801  
70802  extern struct list_head hose_list;
70803 -extern int global_phb_number;
70804  
70805  extern void find_and_init_phbs(void);
70806  
70807 @@ -47,9 +46,6 @@ extern void init_pci_config_tokens (void
70808  extern unsigned long get_phb_buid (struct device_node *);
70809  extern int rtas_setup_phb(struct pci_controller *phb);
70810  
70811 -/* From iSeries PCI */
70812 -extern void iSeries_pcibios_init(void);
70813 -
70814  extern unsigned long pci_probe_only;
70815  
70816  /* ---- EEH internal-use-only related routines ---- */
70817 Index: linux-2.6.24.7/include/asm-powerpc/prom.h
70818 ===================================================================
70819 --- linux-2.6.24.7.orig/include/asm-powerpc/prom.h
70820 +++ linux-2.6.24.7/include/asm-powerpc/prom.h
70821 @@ -202,6 +202,10 @@ static inline unsigned long of_read_ulon
70822   */
70823  extern u64 of_translate_address(struct device_node *np, const u32 *addr);
70824  
70825 +/* Translate a DMA address from device space to CPU space */
70826 +extern u64 of_translate_dma_address(struct device_node *dev,
70827 +                                   const u32 *in_addr);
70828 +
70829  /* Extract an address from a device, returns the region size and
70830   * the address space flags too. The PCI version uses a BAR number
70831   * instead of an absolute index
70832 Index: linux-2.6.24.7/include/asm-powerpc/ps3.h
70833 ===================================================================
70834 --- linux-2.6.24.7.orig/include/asm-powerpc/ps3.h
70835 +++ linux-2.6.24.7/include/asm-powerpc/ps3.h
70836 @@ -24,6 +24,7 @@
70837  #include <linux/init.h>
70838  #include <linux/types.h>
70839  #include <linux/device.h>
70840 +#include "cell-pmu.h"
70841  
70842  union ps3_firmware_version {
70843         u64 raw;
70844 @@ -317,6 +318,7 @@ enum ps3_match_id {
70845         PS3_MATCH_ID_STOR_FLASH     = 8,
70846         PS3_MATCH_ID_SOUND          = 9,
70847         PS3_MATCH_ID_GRAPHICS       = 10,
70848 +       PS3_MATCH_ID_LPM            = 11,
70849  };
70850  
70851  #define PS3_MODULE_ALIAS_EHCI           "ps3:1"
70852 @@ -329,11 +331,13 @@ enum ps3_match_id {
70853  #define PS3_MODULE_ALIAS_STOR_FLASH     "ps3:8"
70854  #define PS3_MODULE_ALIAS_SOUND          "ps3:9"
70855  #define PS3_MODULE_ALIAS_GRAPHICS       "ps3:10"
70856 +#define PS3_MODULE_ALIAS_LPM            "ps3:11"
70857  
70858  enum ps3_system_bus_device_type {
70859         PS3_DEVICE_TYPE_IOC0 = 1,
70860         PS3_DEVICE_TYPE_SB,
70861         PS3_DEVICE_TYPE_VUART,
70862 +       PS3_DEVICE_TYPE_LPM,
70863  };
70864  
70865  /**
70866 @@ -344,12 +348,17 @@ struct ps3_system_bus_device {
70867         enum ps3_match_id match_id;
70868         enum ps3_system_bus_device_type dev_type;
70869  
70870 -       unsigned int bus_id;              /* SB */
70871 -       unsigned int dev_id;              /* SB */
70872 +       u64 bus_id;                       /* SB */
70873 +       u64 dev_id;                       /* SB */
70874         unsigned int interrupt_id;        /* SB */
70875         struct ps3_dma_region *d_region;  /* SB, IOC0 */
70876         struct ps3_mmio_region *m_region; /* SB, IOC0*/
70877         unsigned int port_number;         /* VUART */
70878 +       struct {                          /* LPM */
70879 +               u64 node_id;
70880 +               u64 pu_id;
70881 +               u64 rights;
70882 +       } lpm;
70883  
70884  /*     struct iommu_table *iommu_table; -- waiting for BenH's cleanups */
70885         struct device core;
70886 @@ -438,5 +447,66 @@ struct ps3_prealloc {
70887  extern struct ps3_prealloc ps3fb_videomemory;
70888  extern struct ps3_prealloc ps3flash_bounce_buffer;
70889  
70890 +/* logical performance monitor */
70891 +
70892 +/**
70893 + * enum ps3_lpm_rights - Rigths granted by the system policy module.
70894 + *
70895 + * @PS3_LPM_RIGHTS_USE_LPM: The right to use the lpm.
70896 + * @PS3_LPM_RIGHTS_USE_TB: The right to use the internal trace buffer.
70897 + */
70898 +
70899 +enum ps3_lpm_rights {
70900 +       PS3_LPM_RIGHTS_USE_LPM = 0x001,
70901 +       PS3_LPM_RIGHTS_USE_TB = 0x100,
70902 +};
70903 +
70904 +/**
70905 + * enum ps3_lpm_tb_type - Type of trace buffer lv1 should use.
70906 + *
70907 + * @PS3_LPM_TB_TYPE_NONE: Do not use a trace buffer.
70908 + * @PS3_LPM_RIGHTS_USE_TB: Use the lv1 internal trace buffer.  Must have
70909 + *  rights @PS3_LPM_RIGHTS_USE_TB.
70910 + */
70911 +
70912 +enum ps3_lpm_tb_type {
70913 +       PS3_LPM_TB_TYPE_NONE = 0,
70914 +       PS3_LPM_TB_TYPE_INTERNAL = 1,
70915 +};
70916 +
70917 +int ps3_lpm_open(enum ps3_lpm_tb_type tb_type, void *tb_cache,
70918 +       u64 tb_cache_size);
70919 +int ps3_lpm_close(void);
70920 +int ps3_lpm_copy_tb(unsigned long offset, void *buf, unsigned long count,
70921 +       unsigned long *bytes_copied);
70922 +int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf,
70923 +       unsigned long count, unsigned long *bytes_copied);
70924 +void ps3_set_bookmark(u64 bookmark);
70925 +void ps3_set_pm_bookmark(u64 tag, u64 incident, u64 th_id);
70926 +int ps3_set_signal(u64 rtas_signal_group, u8 signal_bit, u16 sub_unit,
70927 +       u8 bus_word);
70928 +
70929 +u32 ps3_read_phys_ctr(u32 cpu, u32 phys_ctr);
70930 +void ps3_write_phys_ctr(u32 cpu, u32 phys_ctr, u32 val);
70931 +u32 ps3_read_ctr(u32 cpu, u32 ctr);
70932 +void ps3_write_ctr(u32 cpu, u32 ctr, u32 val);
70933 +
70934 +u32 ps3_read_pm07_control(u32 cpu, u32 ctr);
70935 +void ps3_write_pm07_control(u32 cpu, u32 ctr, u32 val);
70936 +u32 ps3_read_pm(u32 cpu, enum pm_reg_name reg);
70937 +void ps3_write_pm(u32 cpu, enum pm_reg_name reg, u32 val);
70938 +
70939 +u32 ps3_get_ctr_size(u32 cpu, u32 phys_ctr);
70940 +void ps3_set_ctr_size(u32 cpu, u32 phys_ctr, u32 ctr_size);
70941 +
70942 +void ps3_enable_pm(u32 cpu);
70943 +void ps3_disable_pm(u32 cpu);
70944 +void ps3_enable_pm_interrupts(u32 cpu, u32 thread, u32 mask);
70945 +void ps3_disable_pm_interrupts(u32 cpu);
70946 +
70947 +u32 ps3_get_and_clear_pm_interrupts(u32 cpu);
70948 +void ps3_sync_irq(int node);
70949 +u32 ps3_get_hw_thread_id(int cpu);
70950 +u64 ps3_get_spe_id(void *arg);
70951  
70952  #endif
70953 Index: linux-2.6.24.7/include/asm-powerpc/ptrace.h
70954 ===================================================================
70955 --- linux-2.6.24.7.orig/include/asm-powerpc/ptrace.h
70956 +++ linux-2.6.24.7/include/asm-powerpc/ptrace.h
70957 @@ -106,7 +106,8 @@ extern int ptrace_put_reg(struct task_st
70958   */
70959  #define FULL_REGS(regs)                (((regs)->trap & 1) == 0)
70960  #ifndef __powerpc64__
70961 -#define IS_CRITICAL_EXC(regs)  (((regs)->trap & 2) == 0)
70962 +#define IS_CRITICAL_EXC(regs)  (((regs)->trap & 2) != 0)
70963 +#define IS_MCHECK_EXC(regs)    (((regs)->trap & 4) != 0)
70964  #endif /* ! __powerpc64__ */
70965  #define TRAP(regs)             ((regs)->trap & ~0xF)
70966  #ifdef __powerpc64__
70967 Index: linux-2.6.24.7/include/asm-powerpc/qe.h
70968 ===================================================================
70969 --- linux-2.6.24.7.orig/include/asm-powerpc/qe.h
70970 +++ linux-2.6.24.7/include/asm-powerpc/qe.h
70971 @@ -28,6 +28,52 @@
70972  #define MEM_PART_SECONDARY     1
70973  #define MEM_PART_MURAM         2
70974  
70975 +/* Clocks and BRGs */
70976 +enum qe_clock {
70977 +       QE_CLK_NONE = 0,
70978 +       QE_BRG1,                /* Baud Rate Generator 1 */
70979 +       QE_BRG2,                /* Baud Rate Generator 2 */
70980 +       QE_BRG3,                /* Baud Rate Generator 3 */
70981 +       QE_BRG4,                /* Baud Rate Generator 4 */
70982 +       QE_BRG5,                /* Baud Rate Generator 5 */
70983 +       QE_BRG6,                /* Baud Rate Generator 6 */
70984 +       QE_BRG7,                /* Baud Rate Generator 7 */
70985 +       QE_BRG8,                /* Baud Rate Generator 8 */
70986 +       QE_BRG9,                /* Baud Rate Generator 9 */
70987 +       QE_BRG10,               /* Baud Rate Generator 10 */
70988 +       QE_BRG11,               /* Baud Rate Generator 11 */
70989 +       QE_BRG12,               /* Baud Rate Generator 12 */
70990 +       QE_BRG13,               /* Baud Rate Generator 13 */
70991 +       QE_BRG14,               /* Baud Rate Generator 14 */
70992 +       QE_BRG15,               /* Baud Rate Generator 15 */
70993 +       QE_BRG16,               /* Baud Rate Generator 16 */
70994 +       QE_CLK1,                /* Clock 1 */
70995 +       QE_CLK2,                /* Clock 2 */
70996 +       QE_CLK3,                /* Clock 3 */
70997 +       QE_CLK4,                /* Clock 4 */
70998 +       QE_CLK5,                /* Clock 5 */
70999 +       QE_CLK6,                /* Clock 6 */
71000 +       QE_CLK7,                /* Clock 7 */
71001 +       QE_CLK8,                /* Clock 8 */
71002 +       QE_CLK9,                /* Clock 9 */
71003 +       QE_CLK10,               /* Clock 10 */
71004 +       QE_CLK11,               /* Clock 11 */
71005 +       QE_CLK12,               /* Clock 12 */
71006 +       QE_CLK13,               /* Clock 13 */
71007 +       QE_CLK14,               /* Clock 14 */
71008 +       QE_CLK15,               /* Clock 15 */
71009 +       QE_CLK16,               /* Clock 16 */
71010 +       QE_CLK17,               /* Clock 17 */
71011 +       QE_CLK18,               /* Clock 18 */
71012 +       QE_CLK19,               /* Clock 19 */
71013 +       QE_CLK20,               /* Clock 20 */
71014 +       QE_CLK21,               /* Clock 21 */
71015 +       QE_CLK22,               /* Clock 22 */
71016 +       QE_CLK23,               /* Clock 23 */
71017 +       QE_CLK24,               /* Clock 24 */
71018 +       QE_CLK_DUMMY
71019 +};
71020 +
71021  /* Export QE common operations */
71022  extern void qe_reset(void);
71023  extern int par_io_init(struct device_node *np);
71024 @@ -38,7 +84,8 @@ extern int par_io_data_set(u8 port, u8 p
71025  
71026  /* QE internal API */
71027  int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
71028 -void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier);
71029 +enum qe_clock qe_clock_source(const char *source);
71030 +int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
71031  int qe_get_snum(void);
71032  void qe_put_snum(u8 snum);
71033  unsigned long qe_muram_alloc(int size, int align);
71034 @@ -47,6 +94,58 @@ unsigned long qe_muram_alloc_fixed(unsig
71035  void qe_muram_dump(void);
71036  void *qe_muram_addr(unsigned long offset);
71037  
71038 +/* Structure that defines QE firmware binary files.
71039 + *
71040 + * See Documentation/powerpc/qe-firmware.txt for a description of these
71041 + * fields.
71042 + */
71043 +struct qe_firmware {
71044 +       struct qe_header {
71045 +               __be32 length;  /* Length of the entire structure, in bytes */
71046 +               u8 magic[3];    /* Set to { 'Q', 'E', 'F' } */
71047 +               u8 version;     /* Version of this layout. First ver is '1' */
71048 +       } header;
71049 +       u8 id[62];      /* Null-terminated identifier string */
71050 +       u8 split;       /* 0 = shared I-RAM, 1 = split I-RAM */
71051 +       u8 count;       /* Number of microcode[] structures */
71052 +       struct {
71053 +               __be16 model;           /* The SOC model  */
71054 +               u8 major;               /* The SOC revision major */
71055 +               u8 minor;               /* The SOC revision minor */
71056 +       } __attribute__ ((packed)) soc;
71057 +       u8 padding[4];                  /* Reserved, for alignment */
71058 +       __be64 extended_modes;          /* Extended modes */
71059 +       __be32 vtraps[8];               /* Virtual trap addresses */
71060 +       u8 reserved[4];                 /* Reserved, for future expansion */
71061 +       struct qe_microcode {
71062 +               u8 id[32];              /* Null-terminated identifier */
71063 +               __be32 traps[16];       /* Trap addresses, 0 == ignore */
71064 +               __be32 eccr;            /* The value for the ECCR register */
71065 +               __be32 iram_offset;     /* Offset into I-RAM for the code */
71066 +               __be32 count;           /* Number of 32-bit words of the code */
71067 +               __be32 code_offset;     /* Offset of the actual microcode */
71068 +               u8 major;               /* The microcode version major */
71069 +               u8 minor;               /* The microcode version minor */
71070 +               u8 revision;            /* The microcode version revision */
71071 +               u8 padding;             /* Reserved, for alignment */
71072 +               u8 reserved[4];         /* Reserved, for future expansion */
71073 +       } __attribute__ ((packed)) microcode[1];
71074 +       /* All microcode binaries should be located here */
71075 +       /* CRC32 should be located here, after the microcode binaries */
71076 +} __attribute__ ((packed));
71077 +
71078 +struct qe_firmware_info {
71079 +       char id[64];            /* Firmware name */
71080 +       u32 vtraps[8];          /* Virtual trap addresses */
71081 +       u64 extended_modes;     /* Extended modes */
71082 +};
71083 +
71084 +/* Upload a firmware to the QE */
71085 +int qe_upload_firmware(const struct qe_firmware *firmware);
71086 +
71087 +/* Obtain information on the uploaded firmware */
71088 +struct qe_firmware_info *qe_get_firmware_info(void);
71089 +
71090  /* Buffer descriptors */
71091  struct qe_bd {
71092         __be16 status;
71093 @@ -129,52 +228,6 @@ enum comm_dir {
71094         COMM_DIR_RX_AND_TX = 3
71095  };
71096  
71097 -/* Clocks and BRGs */
71098 -enum qe_clock {
71099 -       QE_CLK_NONE = 0,
71100 -       QE_BRG1,                /* Baud Rate Generator 1 */
71101 -       QE_BRG2,                /* Baud Rate Generator 2 */
71102 -       QE_BRG3,                /* Baud Rate Generator 3 */
71103 -       QE_BRG4,                /* Baud Rate Generator 4 */
71104 -       QE_BRG5,                /* Baud Rate Generator 5 */
71105 -       QE_BRG6,                /* Baud Rate Generator 6 */
71106 -       QE_BRG7,                /* Baud Rate Generator 7 */
71107 -       QE_BRG8,                /* Baud Rate Generator 8 */
71108 -       QE_BRG9,                /* Baud Rate Generator 9 */
71109 -       QE_BRG10,               /* Baud Rate Generator 10 */
71110 -       QE_BRG11,               /* Baud Rate Generator 11 */
71111 -       QE_BRG12,               /* Baud Rate Generator 12 */
71112 -       QE_BRG13,               /* Baud Rate Generator 13 */
71113 -       QE_BRG14,               /* Baud Rate Generator 14 */
71114 -       QE_BRG15,               /* Baud Rate Generator 15 */
71115 -       QE_BRG16,               /* Baud Rate Generator 16 */
71116 -       QE_CLK1,                /* Clock 1 */
71117 -       QE_CLK2,                /* Clock 2 */
71118 -       QE_CLK3,                /* Clock 3 */
71119 -       QE_CLK4,                /* Clock 4 */
71120 -       QE_CLK5,                /* Clock 5 */
71121 -       QE_CLK6,                /* Clock 6 */
71122 -       QE_CLK7,                /* Clock 7 */
71123 -       QE_CLK8,                /* Clock 8 */
71124 -       QE_CLK9,                /* Clock 9 */
71125 -       QE_CLK10,               /* Clock 10 */
71126 -       QE_CLK11,               /* Clock 11 */
71127 -       QE_CLK12,               /* Clock 12 */
71128 -       QE_CLK13,               /* Clock 13 */
71129 -       QE_CLK14,               /* Clock 14 */
71130 -       QE_CLK15,               /* Clock 15 */
71131 -       QE_CLK16,               /* Clock 16 */
71132 -       QE_CLK17,               /* Clock 17 */
71133 -       QE_CLK18,               /* Clock 18 */
71134 -       QE_CLK19,               /* Clock 19 */
71135 -       QE_CLK20,               /* Clock 20 */
71136 -       QE_CLK21,               /* Clock 21 */
71137 -       QE_CLK22,               /* Clock 22 */
71138 -       QE_CLK23,               /* Clock 23 */
71139 -       QE_CLK24,               /* Clock 24 */
71140 -       QE_CLK_DUMMY,
71141 -};
71142 -
71143  /* QE CMXUCR Registers.
71144   * There are two UCCs represented in each of the four CMXUCR registers.
71145   * These values are for the UCC in the LSBs
71146 @@ -328,6 +381,15 @@ enum qe_clock {
71147  
71148  #define QE_SDEBCR_BA_MASK      0x01FFFFFF
71149  
71150 +/* Communication Processor */
71151 +#define QE_CP_CERCR_MEE                0x8000  /* Multi-user RAM ECC enable */
71152 +#define QE_CP_CERCR_IEE                0x4000  /* Instruction RAM ECC enable */
71153 +#define QE_CP_CERCR_CIR                0x0800  /* Common instruction RAM */
71154 +
71155 +/* I-RAM */
71156 +#define QE_IRAM_IADD_AIE       0x80000000      /* Auto Increment Enable */
71157 +#define QE_IRAM_IADD_BADDR     0x00080000      /* Base Address */
71158 +
71159  /* UPC */
71160  #define UPGCR_PROTOCOL 0x80000000      /* protocol ul2 or pl2 */
71161  #define UPGCR_TMS      0x40000000      /* Transmit master/slave mode */
71162 Index: linux-2.6.24.7/include/asm-powerpc/reg.h
71163 ===================================================================
71164 --- linux-2.6.24.7.orig/include/asm-powerpc/reg.h
71165 +++ linux-2.6.24.7/include/asm-powerpc/reg.h
71166 @@ -553,6 +553,7 @@
71167  #define SPRN_PA6T_BTCR 978     /* Breakpoint and Tagging Control Register */
71168  #define SPRN_PA6T_IMAAT        979     /* Instruction Match Array Action Table */
71169  #define SPRN_PA6T_PCCR 1019    /* Power Counter Control Register */
71170 +#define SPRN_BKMK      1020    /* Cell Bookmark Register */
71171  #define SPRN_PA6T_RPCCR        1021    /* Retire PC Trace Control Register */
71172  
71173  
71174 @@ -691,12 +692,6 @@
71175  #define PV_BE          0x0070
71176  #define PV_PA6T                0x0090
71177  
71178 -/*
71179 - * Number of entries in the SLB. If this ever changes we should handle
71180 - * it with a use a cpu feature fixup.
71181 - */
71182 -#define SLB_NUM_ENTRIES 64
71183 -
71184  /* Macros for setting and retrieving special purpose registers */
71185  #ifndef __ASSEMBLY__
71186  #define mfmsr()                ({unsigned long rval; \
71187 Index: linux-2.6.24.7/include/asm-powerpc/reg_booke.h
71188 ===================================================================
71189 --- linux-2.6.24.7.orig/include/asm-powerpc/reg_booke.h
71190 +++ linux-2.6.24.7/include/asm-powerpc/reg_booke.h
71191 @@ -123,16 +123,23 @@
71192  #define SPRN_SPEFSCR   0x200   /* SPE & Embedded FP Status & Control */
71193  #define SPRN_BBEAR     0x201   /* Branch Buffer Entry Address Register */
71194  #define SPRN_BBTAR     0x202   /* Branch Buffer Target Address Register */
71195 +#define SPRN_ATB       0x20E   /* Alternate Time Base */
71196 +#define SPRN_ATBL      0x20E   /* Alternate Time Base Lower */
71197 +#define SPRN_ATBU      0x20F   /* Alternate Time Base Upper */
71198  #define SPRN_IVOR32    0x210   /* Interrupt Vector Offset Register 32 */
71199  #define SPRN_IVOR33    0x211   /* Interrupt Vector Offset Register 33 */
71200  #define SPRN_IVOR34    0x212   /* Interrupt Vector Offset Register 34 */
71201  #define SPRN_IVOR35    0x213   /* Interrupt Vector Offset Register 35 */
71202 +#define SPRN_IVOR36    0x214   /* Interrupt Vector Offset Register 36 */
71203 +#define SPRN_IVOR37    0x215   /* Interrupt Vector Offset Register 37 */
71204  #define SPRN_MCSRR0    0x23A   /* Machine Check Save and Restore Register 0 */
71205  #define SPRN_MCSRR1    0x23B   /* Machine Check Save and Restore Register 1 */
71206  #define SPRN_MCSR      0x23C   /* Machine Check Status Register */
71207  #define SPRN_MCAR      0x23D   /* Machine Check Address Register */
71208  #define SPRN_DSRR0     0x23E   /* Debug Save and Restore Register 0 */
71209  #define SPRN_DSRR1     0x23F   /* Debug Save and Restore Register 1 */
71210 +#define SPRN_SPRG8     0x25C   /* Special Purpose Register General 8 */
71211 +#define SPRN_SPRG9     0x25D   /* Special Purpose Register General 9 */
71212  #define SPRN_MAS0      0x270   /* MMU Assist Register 0 */
71213  #define SPRN_MAS1      0x271   /* MMU Assist Register 1 */
71214  #define SPRN_MAS2      0x272   /* MMU Assist Register 2 */
71215 @@ -140,15 +147,18 @@
71216  #define SPRN_MAS4      0x274   /* MMU Assist Register 4 */
71217  #define SPRN_MAS5      0x275   /* MMU Assist Register 5 */
71218  #define SPRN_MAS6      0x276   /* MMU Assist Register 6 */
71219 -#define SPRN_MAS7      0x3b0   /* MMU Assist Register 7 */
71220  #define SPRN_PID1      0x279   /* Process ID Register 1 */
71221  #define SPRN_PID2      0x27A   /* Process ID Register 2 */
71222  #define SPRN_TLB0CFG   0x2B0   /* TLB 0 Config Register */
71223  #define SPRN_TLB1CFG   0x2B1   /* TLB 1 Config Register */
71224 +#define SPRN_EPR       0x2BE   /* External Proxy Register */
71225  #define SPRN_CCR1      0x378   /* Core Configuration Register 1 */
71226  #define SPRN_ZPR       0x3B0   /* Zone Protection Register (40x) */
71227 +#define SPRN_MAS7      0x3B0   /* MMU Assist Register 7 */
71228  #define SPRN_MMUCR     0x3B2   /* MMU Control Register */
71229  #define SPRN_CCR0      0x3B3   /* Core Configuration Register 0 */
71230 +#define SPRN_EPLC      0x3B3   /* External Process ID Load Context */
71231 +#define SPRN_EPSC      0x3B4   /* External Process ID Store Context */
71232  #define SPRN_SGR       0x3B9   /* Storage Guarded Register */
71233  #define SPRN_DCWR      0x3BA   /* Data Cache Write-thru Register */
71234  #define SPRN_SLER      0x3BB   /* Little-endian real mode */
71235 @@ -159,6 +169,7 @@
71236  #define SPRN_L1CSR0    0x3F2   /* L1 Cache Control and Status Register 0 */
71237  #define SPRN_L1CSR1    0x3F3   /* L1 Cache Control and Status Register 1 */
71238  #define SPRN_PIT       0x3DB   /* Programmable Interval Timer */
71239 +#define SPRN_BUCSR     0x3F5   /* Branch Unit Control and Status */
71240  #define SPRN_DCCR      0x3FA   /* Data Cache Cacheability Register */
71241  #define SPRN_ICCR      0x3FB   /* Instruction Cache Cacheability Register */
71242  #define SPRN_SVR       0x3FF   /* System Version Register */
71243 @@ -207,7 +218,6 @@
71244  #define        CCR1_TCS        0x00000080 /* Timer Clock Select */
71245  
71246  /* Bit definitions for the MCSR. */
71247 -#ifdef CONFIG_440A
71248  #define MCSR_MCS       0x80000000 /* Machine Check Summary */
71249  #define MCSR_IB                0x40000000 /* Instruction PLB Error */
71250  #define MCSR_DRB       0x20000000 /* Data Read PLB Error */
71251 @@ -217,7 +227,7 @@
71252  #define MCSR_DCSP      0x02000000 /* D-Cache Search Parity Error */
71253  #define MCSR_DCFP      0x01000000 /* D-Cache Flush Parity Error */
71254  #define MCSR_IMPE      0x00800000 /* Imprecise Machine Check Exception */
71255 -#endif
71256 +
71257  #ifdef CONFIG_E500
71258  #define MCSR_MCP       0x80000000UL /* Machine Check Input Pin */
71259  #define MCSR_ICPERR    0x40000000UL /* I-Cache Parity Error */
71260 @@ -293,7 +303,7 @@
71261  #define ESR_IMCB       0x20000000      /* Instr. Machine Check - Bus error */
71262  #define ESR_IMCT       0x10000000      /* Instr. Machine Check - Timeout */
71263  #define ESR_PIL                0x08000000      /* Program Exception - Illegal */
71264 -#define ESR_PPR                0x04000000      /* Program Exception - Priveleged */
71265 +#define ESR_PPR                0x04000000      /* Program Exception - Privileged */
71266  #define ESR_PTR                0x02000000      /* Program Exception - Trap */
71267  #define ESR_FP         0x01000000      /* Floating Point Operation */
71268  #define ESR_DST                0x00800000      /* Storage Exception - Data miss */
71269 Index: linux-2.6.24.7/include/asm-powerpc/setjmp.h
71270 ===================================================================
71271 --- /dev/null
71272 +++ linux-2.6.24.7/include/asm-powerpc/setjmp.h
71273 @@ -0,0 +1,18 @@
71274 +/*
71275 + * Copyright Â© 2008 Michael Neuling IBM Corporation
71276 + *
71277 + *      This program is free software; you can redistribute it and/or
71278 + *      modify it under the terms of the GNU General Public License
71279 + *      as published by the Free Software Foundation; either version
71280 + *      2 of the License, or (at your option) any later version.
71281 + *
71282 + */
71283 +#ifndef _ASM_POWERPC_SETJMP_H
71284 +#define _ASM_POWERPC_SETJMP_H
71285 +
71286 +#define JMP_BUF_LEN    23
71287 +
71288 +extern long setjmp(long *);
71289 +extern void longjmp(long *, long);
71290 +
71291 +#endif /* _ASM_POWERPC_SETJMP_H */
71292 Index: linux-2.6.24.7/include/asm-powerpc/smu.h
71293 ===================================================================
71294 --- linux-2.6.24.7.orig/include/asm-powerpc/smu.h
71295 +++ linux-2.6.24.7/include/asm-powerpc/smu.h
71296 @@ -22,7 +22,7 @@
71297   * Partition info commands
71298   *
71299   * These commands are used to retrieve the sdb-partition-XX datas from
71300 - * the SMU. The lenght is always 2. First byte is the subcommand code
71301 + * the SMU. The length is always 2. First byte is the subcommand code
71302   * and second byte is the partition ID.
71303   *
71304   * The reply is 6 bytes:
71305 @@ -173,12 +173,12 @@
71306   * Power supply control
71307   *
71308   * The "sub" command is an ASCII string in the data, the
71309 - * data lenght is that of the string.
71310 + * data length is that of the string.
71311   *
71312   * The VSLEW command can be used to get or set the voltage slewing.
71313 - *  - lenght 5 (only "VSLEW") : it returns "DONE" and 3 bytes of
71314 + *  - length 5 (only "VSLEW") : it returns "DONE" and 3 bytes of
71315   *    reply at data offset 6, 7 and 8.
71316 - *  - lenght 8 ("VSLEWxyz") has 3 additional bytes appended, and is
71317 + *  - length 8 ("VSLEWxyz") has 3 additional bytes appended, and is
71318   *    used to set the voltage slewing point. The SMU replies with "DONE"
71319   * I yet have to figure out their exact meaning of those 3 bytes in
71320   * both cases. They seem to be:
71321 @@ -201,20 +201,90 @@
71322   */
71323  #define SMU_CMD_READ_ADC                       0xd8
71324  
71325 +
71326  /* Misc commands
71327   *
71328   * This command seem to be a grab bag of various things
71329 + *
71330 + * Parameters:
71331 + *   1: subcommand
71332   */
71333  #define SMU_CMD_MISC_df_COMMAND                        0xdf
71334 -#define   SMU_CMD_MISC_df_SET_DISPLAY_LIT      0x02 /* i: 1 byte */
71335 +
71336 +/*
71337 + * Sets "system ready" status
71338 + *
71339 + * I did not yet understand how it exactly works or what it does.
71340 + *
71341 + * Guessing from OF code, 0x02 activates the display backlight. Apple uses/used
71342 + * the same codebase for all OF versions. On PowerBooks, this command would
71343 + * enable the backlight. For the G5s, it only activates the front LED. However,
71344 + * don't take this for granted.
71345 + *
71346 + * Parameters:
71347 + *   2: status [0x00, 0x01 or 0x02]
71348 + */
71349 +#define   SMU_CMD_MISC_df_SET_DISPLAY_LIT      0x02
71350 +
71351 +/*
71352 + * Sets mode of power switch.
71353 + *
71354 + * What this actually does is not yet known. Maybe it enables some interrupt.
71355 + *
71356 + * Parameters:
71357 + *   2: enable power switch? [0x00 or 0x01]
71358 + *   3 (optional): enable nmi? [0x00 or 0x01]
71359 + *
71360 + * Returns:
71361 + *   If parameter 2 is 0x00 and parameter 3 is not specified, returns wether
71362 + *   NMI is enabled. Otherwise unknown.
71363 + */
71364  #define   SMU_CMD_MISC_df_NMI_OPTION           0x04
71365  
71366 +/* Sets LED dimm offset.
71367 + *
71368 + * The front LED dimms itself during sleep. Its brightness (or, well, the PWM
71369 + * frequency) depends on current time. Therefore, the SMU needs to know the
71370 + * timezone.
71371 + *
71372 + * Parameters:
71373 + *   2-8: unknown (BCD coding)
71374 + */
71375 +#define   SMU_CMD_MISC_df_DIMM_OFFSET          0x99
71376 +
71377 +
71378  /*
71379   * Version info commands
71380   *
71381 - * I haven't quite tried to figure out how these work
71382 + * Parameters:
71383 + *   1 (optional): Specifies version part to retrieve
71384 + *
71385 + * Returns:
71386 + *   Version value
71387   */
71388  #define SMU_CMD_VERSION_COMMAND                        0xea
71389 +#define   SMU_VERSION_RUNNING                  0x00
71390 +#define   SMU_VERSION_BASE                     0x01
71391 +#define   SMU_VERSION_UPDATE                   0x02
71392 +
71393 +
71394 +/*
71395 + * Switches
71396 + *
71397 + * These are switches whose status seems to be known to the SMU.
71398 + *
71399 + * Parameters:
71400 + *   none
71401 + *
71402 + * Result:
71403 + *   Switch bits (ORed, see below)
71404 + */
71405 +#define SMU_CMD_SWITCHES                       0xdc
71406 +
71407 +/* Switches bits */
71408 +#define SMU_SWITCH_CASE_CLOSED                 0x01
71409 +#define SMU_SWITCH_AC_POWER                    0x04
71410 +#define SMU_SWITCH_POWER_SWITCH                        0x08
71411  
71412  
71413  /*
71414 @@ -243,10 +313,64 @@
71415   */
71416  #define SMU_CMD_MISC_ee_COMMAND                        0xee
71417  #define   SMU_CMD_MISC_ee_GET_DATABLOCK_REC    0x02
71418 -#define          SMU_CMD_MISC_ee_LEDS_CTRL             0x04 /* i: 00 (00,01) [00] */
71419 +
71420 +/* Retrieves currently used watts.
71421 + *
71422 + * Parameters:
71423 + *   1: 0x03 (Meaning unknown)
71424 + */
71425 +#define   SMU_CMD_MISC_ee_GET_WATTS            0x03
71426 +
71427 +#define   SMU_CMD_MISC_ee_LEDS_CTRL            0x04 /* i: 00 (00,01) [00] */
71428  #define   SMU_CMD_MISC_ee_GET_DATA             0x05 /* i: 00 , o: ?? */
71429  
71430  
71431 +/*
71432 + * Power related commands
71433 + *
71434 + * Parameters:
71435 + *   1: subcommand
71436 + */
71437 +#define SMU_CMD_POWER_EVENTS_COMMAND           0x8f
71438 +
71439 +/* SMU_POWER_EVENTS subcommands */
71440 +enum {
71441 +       SMU_PWR_GET_POWERUP_EVENTS      = 0x00,
71442 +       SMU_PWR_SET_POWERUP_EVENTS      = 0x01,
71443 +       SMU_PWR_CLR_POWERUP_EVENTS      = 0x02,
71444 +       SMU_PWR_GET_WAKEUP_EVENTS       = 0x03,
71445 +       SMU_PWR_SET_WAKEUP_EVENTS       = 0x04,
71446 +       SMU_PWR_CLR_WAKEUP_EVENTS       = 0x05,
71447 +
71448 +       /*
71449 +        * Get last shutdown cause
71450 +        *
71451 +        * Returns:
71452 +        *   1 byte (signed char): Last shutdown cause. Exact meaning unknown.
71453 +        */
71454 +       SMU_PWR_LAST_SHUTDOWN_CAUSE     = 0x07,
71455 +
71456 +       /*
71457 +        * Sets or gets server ID. Meaning or use is unknown.
71458 +        *
71459 +        * Parameters:
71460 +        *   2 (optional): Set server ID (1 byte)
71461 +        *
71462 +        * Returns:
71463 +        *   1 byte (server ID?)
71464 +        */
71465 +       SMU_PWR_SERVER_ID               = 0x08,
71466 +};
71467 +
71468 +/* Power events wakeup bits */
71469 +enum {
71470 +       SMU_PWR_WAKEUP_KEY              = 0x01, /* Wake on key press */
71471 +       SMU_PWR_WAKEUP_AC_INSERT        = 0x02, /* Wake on AC adapter plug */
71472 +       SMU_PWR_WAKEUP_AC_CHANGE        = 0x04,
71473 +       SMU_PWR_WAKEUP_LID_OPEN         = 0x08,
71474 +       SMU_PWR_WAKEUP_RING             = 0x10,
71475 +};
71476 +
71477  
71478  /*
71479   * - Kernel side interface -
71480 @@ -564,13 +688,13 @@ struct smu_user_cmd_hdr
71481  
71482         __u8            cmd;                    /* SMU command byte */
71483         __u8            pad[3];                 /* padding */
71484 -       __u32           data_len;               /* Lenght of data following */
71485 +       __u32           data_len;               /* Length of data following */
71486  };
71487  
71488  struct smu_user_reply_hdr
71489  {
71490         __u32           status;                 /* Command status */
71491 -       __u32           reply_len;              /* Lenght of data follwing */
71492 +       __u32           reply_len;              /* Length of data follwing */
71493  };
71494  
71495  #endif /*  _SMU_H */
71496 Index: linux-2.6.24.7/include/asm-powerpc/sparsemem.h
71497 ===================================================================
71498 --- linux-2.6.24.7.orig/include/asm-powerpc/sparsemem.h
71499 +++ linux-2.6.24.7/include/asm-powerpc/sparsemem.h
71500 @@ -10,13 +10,8 @@
71501   */
71502  #define SECTION_SIZE_BITS       24
71503  
71504 -#if defined(CONFIG_PS3_USE_LPAR_ADDR)
71505 -#define MAX_PHYSADDR_BITS       47
71506 -#define MAX_PHYSMEM_BITS        47
71507 -#else
71508  #define MAX_PHYSADDR_BITS       44
71509  #define MAX_PHYSMEM_BITS        44
71510 -#endif
71511  
71512  #ifdef CONFIG_MEMORY_HOTPLUG
71513  extern void create_section_mapping(unsigned long start, unsigned long end);
71514 Index: linux-2.6.24.7/include/asm-powerpc/spu.h
71515 ===================================================================
71516 --- linux-2.6.24.7.orig/include/asm-powerpc/spu.h
71517 +++ linux-2.6.24.7/include/asm-powerpc/spu.h
71518 @@ -104,6 +104,7 @@
71519  
71520  struct spu_context;
71521  struct spu_runqueue;
71522 +struct spu_lscsa;
71523  struct device_node;
71524  
71525  enum spu_utilization_state {
71526 @@ -145,7 +146,6 @@ struct spu {
71527         void (* ibox_callback)(struct spu *spu);
71528         void (* stop_callback)(struct spu *spu);
71529         void (* mfc_callback)(struct spu *spu);
71530 -       void (* dma_callback)(struct spu *spu, int type);
71531  
71532         char irq_c0[8];
71533         char irq_c1[8];
71534 @@ -196,10 +196,11 @@ struct cbe_spu_info {
71535  extern struct cbe_spu_info cbe_spu_info[];
71536  
71537  void spu_init_channels(struct spu *spu);
71538 -int spu_irq_class_0_bottom(struct spu *spu);
71539 -int spu_irq_class_1_bottom(struct spu *spu);
71540  void spu_irq_setaffinity(struct spu *spu, int cpu);
71541  
71542 +void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa,
71543 +               void *code, int code_size);
71544 +
71545  #ifdef CONFIG_KEXEC
71546  void crash_register_spus(struct list_head *list);
71547  #else
71548 @@ -210,6 +211,7 @@ static inline void crash_register_spus(s
71549  
71550  extern void spu_invalidate_slbs(struct spu *spu);
71551  extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
71552 +int spu_64k_pages_available(void);
71553  
71554  /* Calls from the memory management to the SPU */
71555  struct mm_struct;
71556 @@ -279,6 +281,8 @@ void spu_remove_sysdev_attr(struct sysde
71557  int spu_add_sysdev_attr_group(struct attribute_group *attrs);
71558  void spu_remove_sysdev_attr_group(struct attribute_group *attrs);
71559  
71560 +int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
71561 +               unsigned long dsisr, unsigned *flt);
71562  
71563  /*
71564   * Notifier blocks:
71565 @@ -303,7 +307,7 @@ extern void notify_spus_active(void);
71566  extern void do_notify_spus_active(void);
71567  
71568  /*
71569 - * This defines the Local Store, Problem Area and Privlege Area of an SPU.
71570 + * This defines the Local Store, Problem Area and Privilege Area of an SPU.
71571   */
71572  
71573  union mfc_tag_size_class_cmd {
71574 @@ -524,8 +528,24 @@ struct spu_priv1 {
71575  #define CLASS2_ENABLE_SPU_STOP_INTR                    0x2L
71576  #define CLASS2_ENABLE_SPU_HALT_INTR                    0x4L
71577  #define CLASS2_ENABLE_SPU_DMA_TAG_GROUP_COMPLETE_INTR  0x8L
71578 +#define CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR           0x10L
71579         u8  pad_0x118_0x140[0x28];                              /* 0x118 */
71580         u64 int_stat_RW[3];                                     /* 0x140 */
71581 +#define CLASS0_DMA_ALIGNMENT_INTR                      0x1L
71582 +#define CLASS0_INVALID_DMA_COMMAND_INTR                        0x2L
71583 +#define CLASS0_SPU_ERROR_INTR                          0x4L
71584 +#define CLASS0_INTR_MASK                               0x7L
71585 +#define CLASS1_SEGMENT_FAULT_INTR                      0x1L
71586 +#define CLASS1_STORAGE_FAULT_INTR                      0x2L
71587 +#define CLASS1_LS_COMPARE_SUSPEND_ON_GET_INTR          0x4L
71588 +#define CLASS1_LS_COMPARE_SUSPEND_ON_PUT_INTR          0x8L
71589 +#define CLASS1_INTR_MASK                               0xfL
71590 +#define CLASS2_MAILBOX_INTR                            0x1L
71591 +#define CLASS2_SPU_STOP_INTR                           0x2L
71592 +#define CLASS2_SPU_HALT_INTR                           0x4L
71593 +#define CLASS2_SPU_DMA_TAG_GROUP_COMPLETE_INTR         0x8L
71594 +#define CLASS2_MAILBOX_THRESHOLD_INTR                  0x10L
71595 +#define CLASS2_INTR_MASK                               0x1fL
71596         u8  pad_0x158_0x180[0x28];                              /* 0x158 */
71597         u64 int_route_RW;                                       /* 0x180 */
71598  
71599 Index: linux-2.6.24.7/include/asm-powerpc/spu_csa.h
71600 ===================================================================
71601 --- linux-2.6.24.7.orig/include/asm-powerpc/spu_csa.h
71602 +++ linux-2.6.24.7/include/asm-powerpc/spu_csa.h
71603 @@ -194,7 +194,7 @@ struct spu_priv1_collapsed {
71604  };
71605  
71606  /*
71607 - * struct spu_priv2_collapsed - condensed priviliged 2 area, w/o pads.
71608 + * struct spu_priv2_collapsed - condensed privileged 2 area, w/o pads.
71609   */
71610  struct spu_priv2_collapsed {
71611         u64 slb_index_W;
71612 @@ -254,20 +254,11 @@ struct spu_state {
71613         u64 spu_chnldata_RW[32];
71614         u32 spu_mailbox_data[4];
71615         u32 pu_mailbox_data[1];
71616 -       u64 dar, dsisr;
71617 +       u64 dar, dsisr, class_0_pending;
71618         unsigned long suspend_time;
71619         spinlock_t register_lock;
71620  };
71621  
71622 -extern int spu_init_csa(struct spu_state *csa);
71623 -extern void spu_fini_csa(struct spu_state *csa);
71624 -extern int spu_save(struct spu_state *prev, struct spu *spu);
71625 -extern int spu_restore(struct spu_state *new, struct spu *spu);
71626 -extern int spu_switch(struct spu_state *prev, struct spu_state *new,
71627 -                     struct spu *spu);
71628 -extern int spu_alloc_lscsa(struct spu_state *csa);
71629 -extern void spu_free_lscsa(struct spu_state *csa);
71630 -
71631  #endif /* !__SPU__ */
71632  #endif /* __KERNEL__ */
71633  #endif /* !__ASSEMBLY__ */
71634 Index: linux-2.6.24.7/include/asm-powerpc/spu_priv1.h
71635 ===================================================================
71636 --- linux-2.6.24.7.orig/include/asm-powerpc/spu_priv1.h
71637 +++ linux-2.6.24.7/include/asm-powerpc/spu_priv1.h
71638 @@ -24,6 +24,7 @@
71639  #include <linux/types.h>
71640  
71641  struct spu;
71642 +struct spu_context;
71643  
71644  /* access to priv1 registers */
71645  
71646 @@ -178,6 +179,8 @@ struct spu_management_ops {
71647         int (*enumerate_spus)(int (*fn)(void *data));
71648         int (*create_spu)(struct spu *spu, void *data);
71649         int (*destroy_spu)(struct spu *spu);
71650 +       void (*enable_spu)(struct spu_context *ctx);
71651 +       void (*disable_spu)(struct spu_context *ctx);
71652         int (*init_affinity)(void);
71653  };
71654  
71655 @@ -207,6 +210,18 @@ spu_init_affinity (void)
71656         return spu_management_ops->init_affinity();
71657  }
71658  
71659 +static inline void
71660 +spu_enable_spu (struct spu_context *ctx)
71661 +{
71662 +       spu_management_ops->enable_spu(ctx);
71663 +}
71664 +
71665 +static inline void
71666 +spu_disable_spu (struct spu_context *ctx)
71667 +{
71668 +       spu_management_ops->disable_spu(ctx);
71669 +}
71670 +
71671  /*
71672   * The declarations folowing are put here for convenience
71673   * and only intended to be used by the platform setup code.
71674 Index: linux-2.6.24.7/include/asm-powerpc/system.h
71675 ===================================================================
71676 --- linux-2.6.24.7.orig/include/asm-powerpc/system.h
71677 +++ linux-2.6.24.7/include/asm-powerpc/system.h
71678 @@ -169,6 +169,8 @@ extern int do_page_fault(struct pt_regs 
71679  extern void bad_page_fault(struct pt_regs *, unsigned long, int);
71680  extern int die(const char *, struct pt_regs *, long);
71681  extern void _exception(int, struct pt_regs *, int, unsigned long);
71682 +extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
71683 +
71684  #ifdef CONFIG_BOOKE_WDT
71685  extern u32 booke_wdt_enabled;
71686  extern u32 booke_wdt_period;
71687 Index: linux-2.6.24.7/include/asm-powerpc/udbg.h
71688 ===================================================================
71689 --- linux-2.6.24.7.orig/include/asm-powerpc/udbg.h
71690 +++ linux-2.6.24.7/include/asm-powerpc/udbg.h
71691 @@ -48,6 +48,7 @@ extern void __init udbg_init_rtas_consol
71692  extern void __init udbg_init_debug_beat(void);
71693  extern void __init udbg_init_btext(void);
71694  extern void __init udbg_init_44x_as1(void);
71695 +extern void __init udbg_init_40x_realmode(void);
71696  extern void __init udbg_init_cpm(void);
71697  
71698  #endif /* __KERNEL__ */
71699 Index: linux-2.6.24.7/include/asm-ppc/8xx_immap.h
71700 ===================================================================
71701 --- linux-2.6.24.7.orig/include/asm-ppc/8xx_immap.h
71702 +++ linux-2.6.24.7/include/asm-ppc/8xx_immap.h
71703 @@ -123,7 +123,7 @@ typedef struct      mem_ctlr {
71704  #define OR_G5LA                0x00000400      /* Output #GPL5 on #GPL_A5              */
71705  #define OR_G5LS                0x00000200      /* Drive #GPL high on falling edge of...*/
71706  #define OR_BI          0x00000100      /* Burst inhibit                        */
71707 -#define OR_SCY_MSK     0x000000f0      /* Cycle Lenght in Clocks               */
71708 +#define OR_SCY_MSK     0x000000f0      /* Cycle Length in Clocks               */
71709  #define OR_SCY_0_CLK   0x00000000      /* 0 clock cycles wait states           */
71710  #define OR_SCY_1_CLK   0x00000010      /* 1 clock cycles wait states           */
71711  #define OR_SCY_2_CLK   0x00000020      /* 2 clock cycles wait states           */
71712 Index: linux-2.6.24.7/include/asm-ppc/commproc.h
71713 ===================================================================
71714 --- linux-2.6.24.7.orig/include/asm-ppc/commproc.h
71715 +++ linux-2.6.24.7/include/asm-ppc/commproc.h
71716 @@ -681,7 +681,7 @@ typedef struct risc_timer_pram {
71717  #define        CICR_SCC_SCC3           ((uint)0x00200000)      /* SCC3 @ SCCc */
71718  #define        CICR_SCB_SCC2           ((uint)0x00040000)      /* SCC2 @ SCCb */
71719  #define        CICR_SCA_SCC1           ((uint)0x00000000)      /* SCC1 @ SCCa */
71720 -#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrrupt */
71721 +#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrupt */
71722  #define CICR_HP_MASK           ((uint)0x00001f00)      /* Hi-pri int. */
71723  #define CICR_IEN               ((uint)0x00000080)      /* Int. enable */
71724  #define CICR_SPS               ((uint)0x00000001)      /* SCC Spread */
71725 Index: linux-2.6.24.7/include/asm-ppc/mmu.h
71726 ===================================================================
71727 --- linux-2.6.24.7.orig/include/asm-ppc/mmu.h
71728 +++ linux-2.6.24.7/include/asm-ppc/mmu.h
71729 @@ -383,6 +383,12 @@ typedef struct _P601_BAT {
71730  #define BOOKE_PAGESZ_256GB     14
71731  #define BOOKE_PAGESZ_1TB       15
71732  
71733 +#ifndef CONFIG_SERIAL_TEXT_DEBUG
71734 +#define PPC44x_EARLY_TLBS      1
71735 +#else
71736 +#define PPC44x_EARLY_TLBS      2
71737 +#endif
71738 +
71739  /*
71740   * Freescale Book-E MMU support
71741   */
71742 Index: linux-2.6.24.7/include/asm-ppc/mpc52xx_psc.h
71743 ===================================================================
71744 --- linux-2.6.24.7.orig/include/asm-ppc/mpc52xx_psc.h
71745 +++ linux-2.6.24.7/include/asm-ppc/mpc52xx_psc.h
71746 @@ -159,6 +159,9 @@ struct mpc52xx_psc {
71747         u8              reserved16[3];
71748         u8              irfdr;          /* PSC + 0x54 */
71749         u8              reserved17[3];
71750 +};
71751 +
71752 +struct mpc52xx_psc_fifo {
71753         u16             rfnum;          /* PSC + 0x58 */
71754         u16             reserved18;
71755         u16             tfnum;          /* PSC + 0x5c */
71756 Index: linux-2.6.24.7/include/asm-ppc/reg_booke.h
71757 ===================================================================
71758 --- linux-2.6.24.7.orig/include/asm-ppc/reg_booke.h
71759 +++ linux-2.6.24.7/include/asm-ppc/reg_booke.h
71760 @@ -207,7 +207,7 @@
71761  #define        CCR1_TCS        0x00000080 /* Timer Clock Select */
71762  
71763  /* Bit definitions for the MCSR. */
71764 -#ifdef CONFIG_440A
71765 +#ifdef CONFIG_4xx
71766  #define MCSR_MCS       0x80000000 /* Machine Check Summary */
71767  #define MCSR_IB                0x40000000 /* Instruction PLB Error */
71768  #define MCSR_DRB       0x20000000 /* Data Read PLB Error */
71769 @@ -283,7 +283,7 @@
71770  #define ESR_IMCB       0x20000000      /* Instr. Machine Check - Bus error */
71771  #define ESR_IMCT       0x10000000      /* Instr. Machine Check - Timeout */
71772  #define ESR_PIL                0x08000000      /* Program Exception - Illegal */
71773 -#define ESR_PPR                0x04000000      /* Program Exception - Priveleged */
71774 +#define ESR_PPR                0x04000000      /* Program Exception - Privileged */
71775  #define ESR_PTR                0x02000000      /* Program Exception - Trap */
71776  #define ESR_FP         0x01000000      /* Floating Point Operation */
71777  #define ESR_DST                0x00800000      /* Storage Exception - Data miss */
71778 Index: linux-2.6.24.7/include/linux/of.h
71779 ===================================================================
71780 --- linux-2.6.24.7.orig/include/linux/of.h
71781 +++ linux-2.6.24.7/include/linux/of.h
71782 @@ -17,6 +17,7 @@
71783   */
71784  #include <linux/types.h>
71785  #include <linux/bitops.h>
71786 +#include <linux/mod_devicetable.h>
71787  
71788  #include <asm/prom.h>
71789  
71790 @@ -41,11 +42,20 @@ extern struct device_node *of_find_compa
71791  #define for_each_compatible_node(dn, type, compatible) \
71792         for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
71793              dn = of_find_compatible_node(dn, type, compatible))
71794 +extern struct device_node *of_find_matching_node(struct device_node *from,
71795 +       const struct of_device_id *matches);
71796 +#define for_each_matching_node(dn, matches) \
71797 +       for (dn = of_find_matching_node(NULL, matches); dn; \
71798 +            dn = of_find_matching_node(dn, matches))
71799  extern struct device_node *of_find_node_by_path(const char *path);
71800  extern struct device_node *of_find_node_by_phandle(phandle handle);
71801  extern struct device_node *of_get_parent(const struct device_node *node);
71802  extern struct device_node *of_get_next_child(const struct device_node *node,
71803                                              struct device_node *prev);
71804 +#define for_each_child_of_node(parent, child) \
71805 +       for (child = of_get_next_child(parent, NULL); child != NULL; \
71806 +            child = of_get_next_child(parent, child))
71807 +
71808  extern struct property *of_find_property(const struct device_node *np,
71809                                          const char *name,
71810                                          int *lenp);
71811 @@ -56,5 +66,7 @@ extern const void *of_get_property(const
71812                                 int *lenp);
71813  extern int of_n_addr_cells(struct device_node *np);
71814  extern int of_n_size_cells(struct device_node *np);
71815 +extern const struct of_device_id *of_match_node(
71816 +       const struct of_device_id *matches, const struct device_node *node);
71817  
71818  #endif /* _LINUX_OF_H */
71819 Index: linux-2.6.24.7/include/linux/of_device.h
71820 ===================================================================
71821 --- linux-2.6.24.7.orig/include/linux/of_device.h
71822 +++ linux-2.6.24.7/include/linux/of_device.h
71823 @@ -10,8 +10,6 @@
71824  
71825  #define        to_of_device(d) container_of(d, struct of_device, dev)
71826  
71827 -extern const struct of_device_id *of_match_node(
71828 -       const struct of_device_id *matches, const struct device_node *node);
71829  extern const struct of_device_id *of_match_device(
71830         const struct of_device_id *matches, const struct of_device *dev);
71831  
71832 Index: linux-2.6.24.7/include/linux/pata_platform.h
71833 ===================================================================
71834 --- linux-2.6.24.7.orig/include/linux/pata_platform.h
71835 +++ linux-2.6.24.7/include/linux/pata_platform.h
71836 @@ -15,4 +15,13 @@ struct pata_platform_info {
71837         unsigned int irq_flags;
71838  };
71839  
71840 +extern int __devinit __pata_platform_probe(struct device *dev,
71841 +                                          struct resource *io_res,
71842 +                                          struct resource *ctl_res,
71843 +                                          struct resource *irq_res,
71844 +                                          unsigned int ioport_shift,
71845 +                                          int __pio_mask);
71846 +
71847 +extern int __devexit __pata_platform_remove(struct device *dev);
71848 +
71849  #endif /* __LINUX_PATA_PLATFORM_H */
71850 Index: linux-2.6.24.7/include/linux/phy_fixed.h
71851 ===================================================================
71852 --- linux-2.6.24.7.orig/include/linux/phy_fixed.h
71853 +++ linux-2.6.24.7/include/linux/phy_fixed.h
71854 @@ -1,38 +1,31 @@
71855  #ifndef __PHY_FIXED_H
71856  #define __PHY_FIXED_H
71857  
71858 -#define MII_REGS_NUM   29
71859 -
71860 -/* max number of virtual phy stuff */
71861 -#define MAX_PHY_AMNT   10
71862 -/*
71863 -    The idea is to emulate normal phy behavior by responding with
71864 -    pre-defined values to mii BMCR read, so that read_status hook could
71865 -    take all the needed info.
71866 -*/
71867 -
71868  struct fixed_phy_status {
71869 -       u8 link;
71870 -       u16 speed;
71871 -       u8 duplex;
71872 +       int link;
71873 +       int speed;
71874 +       int duplex;
71875 +       int pause;
71876 +       int asym_pause;
71877  };
71878  
71879 -/*-----------------------------------------------------------------------------
71880 - *  Private information hoder for mii_bus
71881 - *-----------------------------------------------------------------------------*/
71882 -struct fixed_info {
71883 -       u16 *regs;
71884 -       u8 regs_num;
71885 -       struct fixed_phy_status phy_status;
71886 -       struct phy_device *phydev;      /* pointer to the container */
71887 -       /* link & speed cb */
71888 -       int (*link_update) (struct net_device *, struct fixed_phy_status *);
71889 +#ifdef CONFIG_FIXED_PHY
71890 +extern int fixed_phy_add(unsigned int irq, int phy_id,
71891 +                        struct fixed_phy_status *status);
71892 +#else
71893 +static inline int fixed_phy_add(unsigned int irq, int phy_id,
71894 +                               struct fixed_phy_status *status)
71895 +{
71896 +       return -ENODEV;
71897 +}
71898 +#endif /* CONFIG_FIXED_PHY */
71899  
71900 -};
71901 -
71902 -
71903 -int fixed_mdio_set_link_update(struct phy_device *,
71904 -       int (*link_update) (struct net_device *, struct fixed_phy_status *));
71905 -struct fixed_info *fixed_mdio_get_phydev (int phydev_ind);
71906 +/*
71907 + * This function issued only by fixed_phy-aware drivers, no need
71908 + * protect it with #ifdef
71909 + */
71910 +extern int fixed_phy_set_link_update(struct phy_device *phydev,
71911 +                       int (*link_update)(struct net_device *,
71912 +                                          struct fixed_phy_status *));
71913  
71914  #endif /* __PHY_FIXED_H */
71915 Index: linux-2.6.24.7/include/linux/pmu.h
71916 ===================================================================
71917 --- linux-2.6.24.7.orig/include/linux/pmu.h
71918 +++ linux-2.6.24.7/include/linux/pmu.h
71919 @@ -159,41 +159,7 @@ extern void pmu_unlock(void);
71920  extern int pmu_present(void);
71921  extern int pmu_get_model(void);
71922  
71923 -#ifdef CONFIG_PM
71924 -/*
71925 - * Stuff for putting the powerbook to sleep and waking it again.
71926 - *
71927 - */
71928 -#include <linux/list.h>
71929 -
71930 -struct pmu_sleep_notifier
71931 -{
71932 -       void (*notifier_call)(struct pmu_sleep_notifier *self, int when);
71933 -       int priority;
71934 -       struct list_head list;
71935 -};
71936 -
71937 -/* Code values for calling sleep/wakeup handlers
71938 - */
71939 -#define PBOOK_SLEEP_REQUEST    1
71940 -#define PBOOK_SLEEP_NOW                2
71941 -#define PBOOK_WAKE             3
71942 -
71943 -/* priority levels in notifiers */
71944 -#define SLEEP_LEVEL_VIDEO      100     /* Video driver (first wake) */
71945 -#define SLEEP_LEVEL_MEDIABAY   90      /* Media bay driver */
71946 -#define SLEEP_LEVEL_BLOCK      80      /* IDE, SCSI */
71947 -#define SLEEP_LEVEL_NET                70      /* bmac, gmac */
71948 -#define SLEEP_LEVEL_MISC       60      /* Anything else */
71949 -#define SLEEP_LEVEL_USERLAND   55      /* Reserved for apm_emu */
71950 -#define SLEEP_LEVEL_ADB                50      /* ADB (async) */
71951 -#define SLEEP_LEVEL_SOUND      40      /* Sound driver (blocking) */
71952 -
71953 -/* special register notifier functions */
71954 -int pmu_register_sleep_notifier(struct pmu_sleep_notifier* notifier);
71955 -int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier);
71956 -
71957 -#endif /* CONFIG_PM */
71958 +extern void pmu_backlight_set_sleep(int sleep);
71959  
71960  #define PMU_MAX_BATTERIES      2
71961